void
GMFilterMBoxTable::GMFilterMBoxTableX()
{
	AppendCol(kCopyColWidth);
	AppendCol(kMBoxColWidth);
	AdjustColWidths();
	AdjustButtons();
}
void
THXVarTable::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXEditTable::ApertureResized(dw,dh);
	AdjustColWidths();
}
void
GMFilterNameTable::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXEditTable::ApertureResized(dw,dh);
	AdjustColWidths();
}
void
CBSymbolTable::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXTable::ApertureResized(dw,dh);
	AdjustColWidths();
}
void
JXTreeListWidget::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXStyleTable::ApertureResized(dw,dh);
	AdjustColWidths();
}
void
CBSymbolTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	const JIndex symbolIndex = CellToSymbolIndex(cell);

	CBLanguage lang;
	CBSymbolList::Type type;
	const JString& symbolName =
		itsSymbolList->GetSymbol(symbolIndex, &lang, &type);

	const JString* signature;
	itsSymbolList->GetSignature(symbolIndex, &signature);

	if (CalcColWidths(symbolName, signature))
		{
		AdjustColWidths();
		}

	const JXImage* icon     = NULL;
	const JFontStyle& style = (CBGetSymbolTypeList())->GetStyle(type, &icon);

	// draw icon

	if (icon != NULL)
		{
		JRect r = rect;
		r.right = r.left + kIconWidth;
		p.Image(*icon, icon->GetBounds(), r);
		}

	// draw name

	p.SetFontStyle(style);

	JRect r = rect;
	r.left += kIconWidth + kHMarginWidth;
	p.String(r, symbolName, JPainter::kHAlignLeft, JPainter::kVAlignCenter);

	if (signature != NULL)
		{
		r.left += (GetFontManager())->GetStringWidth(
			JGetDefaultFontName(), kJDefaultFontSize, JFontStyle(), symbolName);
		p.String(r, *signature, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
		}
}
void
THXVarTable::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	if (sender == this && message.Is(kColWidthChanged))
		{
		// do it regardless of which column changed so they can't shrink fn column
		AdjustColWidths();
		}

	JXEditTable::Receive(sender, message);
}
void
JXTreeListWidget::AdjustToTree()
{
	itsMinColWidths->RemoveAll();

	JPoint cell;
	const JSize rowCount = GetRowCount();
	const JSize colCount = GetColCount();
	for (JIndex j=1; j<=colCount; j++)
		{
		if (j == itsToggleOpenColIndex)
			{
			itsMinColWidths->AppendElement(kToggleColWidth);
			}
		else
			{
			cell.x         = j;
			JSize maxWidth = 0;
			for (JIndex i=1; i<=rowCount; i++)
				{
				cell.y            = i;
				const JSize width = GetMinCellWidth(cell);
				if (width > maxWidth)
					{
					maxWidth = width;
					}
				}

			if (maxWidth == 0)
				{
				maxWidth = kDefColWidth;
				}
			itsMinColWidths->AppendElement(maxWidth);
			}
		}

	AdjustColWidths();
}
void
GMFilterNameTable::GMFilterNameTableX()
{
	AppendCols(1, kDefColWidth);
	AdjustColWidths();

	const JFontManager* fm	= GetFontManager();
	itsRowHeight	=
		fm->GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize,
						JFontStyle()) + kRowHeightAdjust;

	const JSize count = itsFilters->GetElementCount();
	AppendRows(count, itsRowHeight);

	AdjustButtons();
	WantInput(kJFalse);

	ListenTo(itsNewButton);
	ListenTo(itsRemoveButton);

	const Atom dndName	= GetDNDManager()->GetDNDSelectionName();
	GetDisplay()->RegisterXAtom(kDragFilterXAtomName);
}
void
CBSymbolTable::RebuildTable()
{
	(JXGetApplication())->DisplayBusyCursor();

	const JPoint scrollPt = (GetAperture()).topLeft();

	ClearSelection();
	itsKeyBuffer.Clear();
	itsMaxStringWidth = 0;

	if (itsVisibleListLockedFlag)
		{
		const JSize count = itsVisibleList->GetElementCount();
		for (JIndex i=1; i<=count; i++)
			{
			const JIndex j = itsVisibleList->GetElement(i);

			const JString* signature;
			itsSymbolList->GetSignature(j, &signature);

			CBLanguage lang;
			CBSymbolList::Type type;
			CalcColWidths(itsSymbolList->GetSymbol(j, &lang, &type), signature);
			}
		}
	else if (itsNameFilter != NULL || itsNameLiteral != NULL)
		{
		itsVisibleList->RemoveAll();

		const JSize symbolCount = itsSymbolList->GetElementCount();
		for (JIndex i=1; i<=symbolCount; i++)
			{
			CBLanguage lang;
			CBSymbolList::Type type;
			const JString& symbolName = itsSymbolList->GetSymbol(i, &lang, &type);

			const JString* signature;
			itsSymbolList->GetSignature(i, &signature);

			if (/* (CBGetSymbolTypeList())->IsVisible(type) && */

				((itsNameFilter  != NULL && itsNameFilter->Match(symbolName)) ||
				 (itsNameLiteral != NULL && symbolName.Contains(*itsNameLiteral)))
				)
				{
				itsVisibleList->AppendElement(i);
				CalcColWidths(symbolName, signature);
				}
			}
		}
	else	// optimize because scanning 1e5 symbols takes a while!
		{
		const JSize symbolCount = itsSymbolList->GetElementCount();
		if (itsVisibleList->GetElementCount() > symbolCount)
			{
			itsVisibleList->RemoveNextElements(
				symbolCount+1, itsVisibleList->GetElementCount() - symbolCount);
			}
		while (itsVisibleList->GetElementCount() < symbolCount)
			{
			itsVisibleList->AppendElement(itsVisibleList->GetElementCount()+1);
			}
		}

	const JSize rowCount = itsVisibleList->GetElementCount();
	if (GetRowCount() < rowCount)
		{
		AppendRows(rowCount - GetRowCount());
		}
	else if (GetRowCount() > rowCount)
		{
		RemoveNextRows(rowCount+1, GetRowCount() - rowCount);
		}

	AdjustColWidths();
	ScrollTo(scrollPt);
	Refresh();
}