GMAccountList::GMAccountList
	(
	GMAccountDialog*		dialog,
	JPtrArray<GMAccount>*	accounts,
	JXScrollbarSet*			scrollbarSet,
	JXContainer*			enclosure,
	const HSizingOption		hSizing,
	const VSizingOption		vSizing,
	const JCoordinate		x,
	const JCoordinate		y,
	const JCoordinate		w,
	const JCoordinate		h
	)
	:
   JXEditTable(1, kDefColWidth, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h),
   itsInput(NULL),
   itsDialog(dialog),
   itsAccountInfo(accounts)
{
	itsMinColWidth = 1;

	JXColormap* colormap         = GetColormap();
	const JColorIndex blackColor = colormap->GetBlackColor();
	SetRowBorderInfo(0, blackColor);
	SetColBorderInfo(0, blackColor);

	const JSize fontHeight =
		(GetFontManager())->GetLineHeight(JGetDefaultFontName(),
		kJDefaultFontSize, JFontStyle());
	const JCoordinate rowHeight = fontHeight + 2*kVMarginWidth;
	SetDefaultRowHeight(rowHeight);
	SetAllRowHeights(rowHeight);

	itsLineHeight =
		GetFontManager()->GetLineHeight(JGetDefaultFontName(),
		kJDefaultFontSize, JFontStyle()) + 2 * kVMarginWidth;

	ListenTo(itsAccountInfo);
}
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();
}