Exemplo n.º 1
0
JBoolean
JXColHeaderWidget::InDragRegion
	(
	const JPoint&	pt,
	JPoint*			cell
	)
	const
{
	JCoordinate width;
	JColorIndex color;
	GetColBorderInfo(&width, &color);
	const JCoordinate halfWidth = kDragRegionHalfWidth + (width+1)/2;

	JPoint virtualPt(pt.x - halfWidth, pt.y);
	if (GetCell(virtualPt, cell))
		{
		JRect cellRect = GetCellRect(*cell);
		if (cellRect.right - halfWidth <= pt.x &&
			pt.x <= cellRect.right + halfWidth)
			{
			return kJTrue;
			}
		}

	return kJFalse;
}
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);
}
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.
		}
}
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);
		}
}
void
GLFitParameterTable::AdjustColWidth
	(
	const JSize availabeWidth
	)
{
	JCoordinate lineWidth;
	JColorIndex color;
	GetColBorderInfo(&lineWidth, &color);
	JSize usedWidth = 
		2 * GetColWidth(kFitColIndex) + 2 * lineWidth;

	if (itsHasStartValues)
		{
		usedWidth += GetColWidth(kStartColIndex) + lineWidth;
		}

	if (availabeWidth > usedWidth)
		{
		SetColWidth(kNameColIndex, availabeWidth - usedWidth);
		}
}