void
CBEditTextPrefsDialog::UpdateSampleText()
{
	JString name;
	JSize size;
	itsFontMenu->GetFont(&name, &size);
	itsSampleText->SetFont(
		GetWindow()->GetFontManager()->GetFont(name, size,
			JFontStyle(itsColor [ CBPrefsManager::kTextColorIndex-1 ])));

	itsSampleText->SetBackColor(itsColor [ CBPrefsManager::kBackColorIndex-1 ] );
	itsSampleText->SetFocusColor(itsColor [ CBPrefsManager::kBackColorIndex-1 ] );

	itsSampleText->SetCaretColor(itsColor [ CBPrefsManager::kCaretColorIndex-1 ] );
	itsSampleText->SetSelectionColor(itsColor [ CBPrefsManager::kSelColorIndex-1 ] );
	itsSampleText->SetSelectionOutlineColor(itsColor [ CBPrefsManager::kSelLineColorIndex-1 ] );

	itsSampleText->ShowRightMargin(itsRightMarginCB->IsChecked(),
								   itsColor [ CBPrefsManager::kRightMarginColorIndex-1 ] );
}
CBSymbolTable::CBSymbolTable
	(
	CBSymbolDirector*	symbolDirector,
	CBSymbolList*		symbolList,
	JXScrollbarSet*		scrollbarSet,
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXTable(10, 10, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h)
{
	itsSymbolDirector = symbolDirector;
	itsSymbolList     = symbolList;
	itsMaxStringWidth = 0;

	itsVisibleList = new JArray<JIndex>(CBSymbolList::kBlockSize);
	assert( itsVisibleList != NULL );

	itsVisibleListLockedFlag = kJFalse;
	itsNameFilter            = NULL;
	itsNameLiteral           = NULL;

	const JIndex blackColor = (GetColormap())->GetBlackColor();
	SetRowBorderInfo(0, blackColor);
	SetColBorderInfo(0, blackColor);

	AppendCols(1);
	SetDefaultRowHeight((GetFontManager())->
							GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle()) +
						2*kVMarginWidth);

	SetSelectionBehavior(kJTrue, kJTrue);

	ListenTo(itsSymbolList);
	ListenTo(CBGetSymbolTypeList());
}
Ejemplo n.º 3
0
CBHTMLStyler::CBHTMLStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBHTMLStyleID, kCBPHPFT),
	CBHTMLScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap = GetColormap();

	SetTypeStyle(kHTMLTag            - kWhitespace, JFontStyle(colormap->GetBlueColor()));
	SetTypeStyle(kHTMLScript         - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kHTMLNamedCharacter - kWhitespace, JFontStyle(kJFalse, kJFalse, 1, kJFalse));
	SetTypeStyle(kHTMLComment        - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kError              - kWhitespace, JFontStyle(colormap->GetRedColor()));

	InitMustacheTypeStyles();
	InitPHPTypeStyles();
	InitJSPTypeStyles();
	InitJavaScriptTypeStyles();

	const JColorIndex red = colormap->GetRedColor();
	for (JIndex i=0; i<kUnusedJavaKeywordCount; i++)
		{
		SetWordStyle(kUnusedJavaKeyword[i], JFontStyle(red));
		}
	for (JIndex i=0; i<kUnusedJSKeywordCount; i++)
		{
		SetWordStyle(kUnusedJSKeyword[i], JFontStyle(red));
		}

	JPrefObject::ReadPrefs();

	JFontStyle style;
	if (GetWordStyle("?php", &style))
		{
		RemoveWordStyle("?php");
		}
}
void
CMSourceDirector::UpdateFileType()
{
	const CBTextFileType fileType =
		itsType == kMainAsmType || itsType == kAsmType ? kCBAssemblyFT :
		itsCurrentFile.IsEmpty() ? kCBUnknownFT :
			(CMGetPrefsManager())->GetFileType(itsCurrentFile);

	itsText->SetFileType(fileType);

	if (!itsCurrentFile.IsEmpty() && (CMGetFnMenuUpdater())->CanCreateMenu(fileType))
		{
		itsMenuBar->InsertMenuAfter(itsDebugMenu, itsFnMenu);
		itsFnMenu->TextChanged(fileType, itsCurrentFile);
		}
	else
		{
		itsMenuBar->RemoveMenu(itsFnMenu);
		}

	if (!itsCurrentFile.IsEmpty())
		{
		JBoolean setTabWidth, setTabMode, tabInsertsSpaces, setAutoIndent, autoIndent;
		JSize tabWidth;
		CBMParseEditorOptions(itsText->GetText(), &setTabWidth, &tabWidth,
							  &setTabMode, &tabInsertsSpaces, &setAutoIndent, &autoIndent);
		if (setTabWidth)
			{
			itsText->SetCRMTabCharCount(tabWidth);
			itsText->SetDefaultTabWidth(
				tabWidth *
				(itsText->GetFontManager())->
					GetCharWidth(itsText->GetDefaultFontName(),
								 itsText->GetDefaultFontSize(),
								 JFontStyle(), ' '));
			}
		}
}
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);
}
JXInputField*
JXFSBindingTable::CreateXInputField
	(
	const JPoint&		cell,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
{
	assert( itsTextInput == NULL );

	JTableSelection& s = GetTableSelection();
	s.ClearSelection();
	s.SelectCell(cell);

	itsTextInput = new JXInputField(this, kFixedLeft, kFixedTop, x,y, w,h);
	assert( itsTextInput != NULL );

	const JFSBinding* b = itsBindingList->GetBinding(cell.y);
	if (cell.x == kPatternColumn)
		{
		itsTextInput->SetText(b->GetPattern());
		}
	else if (cell.x == kCommandColumn)
		{
		JFSBinding::CommandType type;
		JBoolean singleFile;
		const JString& cmd = b->GetCommand(&type, &singleFile);
		itsTextInput->SetText(cmd);
		}

	itsTextInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());
	itsTextInput->SetIsRequired();
	ListenTo(itsTextInput);
	return itsTextInput;
}
void
JXRowHeaderWidget::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JXDrawUpFrame(p, rect, kCellFrameWidth);

	JString str;
	JBoolean hasTitle = kJFalse;
	if (itsTitles != NULL)
		{
		const JString* title = itsTitles->NthElement(cell.y);
		if (title != NULL)
			{
			str      = *title;
			hasTitle = kJTrue;
			}
		}
	if (!hasTitle)
		{
		str = JString(cell.y, JString::kBase10);
		}

	p.SetFont(JGetDefaultFontName(), kJDefaultRowColHeaderFontSize,
			  JFontStyle(kJTrue, kJFalse, 0, kJFalse, (p.GetColormap())->GetBlackColor()));
	p.String(rect, str, JPainter::kHAlignCenter, JPainter::kVAlignCenter);

	const JCoordinate wmin = p.GetStringWidth(str) + 2*itsHMarginWidth;
	if (rect.width() < wmin && itsMaxBcastWidth < wmin)
		{
		Broadcast(NeedsToBeWidened(wmin - itsMaxBcastWidth));
		itsMaxBcastWidth = wmin;
		}
}
Ejemplo n.º 8
0
void
TestWidget::DrawStuff
	(
	JPainter& p
	)
{
JIndex i;

	JXColormap* colormap = GetColormap();

	p.SetPenColor(colormap->GetGreenColor());
	JRect ellipseRect(100,50,150,300);
	p.Ellipse(ellipseRect);

	p.SetPenColor(colormap->GetBlackColor());

	if (itsFillFlag)
		{
		p.SetFilling(kJTrue);
		}

	JRect ap = GetAperture();
	p.Line(ap.topLeft(), ap.bottomRight());
	p.Line(ap.topRight(), ap.bottomLeft());

	p.SetLineWidth(2);
	p.SetFontName("Times");
	p.SetFontSize(18);

	p.Image(*itsHomeImage, itsHomeImage->GetBounds(), itsHomeRect);

	its2Rect = JRect(150, 5, 200, 30);
	p.SetPenColor(colormap->GetRedColor());
	p.Rect(its2Rect);
	p.SetFontStyle(colormap->GetRedColor());
	p.String(its2Rect.topLeft(), "2",
			 its2Rect.width(),  JPainter::kHAlignCenter,
			 its2Rect.height(), JPainter::kVAlignCenter);

	its3Rect = JRect(10, 150, 40, 200);
	p.SetPenColor(colormap->GetBlueColor());
	p.Rect(its3Rect);
	p.SetFontStyle(colormap->GetBlueColor());
	p.String(its3Rect.topLeft(), "3",
			 its3Rect.width(),  JPainter::kHAlignCenter,
			 its3Rect.height(), JPainter::kVAlignCenter);

	p.SetLineWidth(1);
	p.SetFont(GetFontManager()->GetDefaultFont());

	p.ShiftOrigin(10,10);

	p.Point(0,0);
	for (i=1; i<=itsRandPointCount; i++)
		{
		p.Point(itsRNG.UniformLong(0,200), itsRNG.UniformLong(0,200));
		}

	p.SetPenColor(colormap->GetRedColor());
	p.Line(10,0, 0,10);
	p.SetPenColor(colormap->GetGreenColor());
	p.LineTo(10,20);
	p.SetPenColor(colormap->GetBlueColor());
	p.LineTo(0,30);

	p.ShiftOrigin(2,0);

	JPoint textPt(40,30);
	p.String(  0.0, textPt, "Hello");
	p.String( 90.0, textPt, "Hello");
	p.String(180.0, textPt, "Hello");
	p.String(270.0, textPt, "Hello");

	p.ShiftOrigin(-2, 0);

	p.SetPenColor(colormap->GetBlueColor());
	JRect r(70, 290, 150, 390);
	p.Rect(r);
/*
	for (JCoordinate y=70; y<150; y++)
		{
		p.SetPenColor(colormap->GetGrayColor(y-50));
		p.Line(290,y, 390,y);
		}

	for (JCoordinate x=290; x<390; x++)
		{
		p.SetPenColor(colormap->GetGrayColor(x-290));
		p.Line(x,70, x,150);
		}

	p.SetLineWidth(2);
	for (JCoordinate y=70; y<150; y+=2)
		{
		p.SetPenColor(colormap->GetGrayColor(y%4 ? 40 : 60));
		p.Line(290,y, 390,y);
		}
	p.SetLineWidth(1);

	p.SetLineWidth(2);
	for (JCoordinate x=290; x<390; x+=2)
		{
		p.SetPenColor(colormap->GetGrayColor(x%4 ? 40 : 60));
		p.Line(x,70, x,150);
		}
	p.SetLineWidth(1);
*/
	p.String(  0.0, r, "Hello", JPainter::kHAlignCenter, JPainter::kVAlignCenter);
	p.String( 90.0, r, "Hello", JPainter::kHAlignCenter, JPainter::kVAlignCenter);
	p.String(180.0, r, "Hello", JPainter::kHAlignCenter, JPainter::kVAlignCenter);
	p.String(270.0, r, "Hello", JPainter::kHAlignCenter, JPainter::kVAlignCenter);

	p.String(  0.0, r, "Hello", JPainter::kHAlignRight, JPainter::kVAlignBottom);
	p.String( 90.0, r, "Hello", JPainter::kHAlignRight, JPainter::kVAlignBottom);
	p.String(180.0, r, "Hello", JPainter::kHAlignRight, JPainter::kVAlignBottom);
	p.String(270.0, r, "Hello", JPainter::kHAlignRight, JPainter::kVAlignBottom);

	p.SetPenColor(colormap->GetBlueColor());
	p.Rect(200, 10, 100, 50);
	p.String(200, 10, "Hello", 100, JPainter::kHAlignLeft);
	p.String(200, 10+p.GetLineHeight(), "Hello", 100, JPainter::kHAlignCenter);
	p.String(200, 10+2*p.GetLineHeight(), "Hello", 100, JPainter::kHAlignRight);

	p.SetPenColor(colormap->GetDarkGreenColor());
	p.SetFilling(kJTrue);
	p.Rect(290, 160, 100, 80);
	p.SetFilling(kJFalse);
/*
	for (JCoordinate y=160; y<240; y++)
		{
		p.SetPenColor(colormap->GetGrayColor(y-140));
		p.Line(290,y, 390,y);
		}

	for (JCoordinate x=290; x<390; x++)
		{
		p.SetPenColor(colormap->GetGrayColor(x-290));
		p.Line(x,160, x,240);
		}

	p.SetLineWidth(2);
	for (JCoordinate y=160; y<240; y+=2)
		{
		p.SetPenColor(colormap->GetGrayColor(y%4 ? 40 : 60));
		p.Line(290,y, 390,y);
		}
	p.SetLineWidth(1);

	p.SetLineWidth(2);
	for (JCoordinate x=290; x<390; x+=2)
		{
		p.SetPenColor(colormap->GetGrayColor(x%4 ? 40 : 60));
		p.Line(x,160, x,240);
		}
	p.SetLineWidth(1);
*/
	textPt.Set(340, 200);
	p.SetFontName("Times");
	p.SetFontStyle(colormap->GetBlueColor());
	p.String(  0.0, textPt, "Hello");
	p.String( 90.0, textPt, "Hello");
	p.SetFontStyle(colormap->GetYellowColor());
	p.String(180.0, textPt, "Hello");
	p.String(270.0, textPt, "Hello");

	p.SetPenColor(colormap->GetYellowColor());
	r.Set(0,11,80,91);
	p.Rect(r);
	r.Shrink(1,1);
	p.SetPenColor(colormap->GetBlueColor());
	p.Ellipse(r);
	r.Shrink(1,1);
	p.SetPenColor(colormap->GetRedColor());
	p.Arc(r, 270.0-45.0, -270.0);

	JPolygon poly;
	poly.AppendElement(JPoint(0,85));
	poly.AppendElement(JPoint(10,85));
	poly.AppendElement(JPoint(5,95));
	p.Polygon(poly);

	p.Line(0,100, 2,98);
	p.LineTo(4,100);
	p.LineTo(2,102);
	p.LineTo(0,100);

	poly.SetElement(1, JPoint(0,5));
	poly.SetElement(2, JPoint(2,0));
	poly.SetElement(3, JPoint(4,5));
	p.Polygon(2,105, poly);

	// test filling rule

	p.SetPenColor(colormap->GetRedColor());
	p.SetFilling(kJTrue);

	JPolygon fillRulePoly;
	fillRulePoly.AppendElement(JPoint(175,45));
	fillRulePoly.AppendElement(JPoint(165,65));
	fillRulePoly.AppendElement(JPoint(190,50));
	fillRulePoly.AppendElement(JPoint(160,50));
	fillRulePoly.AppendElement(JPoint(185,65));
	p.Polygon(fillRulePoly);

	p.SetFilling(kJFalse);

	// dashed lines

	p.DrawDashedLines(kJTrue);

	p.SetPenColor(colormap->GetBlackColor());

	JArray<JSize> dashList;			// pixel rulers
	dashList.AppendElement(1);
	dashList.AppendElement(1);
	p.SetDashList(dashList);
	p.Line(100,110, 200,110);
	p.Line(100,114, 200,114);
	p.Line(100,118, 200,118);

	dashList.SetElement(1, 2);		// simple pattern
	dashList.SetElement(2, 3);
	p.SetDashList(dashList);
	p.Line(100,112, 200,112);

	p.SetFontStyle(JFontStyle(kJFalse, kJFalse, 1, kJFalse));
	p.String(130,155, "underline without dashes");

	p.SetDashList(dashList, 3);		// test offset
	p.Line(100,116, 200,116);

	dashList.SetElement(1, 1);		// example with odd # of values from X manuals
	dashList.SetElement(2, 2);
	dashList.AppendElement(3);
	p.SetDashList(dashList);
	p.Line(100,120, 200,120);

	dashList.SetElement(1, 5);		// dash-dot pattern
	dashList.SetElement(2, 2);
	dashList.SetElement(3, 1);
	dashList.AppendElement(2);
	p.SetDashList(dashList);
	p.Line(100,122, 200,122);

	p.Ellipse(210,110, 20,20);
	p.DrawDashedLines(kJFalse);
	p.Ellipse(213,113, 14,14);
	p.Rect(207,107, 26,26);
	p.SetPenColor(colormap->GetYellowColor());
	p.DrawDashedLines(kJTrue);
	p.Ellipse(213,113, 14,14);

	// icons

	p.Image(*itsXPMImage, itsXPMImage->GetBounds(), 33,110);
	p.Image(*itsPartialXPMImage, itsXPMImage->GetBounds(), 50,121);
}
Ejemplo n.º 9
0
TestWidget::TestWidget
	(
	const JBoolean		isMaster,
	const JBoolean		isImage,
	JXMenuBar*			menuBar,
	JXScrollbarSet*		scrollbarSet,
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXScrollableWidget(scrollbarSet, enclosure, hSizing, vSizing, x,y, w,h),
	itsRNG()
{
JIndex i;

	itsFillFlag       = kJFalse;
	itsRandPointCount = 10;
	itsResizeDialog   = NULL;

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

	// cursors

	JXDisplay* display = GetDisplay();
	itsTrekCursor      = display->CreateBuiltInCursor("XC_trek",     XC_trek);
	itsGumbyCursor     = display->CreateBuiltInCursor("XC_gumby",    XC_gumby);
	itsBogosityCursor  = display->CreateBuiltInCursor("XC_bogosity", XC_bogosity);
	itsFleurCursor     = display->CreateBuiltInCursor("XC_fleur",    XC_fleur);
	SetDefaultCursor(itsTrekCursor);

	// menus

	itsActionsMenu = menuBar->AppendTextMenu(kActionsMenuTitleStr);
	itsActionsMenu->SetTitleFontStyle(GetColormap()->GetWhiteColor());
	itsActionsMenu->SetShortcuts(kActionsMenuShortcutStr);
	itsActionsMenu->SetMenuItems(kActionsMenuStr);
	itsActionsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsActionsMenu);

	itsPointMenu = jnew JXTextMenu(itsActionsMenu, kPointMenuCmd, menuBar);
	assert( itsPointMenu != NULL );
	itsPointMenu->SetMenuItems(kPointMenuStr);
	itsPointMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPointMenu);

	// This tests the JX response to an empty menu.
	JXTextMenu* emptyMenu = jnew JXTextMenu(itsActionsMenu, kEmptyMenuCmd, menuBar);
	assert( emptyMenu != NULL );

	JXMenu* prevMenu     = itsActionsMenu;
	JIndex prevMenuIndex = kAdviceMenuCmd;
	for (i=1; i<=kAdviceMenuCount; i++)
		{
		JXTextMenu* adviceMenu = jnew JXTextMenu(prevMenu, prevMenuIndex, menuBar);
		assert( adviceMenu != NULL );
		adviceMenu->SetMenuItems(kAdviceMenuStr[i-1]);
		adviceMenu->SetUpdateAction(JXMenu::kDisableNone);

		if (i == kAdviceBoldMenuIndex)
			{
			adviceMenu->SetItemFontStyle(2,
				JFontStyle(kJTrue, kJFalse, 0, kJFalse, GetColormap()->GetBlackColor()));
			}

		prevMenu      = adviceMenu;
		prevMenuIndex = 2;
		}

	BuildXlsfontsMenu(itsActionsMenu, menuBar);

	// secret menus are a bad idea because the user can't find them!

	itsSecretMenu = jnew JXTextMenu("", this, kFixedLeft, kFixedTop, 0,0, 10,10);
	assert( itsSecretMenu != NULL );
	itsSecretMenu->SetMenuItems(kSecretMenuStr);
	itsSecretMenu->SetUpdateAction(JXMenu::kDisableNone);
	itsSecretMenu->SetToHiddenPopupMenu(kJTrue);		// will assert() otherwise
	itsSecretMenu->Hide();
	ListenTo(itsSecretMenu);

	itsSecretSubmenu = jnew JXTextMenu(itsSecretMenu, kSecretSubmenuIndex, this);
	assert( itsSecretSubmenu != NULL );
	itsSecretSubmenu->SetMenuItems(kSecretSubmenuStr);
	itsSecretSubmenu->SetUpdateAction(JXMenu::kDisableNone);
	// we don't ListenTo() it because it's only there for show

	// image from xpm

	itsXPMImage = jnew JXImage(GetDisplay(), JXPM(macapp_xpm));
	assert( itsXPMImage != NULL );

	// partial image from image

	itsPartialXPMImage = jnew JXImage(*itsXPMImage, JRect(5,5,14,16));
	assert( itsPartialXPMImage != NULL );

	// home symbol

	itsHomeImage = jnew JXImage(GetDisplay(), JXPM(home_xpm));
	assert( itsHomeImage != NULL );

	itsHomeRect = itsHomeImage->GetBounds();
	itsHomeRect.Shift(120, 10);

	// buffer contents of Widget in JXImage

	itsImageBuffer = NULL;
	if (isImage)
		{
		CreateImageBuffer();
		}

	// initial size

	SetBounds(400,400);

	// enclosed objects

	itsAnimButton = 
		jnew JXTextButton("Start", this, JXWidget::kFixedLeft, JXWidget::kFixedTop,
						 37,175, 50,30);
	assert( itsAnimButton != NULL );
	itsAnimButton->SetShortcuts("#A");
	ListenTo(itsAnimButton);

	if (isMaster)
		{
		itsQuitButton = 
			jnew JXTextButton(JGetString("Quit::TestWidget"), this, JXWidget::kFixedRight, JXWidget::kFixedBottom,
							 x,y, 50,30);
		assert( itsQuitButton != NULL );

		JXColormap* colormap = GetColormap();
		itsQuitButton->CenterWithinEnclosure(kJTrue, kJTrue);
		itsQuitButton->SetFontStyle(JFontStyle(kJTrue, kJFalse, 0, kJFalse, colormap->GetRedColor()));
		itsQuitButton->SetNormalColor(colormap->GetCyanColor());
		itsQuitButton->SetPushedColor(colormap->GetBlueColor());

		ListenTo(itsQuitButton);
		}
	else
		{
		itsQuitButton = NULL;
		}

	ExpandToFitContent();

	// drops on iconfied window

	JXWindowIcon* windowIcon;
	const JBoolean hasIconWindow = GetWindow()->GetIconWidget(&windowIcon);
	assert( hasIconWindow );
	ListenTo(windowIcon);
}
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()));
}
Ejemplo n.º 11
0
void
TestWidget::DrawStuff
(
    JPainter& p
)
{
    JIndex i;

    JXColormap* colormap = GetColormap();

    p.SetPenColor(colormap->GetGreenColor());
    JRect ellipseRect(100,50,150,300);
    p.Ellipse(ellipseRect);

    p.SetPenColor(colormap->GetBlackColor());

    if (itsFillFlag)
    {
        p.SetFilling(kJTrue);
    }

    JRect ap = GetAperture();
    p.Line(ap.topLeft(), ap.bottomRight());
    p.Line(ap.topRight(), ap.bottomLeft());

    p.SetLineWidth(2);
    p.SetFontName(JXGetTimesFontName());
    p.SetFontSize(18);

    p.Image(*itsHomeImage, itsHomeImage->GetBounds(), itsHomeRect);

    its2Rect = JRect(150, 5, 200, 30);
    p.SetPenColor(colormap->GetRedColor());
    p.Rect(its2Rect);
    p.SetFontStyle(colormap->GetRedColor());
    p.String(its2Rect.topLeft(), "2",
             its2Rect.width(),  JPainter::kHAlignCenter,
             its2Rect.height(), JPainter::kVAlignCenter);

    its3Rect = JRect(10, 150, 40, 200);
    p.SetPenColor(colormap->GetBlueColor());
    p.Rect(its3Rect);
    p.SetFontStyle(colormap->GetBlueColor());
    p.String(its3Rect.topLeft(), "3",
             its3Rect.width(),  JPainter::kHAlignCenter,
             its3Rect.height(), JPainter::kVAlignCenter);

    p.SetLineWidth(1);
    p.SetFont(JGetDefaultFontName(), kJXDefaultFontSize, colormap->GetBlackColor());

    p.ShiftOrigin(10,10);

    p.Point(0,0);
    for (i=1; i<=itsRandPointCount; i++)
    {
        p.Point(itsRNG.UniformLong(0,200), itsRNG.UniformLong(0,200));
    }

    p.SetPenColor(colormap->GetRedColor());
    p.Line(10,0, 0,10);
    p.SetPenColor(colormap->GetGreenColor());
    p.LineTo(10,20);
    p.SetPenColor(colormap->GetBlueColor());
    p.LineTo(0,30);

    p.ShiftOrigin(2,0);

    JPoint textPt(40,30);
    p.String(  0.0, textPt, "Hello");
    p.String( 90.0, textPt, "Hello");
    p.String(180.0, textPt, "Hello");
    p.String(270.0, textPt, "Hello");

    p.Rect(310, 70, 80, 80);
    p.String(  0.0, 310, 70, "Hello", 80, JPainter::kHAlignCenter,
               80, JPainter::kVAlignCenter);
    p.String( 90.0, 310,150, "Hello", 80, JPainter::kHAlignCenter,
              80, JPainter::kVAlignCenter);
    p.String(180.0, 390,150, "Hello", 80, JPainter::kHAlignCenter,
             80, JPainter::kVAlignCenter);
    p.String(270.0, 390, 70, "Hello", 80, JPainter::kHAlignCenter,
             80, JPainter::kVAlignCenter);

    p.Rect(200, 10, 100, 50);
    p.String(200, 10, "Hello", 100, JPainter::kHAlignLeft);
    p.String(200, 10+p.GetLineHeight(), "Hello", 100, JPainter::kHAlignCenter);
    p.String(200, 10+2*p.GetLineHeight(), "Hello", 100, JPainter::kHAlignRight);

    p.SetPenColor(colormap->GetYellowColor());
    JRect r(0,11,80,91);
    p.Rect(r);
    r.Shrink(1,1);
    p.SetPenColor(colormap->GetBlueColor());
    p.Ellipse(r);
    r.Shrink(1,1);
    p.SetPenColor(colormap->GetRedColor());
    p.Arc(r, 270.0-45.0, -270.0);

    JPolygon poly;
    poly.AppendElement(JPoint(0,85));
    poly.AppendElement(JPoint(10,85));
    poly.AppendElement(JPoint(5,95));
    p.Polygon(poly);

    p.Line(0,100, 2,98);
    p.LineTo(4,100);
    p.LineTo(2,102);
    p.LineTo(0,100);

    poly.SetElement(1, JPoint(0,5));
    poly.SetElement(2, JPoint(2,0));
    poly.SetElement(3, JPoint(4,5));
    p.Polygon(2,105, poly);

    // test filling rule

    p.SetPenColor(colormap->GetRedColor());
    p.SetFilling(kJTrue);

    JPolygon fillRulePoly;
    fillRulePoly.AppendElement(JPoint(175,45));
    fillRulePoly.AppendElement(JPoint(165,65));
    fillRulePoly.AppendElement(JPoint(190,50));
    fillRulePoly.AppendElement(JPoint(160,50));
    fillRulePoly.AppendElement(JPoint(185,65));
    p.Polygon(fillRulePoly);

    p.SetFilling(kJFalse);

    // dashed lines

    p.DrawDashedLines(kJTrue);

    p.SetPenColor(colormap->GetBlackColor());

    JArray<JSize> dashList;			// pixel rulers
    dashList.AppendElement(1);
    dashList.AppendElement(1);
    p.SetDashList(dashList);
    p.Line(100,110, 200,110);
    p.Line(100,114, 200,114);
    p.Line(100,118, 200,118);

    dashList.SetElement(1, 2);		// simple pattern
    dashList.SetElement(2, 3);
    p.SetDashList(dashList);
    p.Line(100,112, 200,112);

    p.SetFontStyle(JFontStyle(kJFalse, kJFalse, 1, kJFalse));
    p.String(130,155, "underline without dashes");

    p.SetDashList(dashList, 3);		// test offset
    p.Line(100,116, 200,116);

    dashList.SetElement(1, 1);		// example with odd # of values from X manuals
    dashList.SetElement(2, 2);
    dashList.AppendElement(3);
    p.SetDashList(dashList);
    p.Line(100,120, 200,120);

    dashList.SetElement(1, 5);		// dash-dot pattern
    dashList.SetElement(2, 2);
    dashList.SetElement(3, 1);
    dashList.AppendElement(2);
    p.SetDashList(dashList);
    p.Line(100,122, 200,122);

    p.Ellipse(210,110, 20,20);
    p.DrawDashedLines(kJFalse);
    p.Ellipse(213,113, 14,14);
    p.Rect(207,107, 26,26);
    p.SetPenColor(colormap->GetYellowColor());
    p.DrawDashedLines(kJTrue);
    p.Ellipse(213,113, 14,14);

    // animated colors

    p.SetFilling(kJTrue);

    JCoordinate x = 25;
    const JSize animColorCount = itsAnimColorList->GetElementCount();
    for (i=1; i<=animColorCount; i++)
    {
        p.SetPenColor(itsAnimColorList->GetElement(i));
        p.Rect(x, 150, 10, 10);
        x += 10;
    }

    // icons

    p.Image(*itsXPMImage, itsXPMImage->GetBounds(), 33,110);
    p.Image(*itsPartialXPMImage, itsXPMImage->GetBounds(), 50,121);

    // *NEVER* do this in your code!  I do it here ONLY to test JXColormap.
    // (Besides, look at how messy it is!)

    unsigned long xPixel;
    if (colormap->CalcPreallocatedXPixel(62720, 56832, 45824, &xPixel))
    {
        JXDisplay* display = GetDisplay();
        Display* xdisplay  = display->GetXDisplay();
        GC gc = DefaultGC(xdisplay, display->GetScreen());
        XSetForeground(xdisplay, gc, xPixel);
        XFillRectangle(xdisplay, (GetWindow())->GetXWindow(), gc, 110,40, 20,20);
    }
}
Ejemplo n.º 12
0
void
CBRunCommandDialog::BuildWindow()
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 470,260, "");
	assert( window != NULL );

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 210,235, 60,20);
	assert( cancelButton != NULL );

	itsRunButton =
		new JXTextButton(JGetString("itsRunButton::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 389,234, 62,22);
	assert( itsRunButton != NULL );
	itsRunButton->SetShortcuts(JGetString("itsRunButton::CBRunCommandDialog::shortcuts::JXLayout"));

	itsHelpButton =
		new JXTextButton(JGetString("itsHelpButton::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 300,235, 60,20);
	assert( itsHelpButton != NULL );
	itsHelpButton->SetShortcuts(JGetString("itsHelpButton::CBRunCommandDialog::shortcuts::JXLayout"));

	itsPathInput =
		new CBCommandPathInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 320,20);
	assert( itsPathInput != NULL );

	itsSaveAllCB =
		new JXTextCheckbox(JGetString("itsSaveAllCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,180, 220,20);
	assert( itsSaveAllCB != NULL );
	itsSaveAllCB->SetShortcuts(JGetString("itsSaveAllCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsOneAtATimeCB =
		new JXTextCheckbox(JGetString("itsOneAtATimeCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,200, 220,20);
	assert( itsOneAtATimeCB != NULL );
	itsOneAtATimeCB->SetShortcuts(JGetString("itsOneAtATimeCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsUseWindowCB =
		new JXTextCheckbox(JGetString("itsUseWindowCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,130, 220,20);
	assert( itsUseWindowCB != NULL );
	itsUseWindowCB->SetShortcuts(JGetString("itsUseWindowCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsIsMakeCB =
		new JXTextCheckbox(JGetString("itsIsMakeCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,130, 220,20);
	assert( itsIsMakeCB != NULL );
	itsIsMakeCB->SetShortcuts(JGetString("itsIsMakeCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,90, 370,20);
	assert( itsCmdInput != NULL );

	JXStaticText* obj1_JXLayout =
		new JXStaticText(JGetString("obj1_JXLayout::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,70, 130,20);
	assert( obj1_JXLayout != NULL );
	obj1_JXLayout->SetToLabel();

	JXStaticText* obj2_JXLayout =
		new JXStaticText(JGetString("obj2_JXLayout::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 200,20);
	assert( obj2_JXLayout != NULL );
	obj2_JXLayout->SetToLabel();

	itsPathHistoryMenu =
		new JXPathHistoryMenu(kHistoryLength, "", window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 340,40, 30,20);
	assert( itsPathHistoryMenu != NULL );

	itsChoosePathButton =
		new JXTextButton(JGetString("itsChoosePathButton::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 390,40, 60,20);
	assert( itsChoosePathButton != NULL );

	itsChooseCmdButton =
		new JXTextButton(JGetString("itsChooseCmdButton::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 390,90, 60,20);
	assert( itsChooseCmdButton != NULL );

	itsRaiseCB =
		new JXTextCheckbox(JGetString("itsRaiseCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,150, 220,20);
	assert( itsRaiseCB != NULL );
	itsRaiseCB->SetShortcuts(JGetString("itsRaiseCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsBeepCB =
		new JXTextCheckbox(JGetString("itsBeepCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 240,170, 220,20);
	assert( itsBeepCB != NULL );
	itsBeepCB->SetShortcuts(JGetString("itsBeepCB::CBRunCommandDialog::shortcuts::JXLayout"));

	itsSaveCmdMenu =
		new JXTextMenu(JGetString("itsSaveCmdMenu::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,235, 90,20);
	assert( itsSaveCmdMenu != NULL );

	itsIsCVSCB =
		new JXTextCheckbox(JGetString("itsIsCVSCB::CBRunCommandDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,150, 220,20);
	assert( itsIsCVSCB != NULL );
	itsIsCVSCB->SetShortcuts(JGetString("itsIsCVSCB::CBRunCommandDialog::shortcuts::JXLayout"));

// end JXLayout

	window->SetTitle(JGetString(kWindowTitleID));
	SetButtons(itsRunButton, cancelButton);
	UseModalPlacement(kJFalse);
	window->PlaceAsDialogWindow();
	window->LockCurrentMinSize();

	ListenTo(itsHelpButton);
	ListenTo(itsChoosePathButton);
	ListenTo(itsChooseCmdButton);
	ListenTo(itsPathHistoryMenu);
	ListenTo(itsIsMakeCB);
	ListenTo(itsIsCVSCB);
	ListenTo(itsUseWindowCB);

	itsPathInput->SetText("." ACE_DIRECTORY_SEPARATOR_STR);
	itsPathInput->ShouldAllowInvalidPath();
	itsPathInput->ShouldBroadcastAllTextChanged(kJTrue);
	ListenTo(itsPathInput);

	if (itsProjDoc != NULL)
		{
		itsPathInput->SetBasePath(itsProjDoc->GetFilePath());
		}

	itsCmdInput->ShouldBroadcastAllTextChanged(kJTrue);
	itsCmdInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord);
	ListenTo(itsCmdInput);

	itsCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsSaveCmdMenu->SetMenuItems(kSaveCmdMenuStr, "CBRunCommandDialog");
	ListenTo(itsSaveCmdMenu);

	// create hidden JXDocument so Meta-# shortcuts work

	JXDocumentMenu* fileListMenu =
		new JXDocumentMenu("", window,
						   JXWidget::kFixedLeft, JXWidget::kFixedTop, 0,-20, 10,10);
	assert( fileListMenu != NULL );

	UpdateDisplay();
}
Ejemplo n.º 13
0
void
CBHTMLStyler::UpgradeTypeList
	(
	const JFileVersion	vers,
	JArray<JFontStyle>*	typeStyles
	)
{
	JColormap* cmap = GetColormap();

	if (vers < 1)
		{
		typeStyles->InsertElementAtIndex(2, JFontStyle(cmap->GetDarkRedColor()));
		}

	if (vers < 2)
		{
		typeStyles->InsertElementAtIndex(1, JFontStyle());

		for (JIndex i=1; i<=16; i++)
			{
			typeStyles->InsertElementAtIndex(6, JFontStyle());
			}
		}

	if (vers < 3)
		{
		typeStyles->InsertElementAtIndex(22, JFontStyle());
		typeStyles->InsertElementAtIndex(22, JFontStyle());

		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		typeStyles->InsertElementAtIndex(17, JFontStyle());
		}

	if (vers < 4)
		{
		typeStyles->InsertElementAtIndex(22, JFontStyle(cmap->GetDarkGreenColor()));
		}

	if (vers < 5)
		{
		for (JIndex i=1; i<=9; i++)
			{
			typeStyles->InsertElementAtIndex(17, JFontStyle());
			}
		}

	if (vers < 6)
		{
		typeStyles->InsertElementAtIndex(6, JFontStyle());
		}

	if (vers < 7)
		{
		typeStyles->InsertElementAtIndex(6, JFontStyle());
		}

	// set new values after all new slots have been created

	if (vers < 2)
		{
		InitPHPTypeStyles();
		}

	if (vers < 3)
		{
		InitJavaScriptTypeStyles();
		}

	if (vers < 5)
		{
		InitJSPTypeStyles();
		}

	if (vers < 6)
		{
		InitMustacheTypeStyles();
		}
}
JXFSBindingTable::JXFSBindingTable
	(
	JFSBindingList*		list,
	JXTextButton*		addButton,
	JXTextButton*		removeButton,
	JXTextButton*		duplicateButton,
	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),
	itsBindingList(list),
	itsAddButton(addButton),
	itsRemoveButton(removeButton),
	itsDuplicateButton(duplicateButton),
	itsTextInput(NULL)
{
	// row height

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

	// buttons

	ListenTo(itsAddButton);
	ListenTo(itsRemoveButton);
	ListenTo(itsDuplicateButton);

	// type menu

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

	// regex for testing

	itsTestRegex = new JRegex;
	assert( itsTestRegex != NULL );

	// data

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

	const JSize rowCount = itsBindingList->GetElementCount();
	AppendRows(rowCount);

	UpdateButtons();
	ListenTo(&(GetTableSelection()));
}
void
JXTipOfTheDayDialog::BuildWindow
	(
	const JBoolean showStartupCB,
	const JBoolean showAtStartup
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 410,260, "");
	assert( window != NULL );

	JXFlatRect* sideBar =
		new JXFlatRect(window,
					JXWidget::kFixedLeft, JXWidget::kVElastic, 10,10, 50,200);
	assert( sideBar != NULL );
    sideBar->SetColor((GetColormap())->GetInactiveLabelColor());

	itsCloseButton =
		new JXTextButton(JGetString("itsCloseButton::JXTipOfTheDayDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedBottom, 340,225, 60,20);
	assert( itsCloseButton != NULL );

	itsNextTipButton =
		new JXTextButton(JGetString("itsNextTipButton::JXTipOfTheDayDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,225, 60,20);
	assert( itsNextTipButton != NULL );
	itsNextTipButton->SetShortcuts(JGetString("itsNextTipButton::JXTipOfTheDayDialog::shortcuts::JXLayout"));

	JXImageWidget* icon =
		new JXImageWidget(sideBar,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,15, 30,30);
	assert( icon != NULL );

	JXScrollbarSet* scrollbarSet =
		new JXScrollbarSet(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 60,60, 340,150);
	assert( scrollbarSet != NULL );

	JXStaticText* title =
		new JXStaticText(JGetString("title::JXTipOfTheDayDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 60,10, 340,50);
	assert( title != NULL );

	itsShowAtStartupCB =
		new JXTextCheckbox(JGetString("itsShowAtStartupCB::JXTipOfTheDayDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 10,225, 140,20);
	assert( itsShowAtStartupCB != NULL );

// end JXLayout

	window->SetTitle("Tip of the Day");
	window->LockCurrentMinSize();
	window->PlaceAsDialogWindow();

	JXDisplay* display = GetDisplay();
	JXImage* wIcon     = new JXImage(display, jx_tip_of_the_day);
	assert( wIcon != NULL );
	window->SetIcon(wIcon);

	sideBar->SetColor((GetColormap())->GetGrayColor(50));
	icon->SetXPM(jx_tip_of_the_day, (GetColormap())->GetGrayColor(50));

	title->SetBorderWidth(kJXDefaultBorderWidth);
	title->TESetLeftMarginWidth(5);
	title->SetBackColor(title->GetFocusColor());
	title->JTextEditor::SetFont(1, title->GetTextLength(), "Times", 18,
								JFontStyle(kJTrue, kJFalse, 0, kJFalse), kJTrue);
	title->SetCaretLocation(1);
	title->Paste("\n");

	itsText =
		new JXStaticText("", kJTrue, kJFalse,
						 scrollbarSet, scrollbarSet->GetScrollEnclosure(),
						 JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert( itsText != NULL );
	itsText->FitToEnclosure();
	itsText->TESetLeftMarginWidth(5);

	itsShowAtStartupCB->SetVisible(showStartupCB);
	itsShowAtStartupCB->SetState(showAtStartup);

	ListenTo(itsNextTipButton);
	ListenTo(itsCloseButton);
}
void
JXEditWWWPrefsDialog::BuildWindow
	(
	const JCharacter* showURLCmd,
	const JCharacter* showFileContentCmd,
	const JCharacter* showFileLocationCmd,
	const JCharacter* composeMailCmd
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 520,290, "");
	assert( window != NULL );

	itsShowURLCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 250,20, 250,20);
	assert( itsShowURLCmdInput != NULL );

	itsShowFileContentCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 250,80, 250,20);
	assert( itsShowFileContentCmdInput != NULL );

	itsShowFileLocationCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 250,140, 250,20);
	assert( itsShowFileLocationCmdInput != NULL );

	itsComposeMailCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 250,200, 250,20);
	assert( itsComposeMailCmdInput != NULL );

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 120,260, 70,20);
	assert( cancelButton != NULL );

	JXTextButton* okButton =
		new JXTextButton(JGetString("okButton::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 330,260, 70,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::JXEditWWWPrefsDialog::shortcuts::JXLayout"));

	JXStaticText* obj1_JXLayout =
		new JXStaticText(JGetString("obj1_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,40, 252,20);
	assert( obj1_JXLayout != NULL );
	obj1_JXLayout->SetToLabel();

	JXStaticText* obj2_JXLayout =
		new JXStaticText(JGetString("obj2_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 230,20);
	assert( obj2_JXLayout != NULL );
	obj2_JXLayout->SetToLabel();

	JXStaticText* obj3_JXLayout =
		new JXStaticText(JGetString("obj3_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,200, 230,20);
	assert( obj3_JXLayout != NULL );
	obj3_JXLayout->SetToLabel();

	JXStaticText* obj4_JXLayout =
		new JXStaticText(JGetString("obj4_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,220, 250,20);
	assert( obj4_JXLayout != NULL );
	obj4_JXLayout->SetToLabel();

	JXStaticText* obj5_JXLayout =
		new JXStaticText(JGetString("obj5_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,100, 251,20);
	assert( obj5_JXLayout != NULL );
	obj5_JXLayout->SetToLabel();

	JXStaticText* obj6_JXLayout =
		new JXStaticText(JGetString("obj6_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,80, 230,20);
	assert( obj6_JXLayout != NULL );
	obj6_JXLayout->SetToLabel();

	JXStaticText* obj7_JXLayout =
		new JXStaticText(JGetString("obj7_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,160, 260,20);
	assert( obj7_JXLayout != NULL );
	obj7_JXLayout->SetToLabel();

	JXStaticText* obj8_JXLayout =
		new JXStaticText(JGetString("obj8_JXLayout::JXEditWWWPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,140, 230,20);
	assert( obj8_JXLayout != NULL );
	obj8_JXLayout->SetToLabel();

// end JXLayout

	window->SetTitle("Web Browser Preferences");
	SetButtons(okButton, cancelButton);

	itsShowURLCmdInput->SetText(showURLCmd);
	itsShowURLCmdInput->SetIsRequired();
	itsShowURLCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsShowFileContentCmdInput->SetText(showFileContentCmd);
	itsShowFileContentCmdInput->SetIsRequired();
	itsShowFileContentCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsShowFileLocationCmdInput->SetText(showFileLocationCmd);
	itsShowFileLocationCmdInput->SetIsRequired();
	itsShowFileLocationCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsComposeMailCmdInput->SetText(composeMailCmd);
	itsComposeMailCmdInput->SetIsRequired();
	itsComposeMailCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());
}
void
SyGFindFileDialog::BuildWindow()
{
// begin JXLayout

    JXWindow* window = new JXWindow(this, 360,220, "");
    assert( window != NULL );

    itsActionRG =
        new JXRadioGroup(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 10,50, 340,120);
    assert( itsActionRG != NULL );

    itsCloseButton =
        new JXTextButton(JGetString("itsCloseButton::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 120,190, 60,20);
    assert( itsCloseButton != NULL );
    itsCloseButton->SetShortcuts(JGetString("itsCloseButton::SyGFindFileDialog::shortcuts::JXLayout"));

    itsSearchButton =
        new JXTextButton(JGetString("itsSearchButton::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 280,190, 60,20);
    assert( itsSearchButton != NULL );
    itsSearchButton->SetShortcuts(JGetString("itsSearchButton::SyGFindFileDialog::shortcuts::JXLayout"));

    itsFileInput =
        new JXInputField(itsActionRG,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 35,30, 295,20);
    assert( itsFileInput != NULL );

    JXTextRadioButton* obj1_JXLayout =
        new JXTextRadioButton(kFindFileAction, JGetString("obj1_JXLayout::SyGFindFileDialog::JXLayout"), itsActionRG,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 10,10, 320,20);
    assert( obj1_JXLayout != NULL );
    obj1_JXLayout->SetShortcuts(JGetString("obj1_JXLayout::SyGFindFileDialog::shortcuts::JXLayout"));

    itsHelpButton =
        new JXTextButton(JGetString("itsHelpButton::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 200,190, 60,20);
    assert( itsHelpButton != NULL );
    itsHelpButton->SetShortcuts(JGetString("itsHelpButton::SyGFindFileDialog::shortcuts::JXLayout"));

    itsStayOpenCB =
        new JXTextCheckbox(JGetString("itsStayOpenCB::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,190, 90,20);
    assert( itsStayOpenCB != NULL );

    itsExprInput =
        new JXInputField(itsActionRG,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 35,90, 295,20);
    assert( itsExprInput != NULL );

    JXTextRadioButton* obj2_JXLayout =
        new JXTextRadioButton(kFindExprAction, JGetString("obj2_JXLayout::SyGFindFileDialog::JXLayout"), itsActionRG,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 10,70, 320,20);
    assert( obj2_JXLayout != NULL );
    obj2_JXLayout->SetShortcuts(JGetString("obj2_JXLayout::SyGFindFileDialog::shortcuts::JXLayout"));

    JXStaticText* obj3_JXLayout =
        new JXStaticText(JGetString("obj3_JXLayout::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,20);
    assert( obj3_JXLayout != NULL );
    obj3_JXLayout->SetToLabel();

    itsPathInput =
        new JXPathInput(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 70,20, 210,20);
    assert( itsPathInput != NULL );

    itsChoosePathButton =
        new JXTextButton(JGetString("itsChoosePathButton::SyGFindFileDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedTop, 280,20, 60,20);
    assert( itsChoosePathButton != NULL );

// end JXLayout

	window->SetTitle("Find files");
	window->SetCloseAction(JXWindow::kDeactivateDirector);
	window->PlaceAsDialogWindow();
	window->LockCurrentMinSize();
	window->ShouldFocusWhenShow(kJTrue);

	itsActionRG->SetBorderWidth(0);

	ListenTo(itsChoosePathButton);
	ListenTo(itsActionRG);
	ListenTo(itsSearchButton);
	ListenTo(itsCloseButton);
	ListenTo(itsHelpButton);

	itsPathInput->ShouldAllowInvalidPath();

	itsFileInput->ShouldBroadcastAllTextChanged(kJTrue);
	itsFileInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord);
	itsFileInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());
	ListenTo(itsFileInput);

	itsExprInput->ShouldBroadcastAllTextChanged(kJTrue);
	itsExprInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord);
	itsExprInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());
	ListenTo(itsExprInput);

	itsStayOpenCB->SetState(kJTrue);

	UpdateDisplay();
}
Ejemplo n.º 18
0
CBCStyler::CBCStyler()
	:
	CBStylerBase(kCurrentTypeListVersion, kTypeCount, kTypeNames,
				 kEditDialogTitle, kCBCStyleID, kCBCSourceFT),
	CBCScanner()
{
	JFontStyle blankStyle;
	for (JIndex i=1; i<=kTypeCount; i++)
		{
		SetTypeStyle(i, blankStyle);
		}

	JColormap* colormap   = GetColormap();
	const JColorIndex red = colormap->GetRedColor();

	SetTypeStyle(kDollarID           - kWhitespace, JFontStyle(red));
	SetTypeStyle(kReservedCKeyword   - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kReservedCPPKeyword - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));
	SetTypeStyle(kBuiltInDataType    - kWhitespace, JFontStyle(colormap->GetDarkGreenColor()));

	SetTypeStyle(kString             - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));
	SetTypeStyle(kCharConst          - kWhitespace, JFontStyle(colormap->GetDarkRedColor()));

	SetTypeStyle(kComment            - kWhitespace, JFontStyle(colormap->GetGrayColor(50)));
	SetTypeStyle(kPPDirective        - kWhitespace, JFontStyle(colormap->GetBlueColor()));

	SetTypeStyle(kTrigraph           - kWhitespace, JFontStyle(red));
	SetTypeStyle(kRespelling         - kWhitespace, JFontStyle(red));
	SetTypeStyle(kError              - kWhitespace, JFontStyle(red));

	SetWordStyle("#pragma",       JFontStyle(red));
	SetWordStyle("#include_next", JFontStyle(red));
	SetWordStyle("goto",          JFontStyle(kJTrue, kJFalse, 0, kJFalse, red));

	JPrefObject::ReadPrefs();
}
void
GMessageViewDir::BuildWindow
	(
	const JString& mailfile
	)
{
	JSize w = 500;
	JSize h = 300;
	JXWindow* window = new JXWindow(this, w,h, mailfile);
    assert( window != NULL );

	window->SetWMClass(GMGetWMClassInstance(), GMGetViewWindowClass());
    GGetPrefsMgr()->GetViewWindowSize(window);
	w = window->GetFrameWidth();
	h = window->GetFrameHeight();

    window->SetMinSize(w, 150);
    window->ShouldFocusWhenShow(kJTrue);

	JXMenuBar* menuBar =
		new JXMenuBar(window,
			JXWidget::kHElastic, JXWidget::kFixedTop,
			0, 0, w - kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
	assert(menuBar != NULL);

	JXEngravedRect* eRect =
		new JXEngravedRect(window,
			JXWidget::kFixedRight, JXWidget::kFixedTop,
			w - kJXDefaultMenuBarHeight, 0, kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
	assert(eRect != NULL);

	GMMessageDragSource* mds =
		new GMMessageDragSource(this, window,
			JXWidget::kFixedRight, JXWidget::kFixedTop,
			w - kJXDefaultMenuBarHeight + kJXDefaultBorderWidth,
			0 + kJXDefaultBorderWidth,
			kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1,
			kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1);
	assert(mds != NULL);

	itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
	itsFileMenu->SetMenuItems(kFileMenuStr);
	itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsFileMenu);

	JPtrArray<JString> nodes(JPtrArrayT::kDeleteAll);
	GGetMailboxTreeDir()->GetTopLevelNodes(&nodes);

	itsTransferMenu = new JXFSDirMenu(nodes, itsFileMenu, kTransferToCmd, menuBar);
	assert(itsTransferMenu != NULL);
	ListenTo(itsTransferMenu);

	JDirInfo* info;
	if (itsTransferMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	itsCopyMenu = new JXFSDirMenu(nodes, itsFileMenu, kCopyToCmd, menuBar);
	assert(itsCopyMenu != NULL);
	ListenTo(itsCopyMenu);

	if (itsCopyMenu->GetDirInfo(&info))
		{
		info->SetContentFilter(GMGetMailRegexStr());
		}

	ListenTo(GGetMailboxTreeDir());

	itsMessageMenu = menuBar->AppendTextMenu(kMessageMenuTitleStr);
	itsMessageMenu->SetMenuItems(kMessageMenuStr);
	itsMessageMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsMessageMenu);

	itsToolBar =
		new JXToolBar(GGetPrefsMgr(), kGViewToolBarID,
			menuBar, w, 150, window,
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
	assert(itsToolBar != NULL);

	const JSize newHeight	= itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();

	const JFontManager* fm	= window->GetFontManager();
	JSize lineHeight =
		fm->GetLineHeight(GGetPrefsMgr()->GetDefaultMonoFont(),
						  GGetPrefsMgr()->GetDefaultFontSize(),
						  JFontStyle());


	const JCoordinate headerheight  = (lineHeight * 4) + (lineHeight/2); //58;

	JArray<JCoordinate> sizes;
	JArray<JCoordinate> minSizes;

	sizes.AppendElement(headerheight);
	minSizes.AppendElement(20);
	sizes.AppendElement(w - headerheight);
	minSizes.AppendElement(50);
	JIndex elasticIndex = 2;

	itsPart =
		new JXVertPartition(sizes, elasticIndex,
			minSizes, itsToolBar->GetWidgetEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0, 0,
			w, newHeight);
	assert(itsPart != NULL);

	itsSBSet =
		new JXScrollbarSet(itsPart->GetCompartment(2),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,
			100,100);
	assert(itsSBSet != NULL);
	itsSBSet->FitToEnclosure(kJTrue, kJTrue);

	itsView =
		new GMessageView(menuBar, itsSBSet, itsSBSet->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,10,10);
	assert (itsView != NULL);
	itsView->FitToEnclosure(kJTrue, kJTrue);
	itsView->SetPTPrinter(GMGetAltPTPrinter());

	window->InstallShortcuts(itsView, "#_");
	ListenTo(itsView);

	JXScrollbarSet* sbs =
		new JXScrollbarSet(itsPart->GetCompartment(1),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,
			100,50);
	assert(sbs != NULL);
	sbs->FitToEnclosure(kJTrue, kJTrue);

	itsHeader =
		new GMessageView(sbs, sbs->GetScrollEnclosure(),
			JXWidget::kHElastic, JXWidget::kVElastic,
			0,0,10,10);
	assert (itsHeader != NULL);
	itsHeader->FitToEnclosure(kJTrue, kJTrue);

	itsHeader->ShareEditMenu(itsView);
	itsHeader->ShareSearchMenu(itsView);

	GMDirectorMenu* menu =
		new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
			JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
	assert(menu != NULL);
	menuBar->AppendMenu(menu);

	itsPrefsMenu = menuBar->AppendTextMenu(kPrefsMenuTitleStr);
	itsPrefsMenu->SetMenuItems(kPrefsMenuStr);
	itsPrefsMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsPrefsMenu);

	itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
	itsHelpMenu->SetMenuItems(kHelpMenuStr);
	itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
	ListenTo(itsHelpMenu);

	itsFileMenu->SetItemImage(kNewCmd, filenew);
	itsFileMenu->SetItemImage(kNewMBox, envelopes);
	itsFileMenu->SetItemImage(kOpenCmd, fileopen);
	itsFileMenu->SetItemImage(kSaveCmd, filefloppy);
	itsFileMenu->SetItemImage(kPrintCmd, fileprint);
	itsFileMenu->SetItemImage(kShowNextCmd, mini_right);
	itsFileMenu->SetItemImage(kDeleteShowNextCmd, mini_del_right);
	itsFileMenu->SetItemImage(kShowPrevCmd, mini_left);

	itsMessageMenu->SetItemImage(kDecryptCmd, unlock_xpm);
	itsMessageMenu->SetItemImage(kSaveAttachCmd, paperclip);
	itsMessageMenu->SetItemImage(kReplyCmd, reply_xpm);
	itsMessageMenu->SetItemImage(kReplySenderCmd, reply_sender_xpm);
	itsMessageMenu->SetItemImage(kReplyAllCmd, reply_all_xpm);
	itsMessageMenu->SetItemImage(kForwardCmd, forward_xpm);
	itsMessageMenu->SetItemImage(kRedirectCmd, redirect_xpm);

	itsHelpMenu->SetItemImage(kTOCCmd, jx_help_toc);
	itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));

	itsToolBar->LoadPrefs();

	if (itsToolBar->IsEmpty())
		{
		itsToolBar->AppendButton(itsFileMenu, kNewCmd);
		itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kSaveCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kPrintCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsFileMenu, kShowNextCmd);
		itsToolBar->AppendButton(itsFileMenu, kShowPrevCmd);
		itsToolBar->AppendButton(itsFileMenu, kDeleteShowNextCmd);
		itsToolBar->NewGroup();

		itsToolBar->AppendButton(itsMessageMenu, kReplyCmd);
		itsToolBar->AppendButton(itsMessageMenu, kReplySenderCmd);
		itsToolBar->AppendButton(itsMessageMenu, kReplyAllCmd);
		itsToolBar->AppendButton(itsMessageMenu, kForwardCmd);
		itsToolBar->AppendButton(itsMessageMenu, kRedirectCmd);
		}

	itsMenuIcon = new JXImage(window->GetDisplay(), jx_plain_file_small);
	assert(itsMenuIcon != NULL);
	itsMenuIcon->ConvertToRemoteStorage();
}
Ejemplo n.º 20
0
void
SyGEditPrefsDialog::BuildWindow
	(
	const JCharacter*	terminalCmd,
	const JCharacter*	manViewCmd,
	const JCharacter*	gitStatusCmd,
	const JCharacter*	gitHistoryCmd,
	const JCharacter*	postCheckoutCmd,
	const JBoolean		del,
	const JBoolean		newWindows,
	const JBoolean		perFolderPrefs
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 470,380, "");
	assert( window != NULL );

	itsManInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 155,190, 300,20);
	assert( itsManInput != NULL );

	itsTerminalInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 155,210, 300,20);
	assert( itsTerminalInput != NULL );

	itsGitStatusInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 215,260, 240,20);
	assert( itsGitStatusInput != NULL );

	JXStaticText* obj1_JXLayout =
		new JXStaticText(JGetString("obj1_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,210, 145,20);
	assert( obj1_JXLayout != NULL );
	obj1_JXLayout->SetToLabel();

	JXStaticText* obj2_JXLayout =
		new JXStaticText(JGetString("obj2_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,190, 145,20);
	assert( obj2_JXLayout != NULL );
	obj2_JXLayout->SetToLabel();

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 105,350, 60,20);
	assert( cancelButton != NULL );
	cancelButton->SetShortcuts(JGetString("cancelButton::SyGEditPrefsDialog::shortcuts::JXLayout"));

	JXTextButton* okButton =
		new JXTextButton(JGetString("okButton::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 305,350, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::SyGEditPrefsDialog::shortcuts::JXLayout"));

	JXStaticText* obj3_JXLayout =
		new JXStaticText(JGetString("obj3_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 155,230, 300,20);
	assert( obj3_JXLayout != NULL );
	obj3_JXLayout->SetFontSize(8);
	obj3_JXLayout->SetToLabel();

	itsDelCB =
		new JXTextCheckbox(JGetString("itsDelCB::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,70, 210,20);
	assert( itsDelCB != NULL );

	itsAllowSpaceCB =
		new JXTextCheckbox(JGetString("itsAllowSpaceCB::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,120, 210,20);
	assert( itsAllowSpaceCB != NULL );

	JXStaticText* obj4_JXLayout =
		new JXStaticText(JGetString("obj4_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 40,90, 310,20);
	assert( obj4_JXLayout != NULL );
	obj4_JXLayout->SetFontSize(8);
	obj4_JXLayout->SetToLabel();

	JXStaticText* obj5_JXLayout =
		new JXStaticText(JGetString("obj5_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,300, 205,20);
	assert( obj5_JXLayout != NULL );
	obj5_JXLayout->SetToLabel();

	JXStaticText* obj6_JXLayout =
		new JXStaticText(JGetString("obj6_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 215,320, 240,20);
	assert( obj6_JXLayout != NULL );
	obj6_JXLayout->SetFontSize(8);
	obj6_JXLayout->SetToLabel();

	JXStaticText* obj7_JXLayout =
		new JXStaticText(JGetString("obj7_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,260, 205,20);
	assert( obj7_JXLayout != NULL );
	obj7_JXLayout->SetToLabel();

	itsGitHistoryInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 215,280, 240,20);
	assert( itsGitHistoryInput != NULL );

	JXStaticText* obj8_JXLayout =
		new JXStaticText(JGetString("obj8_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,280, 205,20);
	assert( obj8_JXLayout != NULL );
	obj8_JXLayout->SetToLabel();

	itsPostCheckoutInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 215,300, 240,20);
	assert( itsPostCheckoutInput != NULL );

	itsOpenNewWindowsCB =
		new JXTextCheckbox(JGetString("itsOpenNewWindowsCB::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 210,20);
	assert( itsOpenNewWindowsCB != NULL );

	JXStaticText* obj9_JXLayout =
		new JXStaticText(JGetString("obj9_JXLayout::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 40,40, 410,20);
	assert( obj9_JXLayout != NULL );
	obj9_JXLayout->SetFontSize(8);
	obj9_JXLayout->SetToLabel();

	itsFolderPrefsCB =
		new JXTextCheckbox(JGetString("itsFolderPrefsCB::SyGEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,150, 220,20);
	assert( itsFolderPrefsCB != NULL );

// end JXLayout

	window->SetTitle("Edit preferences");
	SetButtons(okButton, cancelButton);

	itsManInput->SetText(manViewCmd);
	itsManInput->SetIsRequired();
	itsManInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsTerminalInput->SetText(terminalCmd);
	itsTerminalInput->SetIsRequired();
	itsTerminalInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsGitStatusInput->SetText(gitStatusCmd);
	itsGitStatusInput->SetIsRequired();
	itsGitStatusInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsGitHistoryInput->SetText(gitHistoryCmd);
	itsGitHistoryInput->SetIsRequired();
	itsGitHistoryInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsPostCheckoutInput->SetText(postCheckoutCmd);
	itsPostCheckoutInput->SetIsRequired();
	itsPostCheckoutInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsOpenNewWindowsCB->SetState(newWindows);
	itsDelCB->SetState(del);
	itsAllowSpaceCB->SetState(JXSaveFileInput::WillAllowSpace());
	itsFolderPrefsCB->SetState(perFolderPrefs);
}
void
CMEditPrefsDialog::BuildWindow
	(
	const JCharacter*			gdbCmd,
	const JCharacter*			jdbCmd,
	const JCharacter*			editFileCmd,
	const JCharacter*			editFileLineCmd,
	const JPtrArray<JString>&	cSourceSuffixes,
	const JPtrArray<JString>&	cHeaderSuffixes,
	const JPtrArray<JString>&	javaSuffixes,
	const JPtrArray<JString>&	phpSuffixes,
	const JPtrArray<JString>&	fortranSuffixes
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 450,420, "");
	assert( window != NULL );

	itsGDBCmd =
		new CMDebuggerProgramInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 350,20);
	assert( itsGDBCmd != NULL );

	itsJDBCmd =
		new CMDebuggerProgramInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,110, 350,20);
	assert( itsJDBCmd != NULL );

	itsEditFileCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,160, 240,20);
	assert( itsEditFileCmdInput != NULL );

	itsEditFileLineCmdInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,180, 240,20);
	assert( itsEditFileLineCmdInput != NULL );

	itsCSourceSuffixInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,240, 240,20);
	assert( itsCSourceSuffixInput != NULL );

	itsCHeaderSuffixInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,260, 240,20);
	assert( itsCHeaderSuffixInput != NULL );

	itsJavaSuffixInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,290, 240,20);
	assert( itsJavaSuffixInput != NULL );

	JXTextButton* okButton =
		new JXTextButton(JGetString("okButton::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 280,390, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::CMEditPrefsDialog::shortcuts::JXLayout"));

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 100,390, 60,20);
	assert( cancelButton != NULL );

	JXStaticText* obj1_JXLayout =
		new JXStaticText(JGetString("obj1_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,240, 170,20);
	assert( obj1_JXLayout != NULL );
	obj1_JXLayout->SetToLabel();

	JXStaticText* obj2_JXLayout =
		new JXStaticText(JGetString("obj2_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,260, 170,20);
	assert( obj2_JXLayout != NULL );
	obj2_JXLayout->SetToLabel();

	JXStaticText* obj3_JXLayout =
		new JXStaticText(JGetString("obj3_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,200, 270,20);
	assert( obj3_JXLayout != NULL );
    obj3_JXLayout->SetFontSize(8);
	obj3_JXLayout->SetToLabel();

	JXStaticText* obj4_JXLayout =
		new JXStaticText(JGetString("obj4_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,160, 170,20);
	assert( obj4_JXLayout != NULL );
	obj4_JXLayout->SetToLabel();

	JXStaticText* obj5_JXLayout =
		new JXStaticText(JGetString("obj5_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,180, 170,20);
	assert( obj5_JXLayout != NULL );
	obj5_JXLayout->SetToLabel();

	JXStaticText* obj6_JXLayout =
		new JXStaticText(JGetString("obj6_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 31,290, 159,20);
	assert( obj6_JXLayout != NULL );
	obj6_JXLayout->SetToLabel();

	JXStaticText* obj7_JXLayout =
		new JXStaticText(JGetString("obj7_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,350, 170,20);
	assert( obj7_JXLayout != NULL );
	obj7_JXLayout->SetToLabel();

	JXStaticText* obj8_JXLayout =
		new JXStaticText(JGetString("obj8_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 340,20);
	assert( obj8_JXLayout != NULL );
	obj8_JXLayout->SetToLabel();

	itsChooseGDBButton =
		new JXTextButton(JGetString("itsChooseGDBButton::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 370,40, 60,20);
	assert( itsChooseGDBButton != NULL );

	JXStaticText* obj9_JXLayout =
		new JXStaticText(JGetString("obj9_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 410,20);
	assert( obj9_JXLayout != NULL );
    obj9_JXLayout->SetFontSize(8);
	obj9_JXLayout->SetToLabel();

	JXStaticText* obj10_JXLayout =
		new JXStaticText(JGetString("obj10_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,90, 340,20);
	assert( obj10_JXLayout != NULL );
	obj10_JXLayout->SetToLabel();

	itsChooseJDBButton =
		new JXTextButton(JGetString("itsChooseJDBButton::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 370,110, 60,20);
	assert( itsChooseJDBButton != NULL );

	JXStaticText* obj11_JXLayout =
		new JXStaticText(JGetString("obj11_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,130, 410,20);
	assert( obj11_JXLayout != NULL );
    obj11_JXLayout->SetFontSize(8);
	obj11_JXLayout->SetToLabel();

	itsPHPSuffixInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,320, 240,20);
	assert( itsPHPSuffixInput != NULL );

	JXStaticText* obj12_JXLayout =
		new JXStaticText(JGetString("obj12_JXLayout::CMEditPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 31,320, 159,20);
	assert( obj12_JXLayout != NULL );
	obj12_JXLayout->SetToLabel();

	itsFortranSuffixInput =
		new JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 190,350, 240,20);
	assert( itsFortranSuffixInput != NULL );

// end JXLayout

	window->SetTitle("Edit preferences");
	SetButtons(okButton, cancelButton);

	itsGDBCmd->SetText(gdbCmd);
	itsGDBCmd->SetIsRequired();
	itsGDBCmd->ShouldRequireExecutable();

	itsJDBCmd->SetText(jdbCmd);
	itsJDBCmd->SetIsRequired();
	itsJDBCmd->ShouldRequireExecutable();

	itsEditFileCmdInput->SetText(editFileCmd);
	itsEditFileCmdInput->SetIsRequired();
	itsEditFileCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	itsEditFileLineCmdInput->SetText(editFileLineCmd);
	itsEditFileLineCmdInput->SetIsRequired();
	itsEditFileLineCmdInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	CBMSetStringList(itsCSourceSuffixInput, cSourceSuffixes);
	itsCSourceSuffixInput->SetIsRequired();
	itsCSourceSuffixInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	CBMSetStringList(itsCHeaderSuffixInput, cHeaderSuffixes);
	itsCHeaderSuffixInput->SetIsRequired();
	itsCHeaderSuffixInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	CBMSetStringList(itsJavaSuffixInput, javaSuffixes);
	itsJavaSuffixInput->SetIsRequired();
	itsJavaSuffixInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	CBMSetStringList(itsPHPSuffixInput, phpSuffixes);
	itsPHPSuffixInput->SetIsRequired();
	itsPHPSuffixInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	CBMSetStringList(itsFortranSuffixInput, fortranSuffixes);
	itsFortranSuffixInput->SetIsRequired();
	itsFortranSuffixInput->SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

	ListenTo(itsChooseGDBButton);
	ListenTo(itsChooseJDBButton);
}