コード例 #1
0
void
JXTextMenuTable::Draw
	(
	JXWindowPainter&	p,
	const JRect&		rect
	)
{
	JXMenuTable::Draw(p, rect);

	const JCoordinate w  = GetApertureWidth();
	const JSize rowCount = GetRowCount();
	for (JIndex i=1; i<rowCount; i++)	// ignore separator after last item
		{
		if (itsTextMenuData->HasSeparator(i))
			{
			JRect r = GetCellRect(JPoint(1,i));
			r.top   = r.bottom - kSeparatorHeight;
			r.right = r.left + w;
//			JXDrawDownFrame(p, r, kSeparatorHeight/2);

			r.top = r.ycenter() - 1;
			r.bottom = r.top + 2;
			JXDrawDownFrame(p, r, 1);
			}
		}

	if (itsHilightRow != 0)
		{
		const JRect r = GetCellRect(JPoint(1, itsHilightRow));
		JRect r1      = AdjustRectForSeparator(itsHilightRow, r);
		r1.right = r1.left + w;
		JXDrawUpFrame(p, r1, kHilightBorderWidth);
		}
}
コード例 #2
0
void
JXTreeListWidget::AdjustColWidths()
{
	if (itsAdjustToTreeTask != NULL)
		{
		return;
		}

	const JSize colCount = GetColCount();
	if (itsMinColWidths->GetElementCount() != colCount)
		{
		NeedsAdjustToTree();
		return;
		}

	for (JIndex i=1; i<=colCount; i++)
		{
		SetColWidth(i, itsMinColWidths->GetElement(i));
		}

	if (ColIndexValid(itsElasticColIndex))
		{
		const JCoordinate minReqWidth = itsMinColWidths->GetElement(itsElasticColIndex);
		if (minReqWidth > 0)
			{
			const JCoordinate availWidth =
				GetApertureWidth() - (GetBoundsWidth() - GetColWidth(itsElasticColIndex));
			SetColWidth(itsElasticColIndex, JMax(minReqWidth, availWidth));
			}
		}
}
コード例 #3
0
THXVarTable::THXVarTable
	(
	THXVarList*			varList,
	JXTextMenu*			fontMenu,
	JXScrollbarSet*		scrollbarSet,
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXEditTable(1,1, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h)
{
	const JSize rowHeight = 2*kVMarginWidth +
		(GetFontManager())->GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle());
	SetDefaultRowHeight(rowHeight);

	itsVarList   = varList;
	itsTextInput = NULL;
	itsFontMenu  = fontMenu;

	AppendCols(2);	// name, function

	const JSize count = itsVarList->GetElementCount() - THXVarList::kUserFnOffset;
	AppendRows(count);

	FitToEnclosure();	// make sure SetColWidth() won't fail
	ListenTo(this);		// adjust fn col width

	SetColWidth(kNameColumn, GetApertureWidth()/3);
	// kFnColumn width set automatically
}
コード例 #4
0
void
JXRowHeaderWidget::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXEditTable::ApertureResized(dw,dh);
	SetColWidth(1, GetApertureWidth());
}
コード例 #5
0
void
CBMacroSetTable::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXStringTable::ApertureResized(dw,dh);
	SetColWidth(1, GetApertureWidth());
}
コード例 #6
0
JXWidgetSet*
JXVertPartition::CreateCompartment
	(
	const JIndex		index,
	const JCoordinate	position,
	const JCoordinate	size
	)
{
	JXWidgetSet* compartment =
		new JXWidgetSet(this, kHElastic, kFixedTop,
						0,position, GetApertureWidth(), size);
	assert( compartment != NULL );
	return compartment;
}
コード例 #7
0
JXRowHeaderWidget::JXRowHeaderWidget
	(
	JXTable*			table,
	JXScrollbarSet*		scrollbarSet,
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXEditTable(1,w, NULL, enclosure, hSizing,vSizing, x,y, w,h)
{
	assert( table != NULL && scrollbarSet != NULL );

	itsTable = table;
	itsTable->SetRowHeader(this);
	ListenTo(itsTable);

	itsVScrollbar = scrollbarSet->GetVScrollbar();
	ListenTo(itsVScrollbar);

	itsTitles = NULL;

	itsAllowRowResizingFlag = kJFalse;
	itsMinRowHeight         = 1;
	itsHMarginWidth         = 2*kCellFrameWidth;
	itsMaxBcastWidth        = 0;

	itsDragType = kInvalidDrag;

	itsDragLineCursor    = JXGetDragHorizLineCursor(GetDisplay());
	itsDragAllLineCursor = JXGetDragAllHorizLineCursor(GetDisplay());

	SetColBorderInfo(0, (GetColormap())->GetBlackColor());

	// override JXEditTable

	WantInput(kJFalse);
	SetBackColor((GetColormap())->GetDefaultBackColor());

	AppendCols(1, GetApertureWidth());
	AdjustToTable();
}
コード例 #8
0
void
JXVertPartition::SetCompartmentSizes()
{
	const JCoordinate w = GetApertureWidth();

	const JSize compartmentCount = GetCompartmentCount();
	JCoordinate y = 0;
	for (JIndex i=1; i<=compartmentCount; i++)
		{
		const JCoordinate h = GetCompartmentSize(i);
		assert( h >= JPartition::GetMinCompartmentSize(i) );

		JXContainer* compartment = GetCompartment(i);
		compartment->Place(0,y);
		compartment->SetSize(w,h);
		y += h + kDragRegionSize;
		}
}
コード例 #9
0
void
JXFSBindingTable::UpdateColWidths()
{
	JCoordinate borderWidth;
	JColorIndex color;
	GetColBorderInfo(&borderWidth, &color);

	JCoordinate w = GetApertureWidth();
	for (JIndex i=1; i<=kColCount; i++)
		{
		if (i != kCommandColumn)
			{
			w -= GetColWidth(i) + borderWidth;
			}
		}

	w = JMax(w, kInitColWidth[ kCommandColumn-1 ]);
	SetColWidth(kCommandColumn, w);
}
コード例 #10
0
void
GMFilterMBoxTable::AdjustColWidths()
{
	const JSize apWidth = GetApertureWidth();

	JCoordinate lineWidth;
	JColorIndex color;
	GetColBorderInfo(&lineWidth, &color);
	const JSize usedWidth =
		GetColWidth(kCopyColumn) + lineWidth;

	if (apWidth > usedWidth)
		{
		SetColWidth(kMBoxColumn, apWidth - usedWidth);
		}
	else
		{
		// I'll really need to adjust this relative to the size of the patterns.
		}
}
コード例 #11
0
void
THXVarTable::AdjustColWidths()
{
	const JSize apWidth = GetApertureWidth();

	JCoordinate lineWidth;
	JColorIndex color;
	GetColBorderInfo(&lineWidth, &color);
	const JSize usedWidth = GetColWidth(kNameColumn) + lineWidth;

	if (apWidth > usedWidth)
		{
		SetColWidth(kFnColumn, apWidth - usedWidth);
		}
	else
		{
		const JSize nameWidth = apWidth/3;
		SetColWidth(kNameColumn, nameWidth);
		SetColWidth(kFnColumn, apWidth - nameWidth - lineWidth);
		}
}
コード例 #12
0
void
CMLineIndexTable::AdjustToText()
{
	const JFontManager* fontMgr = GetFontManager();

	JFont font = itsText->GetCurrentFont();

	const JSize lineCount       = itsText->IsEmpty() ? 0 : itsText->GetLineCount();
	const JString lineCountStr  = GetLongestLineText(lineCount);
	const JSize lineHeight      = font.GetLineHeight();
	const JSize lineNumberWidth = font.GetStringWidth(lineCountStr);

	SetColWidth(kBreakpointColumn, lineHeight);
	SetColWidth(kExecPointColumn,  lineHeight);
	SetColWidth(kLineNumberColumn, lineNumberWidth + 2*kMarginWidth);

	SetAllRowHeights(lineHeight);
	const JSize origRowCount = GetRowCount();
	if (origRowCount < lineCount)
		{
		AppendRows(lineCount - origRowCount, lineHeight);
		}
	else if (origRowCount > lineCount)
		{
		RemovePrevRows(origRowCount, origRowCount - lineCount);
		}

	const JCoordinate tableWidth = GetBoundsWidth();
	const JCoordinate apWidth    = GetApertureWidth();
	if (tableWidth != apWidth)
		{
		AdjustSize(tableWidth-apWidth, 0);
		itsText->Place(GetFrameWidth(), 0);
		itsText->AdjustSize(apWidth-tableWidth, 0);
		}

	ScrollTo(0, itsVScrollbar->GetValue());
	UpdateBreakpoints();
}
コード例 #13
0
ファイル: JXTable.cpp プロジェクト: mbert/mulberry-lib-jx
JCoordinate
JXTable::TableGetApertureWidth()
	const
{
	return GetApertureWidth();
}
コード例 #14
0
void
GLFitParameterTable::AdjustColWidth()
{
	AdjustColWidth(GetApertureWidth());
}
コード例 #15
0
void
CBSymbolTable::AdjustColWidths()
{
	const JCoordinate minWidth = kIconWidth + itsMaxStringWidth + kTextPadding;
	SetColWidth(1, JMax(minWidth, GetApertureWidth()));
}
コード例 #16
0
void
JX2DCurveNameList::AdjustColWidth()
{
	SetColWidth(1, JMax(itsMinColWidth, GetApertureWidth()));
}
コード例 #17
0
JCoordinate
JXHorizPartition::GetTotalSize()
	const
{
	return GetApertureWidth();
}
コード例 #18
0
void
GMFilterNameTable::AdjustColWidths()
{
	SetColWidth(1, GetApertureWidth());
}
コード例 #19
0
void
GLFitDescriptionList::AdjustColWidth()
{
	SetColWidth(1, JMax(itsMinColWidth, GetApertureWidth()));
}