void
CBSearchTextDialog::UpdateBasePath()
{
	CBProjectDocument* doc;
	if ((CBGetDocumentManager())->GetActiveProjectDocument(&doc))
		{
		itsDirInput->SetBasePath(doc->GetFilePath());
		}
	else
		{
		itsDirInput->ClearBasePath();
		}
}
CBCommandTable::CBCommandTable
	(
	const CBCommandManager::CmdList& cmdList,

	JXTextButton*		addCmdButton,
	JXTextButton*		removeCmdButton,
	JXTextButton*		duplicateCmdButton,
	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)
{
	itsTextInput   = NULL;
	itsDNDRowIndex = 0;

	itsCommandXAtom =
		(GetDisplay())->RegisterXAtom(CBCommandSelection::GetCommandXAtomName());

	// font

	(CBGetPrefsManager())->GetDefaultFont(&itsFontName, &itsFontSize);

	const JSize rowHeight = 2*kVMarginWidth + JMax(
		(GetFontManager())->GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle()),
		(GetFontManager())->GetLineHeight(itsFontName, itsFontSize, JFontStyle()));
	SetDefaultRowHeight(rowHeight);

	// buttons

	itsAddCmdButton       = addCmdButton;
	itsRemoveCmdButton    = removeCmdButton;
	itsDuplicateCmdButton = duplicateCmdButton;

	ListenTo(itsAddCmdButton);
	ListenTo(itsRemoveCmdButton);
	ListenTo(itsDuplicateCmdButton);

	// type menu

	itsOptionsMenu = new JXTextMenu("", this, kFixedLeft, kFixedTop, 0,0, 10,10);
	assert( itsOptionsMenu != NULL );
	itsOptionsMenu->SetToHiddenPopupMenu();
	itsOptionsMenu->SetMenuItems(kOptionsMenuStr);
	itsOptionsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsOptionsMenu);

	// base path

	CBProjectDocument* doc = NULL;
	if ((CBGetDocumentManager())->GetActiveProjectDocument(&doc))
		{
		itsBasePath = doc->GetFilePath();
		}

	// data

	itsCmdList = new CBCommandManager::CmdList(cmdList);
	assert( itsCmdList != NULL );
	FinishCmdListCopy(itsCmdList);

	for (JIndex i=1; i<=kColCount; i++)
		{
		AppendCols(1, kInitColWidth[i-1]);
		}

	AppendRows(itsCmdList->GetElementCount());

	UpdateButtons();
	ListenTo(&(GetTableSelection()));
}