当前位置: 首页>>代码示例>>C++>>正文


C++ JXStaticText类代码示例

本文整理汇总了C++中JXStaticText的典型用法代码示例。如果您正苦于以下问题:C++ JXStaticText类的具体用法?C++ JXStaticText怎么用?C++ JXStaticText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JXStaticText类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: JXWindow

void
JXGetStringDialog::BuildWindow
	(
	const JCharacter*	windowTitle,
	const JCharacter*	prompt,
	const JCharacter*	initialValue,
	const JBoolean		password
	)
{
// begin JXLayout

    JXWindow* window = new JXWindow(this, 310,110, "");
    assert( window != NULL );

    JXTextButton* okButton =
        new JXTextButton(JGetString("okButton::JXGetStringDialog::JXLayout"), window,
                    JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,80, 60,20);
    assert( okButton != NULL );
    okButton->SetShortcuts(JGetString("okButton::JXGetStringDialog::shortcuts::JXLayout"));

    JXTextButton* cancelButton =
        new JXTextButton(JGetString("cancelButton::JXGetStringDialog::JXLayout"), window,
                    JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 60,20);
    assert( cancelButton != NULL );
    cancelButton->SetShortcuts(JGetString("cancelButton::JXGetStringDialog::shortcuts::JXLayout"));

    itsInputField =
        new JXInputField(window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 270,20);
    assert( itsInputField != NULL );

    JXStaticText* promptDisplay =
        new JXStaticText(JGetString("promptDisplay::JXGetStringDialog::JXLayout"), window,
                    JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 270,20);
    assert( promptDisplay != NULL );
    promptDisplay->SetToLabel();

// end JXLayout

	window->SetTitle(windowTitle);
	SetButtons(okButton, cancelButton);

	promptDisplay->SetText(prompt);

	if (password)
		{
		const JRect r = itsInputField->GetFrame();
		delete itsInputField;
		itsInputField =
			new JXPasswordInput(window,
				JXWidget::kHElastic, JXWidget::kFixedTop,
				r.left, r.top, r.width(), r.height());
		assert( itsInputField != NULL );
		}
	else if (!JStringEmpty(initialValue))
		{
		itsInputField->SetText(initialValue);
		}
	itsInputField->SetIsRequired();
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:60,代码来源:JXGetStringDialog.cpp

示例2: JXWindow

void
SyGNewGitRemoteDialog::BuildWindow()
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 310,160, "");
	assert( window != NULL );

	JXTextButton* okButton =
		jnew JXTextButton(JGetString("okButton::SyGNewGitRemoteDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,130, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::SyGNewGitRemoteDialog::shortcuts::JXLayout"));

	JXTextButton* cancelButton =
		jnew JXTextButton(JGetString("cancelButton::SyGNewGitRemoteDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,130, 60,20);
	assert( cancelButton != NULL );
	cancelButton->SetShortcuts(JGetString("cancelButton::SyGNewGitRemoteDialog::shortcuts::JXLayout"));

	itsRemoteURLInputField =
		jnew JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 270,20);
	assert( itsRemoteURLInputField != NULL );

	JXStaticText* remoteLabel =
		jnew JXStaticText(JGetString("remoteLabel::SyGNewGitRemoteDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 270,20);
	assert( remoteLabel != NULL );
	remoteLabel->SetToLabel();

	itsLocalNameInputField =
		jnew JXInputField(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,90, 270,20);
	assert( itsLocalNameInputField != NULL );

	JXStaticText* localLabel =
		jnew JXStaticText(JGetString("localLabel::SyGNewGitRemoteDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,70, 270,20);
	assert( localLabel != NULL );
	localLabel->SetToLabel();

// end JXLayout

	window->SetTitle(JGetString("WindowTitle::SyGNewGitRemoteDialog"));
	SetButtons(okButton, cancelButton);

	itsRemoteURLInputField->SetIsRequired();
	itsLocalNameInputField->SetIsRequired();
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:50,代码来源:SyGNewGitRemoteDialog.cpp

示例3: JXWindow

void
JXFixLenPGDirector::BuildWindow
	(
	JXProgressDisplay*	pg,
	const JCharacter*	message,
	const JBoolean		allowCancel
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 270,80, "");
	assert( window != NULL );

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::JXFixLenPGDirector::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 190,10, 60,20);
	assert( cancelButton != NULL );
	cancelButton->SetShortcuts(JGetString("cancelButton::JXFixLenPGDirector::shortcuts::JXLayout"));

	JXStaticText* text =
		new JXStaticText(JGetString("text::JXFixLenPGDirector::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 20,10, 160,20);
	assert( text != NULL );
	text->SetToLabel();

	JXProgressIndicator* indicator =
		new JXProgressIndicator(window,
					JXWidget::kHElastic, JXWidget::kFixedBottom, 20,50, 230,10);
	assert( indicator != NULL );

// end JXLayout

	if (!allowCancel)
		{
		// expand text to fill window because Cancel button will be hidden

		text->AdjustSize(indicator->GetFrameWidth() - text->GetFrameWidth(), 0);
		}

	Init(window, text, message, allowCancel, cancelButton);

	pg->SetItems(cancelButton, NULL, indicator);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:43,代码来源:JXFixLenPGDirector.cpp

示例4: JXWindow

void
SetElasticDialog::BuildWindow
	(
	const JIndex index,
	const JIndex maxIndex
	)
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 200,90, "");
	assert( window != NULL );

	JXTextButton* cancelButton =
		jnew JXTextButton(JGetString("cancelButton::SetElasticDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 30,60, 50,20);
	assert( cancelButton != NULL );

	JXTextButton* okButton =
		jnew JXTextButton(JGetString("okButton::SetElasticDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 120,60, 50,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::SetElasticDialog::shortcuts::JXLayout"));

	itsElasticIndex =
		jnew JXIntegerInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 140,20, 40,20);
	assert( itsElasticIndex != NULL );

	JXStaticText* elasticLabel =
		jnew JXStaticText(JGetString("elasticLabel::SetElasticDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,20, 130,20);
	assert( elasticLabel != NULL );
	elasticLabel->SetToLabel();

// end JXLayout

	window->SetTitle("Set elastic compartment");
	SetButtons(okButton, cancelButton);

	itsElasticIndex->SetValue(index);
	itsElasticIndex->SetLimits(0, maxIndex);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:42,代码来源:SetElasticDialog.cpp

示例5: JXWindow

void
JXVarLenPGDirector::BuildWindow
	(
	JXProgressDisplay*	pg,
	const JCharacter*	message,
	const JBoolean		allowCancel
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 270,80, "");
	assert( window != NULL );

	JXTextButton* cancelButton =
		new JXTextButton(JGetString("cancelButton::JXVarLenPGDirector::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,40, 60,20);
	assert( cancelButton != NULL );
	cancelButton->SetShortcuts(JGetString("cancelButton::JXVarLenPGDirector::shortcuts::JXLayout"));

	JXStaticText* text =
		new JXStaticText(JGetString("text::JXVarLenPGDirector::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 20,10, 230,20);
	assert( text != NULL );
	text->SetToLabel();

	JXStaticText* counter =
		new JXStaticText(JGetString("counter::JXVarLenPGDirector::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedBottom, 60,40, 100,20);
	assert( counter != NULL );
	counter->SetToLabel();

// end JXLayout

	Init(window, text, message, allowCancel, cancelButton);

	pg->SetItems(cancelButton, counter, NULL);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:37,代码来源:JXVarLenPGDirector.cpp

示例6: JXWindow

void
GLAboutDialog::BuildWindow
	(
	const JCharacter* prevVersStr
	)
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 430,180, "");
	assert( window != NULL );

	JXImageWidget* gloveIcon =
		jnew JXImageWidget(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,15, 50,50);
	assert( gloveIcon != NULL );

	JXStaticText* textWidget =
		jnew JXStaticText(JGetString("textWidget::GLAboutDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 90,20, 330,110);
	assert( textWidget != NULL );

	JXImageWidget* npsIcon =
		jnew JXImageWidget(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,75, 65,65);
	assert( npsIcon != NULL );

	JXTextButton* okButton =
		jnew JXTextButton(JGetString("okButton::GLAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 320,150, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::GLAboutDialog::shortcuts::JXLayout"));

	itsHelpButton =
		jnew JXTextButton(JGetString("itsHelpButton::GLAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 185,150, 60,20);
	assert( itsHelpButton != NULL );

	itsCreditsButton =
		jnew JXTextButton(JGetString("itsCreditsButton::GLAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 50,150, 60,20);
	assert( itsCreditsButton != NULL );

// end JXLayout

	window->SetTitle("About");
	SetButtons(okButton, NULL);

	ListenTo(itsHelpButton);
	ListenTo(itsCreditsButton);

	const JCharacter* map1[] =
		{
		"version",   JGetString("VERSION"),
		"copyright", JGetString("COPYRIGHT")
		};
	JString text	= JGetString(kDescriptionID, map1, sizeof(map1));

	if (!JStringEmpty(prevVersStr))
		{
		const JCharacter* map[] =
			{
			"vers", prevVersStr
			};
		text += JGetString(kUpgradeNoticeID);
		(JGetStringManager())->Replace(&text, map, sizeof(map));
		itsHelpButton->SetLabel(JGetString(kChangeButtonLabelID));
		itsIsUpgradeFlag = kJTrue;
		}
	textWidget->SetText(text);

	JXImage* image = jnew JXImage(GetDisplay(), JXPM(glove_icon));
	assert(image != NULL);
	gloveIcon->SetImage(image, kJTrue);

	// NPS icon

	image = jnew JXImage(GetDisplay(), nps);
	assert( image != NULL );
	npsIcon->SetImage(image, kJTrue);

	const JSize bdh = textWidget->GetBoundsHeight();
	const JSize aph = textWidget->GetApertureHeight();
	if (bdh > aph)
		{
		window->AdjustSize(0, bdh - aph);	// safe to calculate once bdh > aph
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:87,代码来源:GLAboutDialog.cpp

示例7: JXWindow

void
GXCreatePlotDialog::BuildWindow
	(
	GRaggedFloatTableData* data,
	const JIndex startX, 
	const JIndex startY,
	const JIndex startXErr, 
	const JIndex startYErr
	)
{
	
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 370,160, "");
	assert( window != NULL );

	JXTextButton* okButton =
		jnew JXTextButton(JGetString("okButton::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 280,130, 70,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::GXCreatePlotDialog::shortcuts::JXLayout"));

	JXTextButton* cancelButton =
		jnew JXTextButton(JGetString("cancelButton::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 180,130, 70,20);
	assert( cancelButton != NULL );
	cancelButton->SetShortcuts(JGetString("cancelButton::GXCreatePlotDialog::shortcuts::JXLayout"));

	itsLabelInput =
		jnew JXInputField(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 115,10, 200,20);
	assert( itsLabelInput != NULL );

	JXStaticText* labelLabel =
		jnew JXStaticText(JGetString("labelLabel::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 65,10, 50,20);
	assert( labelLabel != NULL );
	labelLabel->SetToLabel();

	itsXMenu =
		jnew JXTextMenu(JGetString("itsXMenu::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 10,40, 160,30);
	assert( itsXMenu != NULL );

	itsXErrMenu =
		jnew JXTextMenu(JGetString("itsXErrMenu::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 10,80, 160,30);
	assert( itsXErrMenu != NULL );

	itsYErrMenu =
		jnew JXTextMenu(JGetString("itsYErrMenu::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 200,80, 160,30);
	assert( itsYErrMenu != NULL );

	itsYMenu =
		jnew JXTextMenu(JGetString("itsYMenu::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 200,40, 160,30);
	assert( itsYMenu != NULL );

	itsPlotsMenu =
		jnew JXTextMenu(JGetString("itsPlotsMenu::GXCreatePlotDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 10,120, 130,30);
	assert( itsPlotsMenu != NULL );

// end JXLayout

	window->SetTitle("Choose Plot Data Columns");
	SetButtons(okButton, cancelButton);
	
	itsXErrMenu->AppendItem("None");
	itsYErrMenu->AppendItem("None");
	
	const JSize count = data->GetDataColCount();
	for (JSize i = 1; i <= count; i++)
		{
		JString str(i);
		str.Prepend("Column "); 
		itsXMenu->AppendItem(str);
		itsXErrMenu->AppendItem(str);
		itsYMenu->AppendItem(str);
		itsYErrMenu->AppendItem(str);
		}

	
	itsStartX = startX;
	if (startX == 0)
		{
		itsStartX = 1;
		}
		
	itsStartXErr = startXErr + 1;
		
	itsStartY = startY;
	if (startY == 0)
		{
		itsStartY = 1;
		}
		
	itsStartYErr = startYErr + 1;
	
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:GXCreatePlotDialog.cpp

示例8: JXWindow

void
CBEditTextPrefsDialog::BuildWindow
	(
	CBTextDocument* doc
	)
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 640,530, "");
	assert( window != NULL );

	itsTabCharCountInput =
		jnew JXIntegerInput(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 540,130, 40,20);
	assert( itsTabCharCountInput != NULL );

	itsCRMLineWidthInput =
		jnew JXIntegerInput(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 540,150, 40,20);
	assert( itsCRMLineWidthInput != NULL );

	itsUndoDepthInput =
		jnew JXIntegerInput(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 540,170, 40,20);
	assert( itsUndoDepthInput != NULL );

	JXTextButton* cancelButton =
		jnew JXTextButton(JGetString("cancelButton::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 40,490, 60,20);
	assert( cancelButton != NULL );

	JXTextButton* okButton =
		jnew JXTextButton(JGetString("okButton::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 220,490, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::CBEditTextPrefsDialog::shortcuts::JXLayout"));

	itsCreateBackupCB =
		jnew JXTextCheckbox(JGetString("itsCreateBackupCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,230, 300,20);
	assert( itsCreateBackupCB != NULL );

	itsAutoIndentCB =
		jnew JXTextCheckbox(JGetString("itsAutoIndentCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 20,160, 280,20);
	assert( itsAutoIndentCB != NULL );

	JXStaticText* spacesPerTabLabel =
		jnew JXStaticText(JGetString("spacesPerTabLabel::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,130, 210,20);
	assert( spacesPerTabLabel != NULL );
	spacesPerTabLabel->SetToLabel();

	itsExtraSpaceWindTitleCB =
		jnew JXTextCheckbox(JGetString("itsExtraSpaceWindTitleCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,310, 300,20);
	assert( itsExtraSpaceWindTitleCB != NULL );

	itsOpenComplFileOnTopCB =
		jnew JXTextCheckbox(JGetString("itsOpenComplFileOnTopCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,280, 300,20);
	assert( itsOpenComplFileOnTopCB != NULL );

	itsFontMenu =
		jnew JXChooseMonoFont(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 280,60);
	assert( itsFontMenu != NULL );

	itsEmulatorMenu =
		jnew JXTextMenu(JGetString("itsEmulatorMenu::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,90, 280,25);
	assert( itsEmulatorMenu != NULL );

	JXStaticText* undoDepthLabel =
		jnew JXStaticText(JGetString("undoDepthLabel::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,170, 210,20);
	assert( undoDepthLabel != NULL );
	undoDepthLabel->SetToLabel();

	itsUseDNDCB =
		jnew JXTextCheckbox(JGetString("itsUseDNDCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 20,130, 280,20);
	assert( itsUseDNDCB != NULL );

	itsOnlyBackupIfNoneCB =
		jnew JXTextCheckbox(JGetString("itsOnlyBackupIfNoneCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,250, 300,20);
	assert( itsOnlyBackupIfNoneCB != NULL );

	itsLeftToFrontOfTextCB =
		jnew JXTextCheckbox(JGetString("itsLeftToFrontOfTextCB::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 330,450, 300,20);
	assert( itsLeftToFrontOfTextCB != NULL );

	itsHelpButton =
		jnew JXTextButton(JGetString("itsHelpButton::CBEditTextPrefsDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 130,490, 60,20);
	assert( itsHelpButton != NULL );
	itsHelpButton->SetShortcuts(JGetString("itsHelpButton::CBEditTextPrefsDialog::shortcuts::JXLayout"));

//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:CBEditTextPrefsDialog.cpp

示例9: JXWindow

void
MDAboutDialog::BuildWindow
	(
	const JCharacter* prevVersStr
	)
{
// begin JXLayout

	JXWindow* window = new JXWindow(this, 370,120, "");
	assert( window != NULL );

	JXStaticText* textWidget =
		new JXStaticText(JGetString("textWidget::MDAboutDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kVElastic, 70,20, 280,50);
	assert( textWidget != NULL );

	JXTextButton* okButton =
		new JXTextButton(JGetString("okButton::MDAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 260,90, 60,20);
	assert( okButton != NULL );
	okButton->SetShortcuts(JGetString("okButton::MDAboutDialog::shortcuts::JXLayout"));

	itsHelpButton =
		new JXTextButton(JGetString("itsHelpButton::MDAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 155,90, 60,20);
	assert( itsHelpButton != NULL );
	itsHelpButton->SetShortcuts(JGetString("itsHelpButton::MDAboutDialog::shortcuts::JXLayout"));

	JXImageWidget* imageWidget =
		new JXImageWidget(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 40,40);
	assert( imageWidget != NULL );

	itsCreditsButton =
		new JXTextButton(JGetString("itsCreditsButton::MDAboutDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 50,90, 60,20);
	assert( itsCreditsButton != NULL );

// end JXLayout

	window->SetTitle(JGetString("WindowTitle::MDAboutDialog"));
	SetButtons(okButton, NULL);

	ListenTo(itsHelpButton);
	ListenTo(itsCreditsButton);

	JXImage* image = new JXImage(GetDisplay(), md_about_icon);
	assert( image != NULL );
	imageWidget->SetImage(image, kJTrue);

	JString text = MDGetVersionStr();
	if (!JStringEmpty(prevVersStr))
		{
		const JCharacter* map[] =
			{
			"vers", prevVersStr
			};
		text += JGetString(kUpgradeNoticeID);
		(JGetStringManager())->Replace(&text, map, sizeof(map));
		itsHelpButton->SetLabel(JGetString(kChangeButtonLabelID));
		itsIsUpgradeFlag = kJTrue;
		}
	textWidget->SetText(text);

	const JSize bdh = textWidget->GetBoundsHeight();
	const JSize aph = textWidget->GetApertureHeight();
	if (bdh > aph)
		{
		window->AdjustSize(0, bdh - aph);	// safe to calculate once bdh > aph
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:71,代码来源:MDAboutDialog.cpp

示例10: JXWindow

void
CBSearchTextDialog::BuildWindow()
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 450,470, "");
	assert( window != NULL );

	JXStaticText* replaceLabel =
		jnew JXStaticText(JGetString("replaceLabel::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,101, 220,20);
	assert( replaceLabel != NULL );
	replaceLabel->SetToLabel();

	JXStaticText* searchLabel =
		jnew JXStaticText(JGetString("searchLabel::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,31, 220,20);
	assert( searchLabel != NULL );
	searchLabel->SetToLabel();

	JXInputField* searchInput =
		jnew JXInputField(kJTrue, kJFalse, window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,50, 220,40);
	assert( searchInput != NULL );

	JXInputField* replaceInput =
		jnew JXInputField(kJTrue, kJFalse, window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 20,120, 220,40);
	assert( replaceInput != NULL );

	JXTextButton* closeButton =
		jnew JXTextButton(JGetString("closeButton::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 320,440, 80,20);
	assert( closeButton != NULL );

	JXTextCheckbox* ignoreCaseCB =
		jnew JXTextCheckbox(JGetString("ignoreCaseCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,180, 130,20);
	assert( ignoreCaseCB != NULL );

	JXTextCheckbox* wrapSearchCB =
		jnew JXTextCheckbox(JGetString("wrapSearchCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,240, 130,20);
	assert( wrapSearchCB != NULL );

	JXTextButton* replaceButton =
		jnew JXTextButton(JGetString("replaceButton::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 300,50, 140,20);
	assert( replaceButton != NULL );

	JXTextCheckbox* entireWordCB =
		jnew JXTextCheckbox(JGetString("entireWordCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,210, 130,20);
	assert( entireWordCB != NULL );

	JXStringHistoryMenu* prevReplaceMenu =
		jnew JXStringHistoryMenu(kHistoryLength, "", window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 250,130, 30,20);
	assert( prevReplaceMenu != NULL );

	JXStringHistoryMenu* prevSearchMenu =
		jnew JXStringHistoryMenu(kHistoryLength, "", window,
					JXWidget::kFixedRight, JXWidget::kFixedTop, 250,60, 30,20);
	assert( prevSearchMenu != NULL );

	JXTextButton* helpButton =
		jnew JXTextButton(JGetString("helpButton::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,440, 80,20);
	assert( helpButton != NULL );
	helpButton->SetShortcuts(JGetString("helpButton::CBSearchTextDialog::shortcuts::JXLayout"));

	JXTextCheckbox* searchIsRegexCB =
		jnew JXTextCheckbox(JGetString("searchIsRegexCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,180, 150,20);
	assert( searchIsRegexCB != NULL );

	JXTextCheckbox* replaceIsRegexCB =
		jnew JXTextCheckbox(JGetString("replaceIsRegexCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 320,180, 110,20);
	assert( replaceIsRegexCB != NULL );

	JXTextCheckbox* singleLineCB =
		jnew JXTextCheckbox(JGetString("singleLineCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,210, 150,20);
	assert( singleLineCB != NULL );

	JXTextCheckbox* preserveCaseCB =
		jnew JXTextCheckbox(JGetString("preserveCaseCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 320,210, 110,20);
	assert( preserveCaseCB != NULL );

	JXTextButton* qRefButton =
		jnew JXTextButton(JGetString("qRefButton::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedBottom, 190,440, 80,20);
	assert( qRefButton != NULL );

	itsMultifileCB =
		jnew JXTextCheckbox(JGetString("itsMultifileCB::CBSearchTextDialog::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,360, 100,20);
	assert( itsMultifileCB != NULL );
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:CBSearchTextDialog.cpp

示例11: heights

void
SCFeedbackDirector::BuildWindow
(
    SCCircuitDocument* doc
)
{
    const SCCircuit* circuit = doc->GetCircuit();

    JArray<JCoordinate> heights(4);
    heights.AppendElement(kInitExprHeight);
    heights.AppendElement(kInitExprHeight);
    heights.AppendElement(kInitExprHeight);
    heights.AppendElement(kInitExprHeight);

    JArray<JCoordinate> minHeights(4);
    minHeights.AppendElement(kMinExprHeight);
    minHeights.AppendElement(kMinExprHeight);
    minHeights.AppendElement(kMinExprHeight);
    minHeights.AppendElement(kMinExprHeight);

// begin JXLayout

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

    itsMainPartition =
        new JXVertPartition(heights, 0, minHeights, window,
                            JXWidget::kHElastic, JXWidget::kVElastic, 0,110, 365,415);
    assert( itsMainPartition != NULL );

    itsInputSource =
        new SCComponentMenu(circuit, SCACSourceFilter, "Input source:", window,
                            JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 150,30);
    assert( itsInputSource != NULL );

    itsDepSource =
        new SCComponentMenu(circuit, SCDepSourceFilter, "Dependent source:", window,
                            JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 150,30);
    assert( itsDepSource != NULL );

    itsEvalButton =
        new JXTextButton(JGetString("itsEvalButton::SCFeedbackDirector::JXLayout"), window,
                         JXWidget::kFixedRight, JXWidget::kFixedTop, 230,20, 80,20);
    assert( itsEvalButton != NULL );

    JXStaticText* layoutMessage =
        new JXStaticText(JGetString("layoutMessage::SCFeedbackDirector::JXLayout"), window,
                         JXWidget::kFixedRight, JXWidget::kFixedTop, 240,50, 110,60);
    assert( layoutMessage != NULL );

// end JXLayout

    const JCoordinate kMinWindowWidth = window->GetBoundsWidth();

    window->SetTitle("Feedback Theorem");
    window->SetMinSize(kMinWindowWidth, window->GetBoundsHeight());

    layoutMessage->SetText(
        "Output fn\nH0  |  Hinf\n T   |  Tn\nScratch area");

    itsInputSource->SetToPopupChoice(kJTrue);
    itsDepSource->SetToPopupChoice(kJTrue);

    ListenTo(itsEvalButton);

    // create sub-partitions

    const JCoordinate w =
        (itsMainPartition->GetBoundsWidth() - JPartition::kDragRegionSize)/2;
    JArray<JCoordinate> widths(2);
    widths.AppendElement(w);
    widths.AppendElement(w);

    const JCoordinate wMin = (kMinWindowWidth - JPartition::kDragRegionSize)/2;
    JArray<JCoordinate> minWidths(2);
    minWidths.AppendElement(wMin);
    minWidths.AppendElement(wMin);

    JXContainer* encl = itsMainPartition->GetCompartment(2);
    itsHPartition =
        new JXHorizPartition(widths, 0, minWidths, encl,
                             JXWidget::kHElastic, JXWidget::kVElastic,
                             0,0, encl->GetBoundsWidth(), encl->GetBoundsHeight());
    assert( itsHPartition != NULL );

    encl = itsMainPartition->GetCompartment(3);
    itsTPartition =
        new JXHorizPartition(widths, 0, minWidths, encl,
                             JXWidget::kHElastic, JXWidget::kVElastic,
                             0,0, encl->GetBoundsWidth(), encl->GetBoundsHeight());
    assert( itsTPartition != NULL );

    // create expressions

    SCExprEditorSet* exprSet =
        new SCExprEditorSet(doc, &itsOutputFn,
                            itsMainPartition->GetCompartment(1),
                            JXWidget::kHElastic, JXWidget::kVElastic,
                            0,0, 100,100);
    assert( exprSet != NULL );
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:SCFeedbackDirector.cpp

示例12: JXWindow

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);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:85,代码来源:JXTipOfTheDayDialog.cpp

示例13: JXWindow

void
JXRadioGroupDialog::BuildWindow
	(
	const JCharacter*			windowTitle,
	const JCharacter*			prompt,
	const JPtrArray<JString>&	choiceList,
	const JPtrArray<JString>*	shortcutList
	)
{
JIndex i;

	const JSize actionCount = choiceList.GetElementCount();

	JXWindow* window = new JXWindow(this, 10,10, windowTitle);
	assert( window != NULL );

	JCoordinate y = kFirstItemTop;

	// instructions

	JXStaticText* instrText =
		new JXStaticText(prompt, window,
						 JXWidget::kFixedLeft, JXWidget::kFixedTop,
						 kHMarginWidth,y, 0,0);
	assert( instrText != NULL );

	y += instrText->GetFrameHeight() + kItemVDelta;

	// radio group

	const JCoordinate kInitRGWidth = 10;	// arbitrary, >0

	itsRG =
		new JXRadioGroup(window, JXWidget::kFixedLeft, JXWidget::kFixedTop,
						 kHMarginWidth,y,
						 kInitRGWidth, kItemVDelta + actionCount * kItemVSeparation);
	assert( itsRG != NULL );

	// choices

	JCoordinate wmin = 0;
	JPtrArray<JXRadioButton> buttonList(JPtrArrayT::kForgetAll, actionCount);
	for (i=1; i<=actionCount; i++)
		{
		JXTextRadioButton* button =
			new JXTextRadioButton(i, *(choiceList.NthElement(i)), itsRG,
								  JXWidget::kFixedLeft, JXWidget::kFixedTop,
								  kRGHLMarginWidth, kItemVDelta + (i-1) * kItemVSeparation,
								  10,kTextHeight);
		assert( button != NULL );

		if (shortcutList != NULL)
			{
			button->SetShortcuts(*(shortcutList->NthElement(i)));
			}

		buttonList.Append(button);
		wmin = JMax(button->GetPreferredWidth(), wmin);
		}

	// all choices should be the same width

	for (i=1; i<=actionCount; i++)
		{
		(buttonList.NthElement(i))->SetSize(wmin, kTextHeight);
		}

	wmin += kRGHLMarginWidth + kRGHRMarginWidth;
	itsRG->AdjustSize(wmin - kInitRGWidth, 0);

	const JCoordinate wminInstr = instrText->GetFrameWidth();
	if (wmin < wminInstr)
		{
		const JCoordinate delta = (wminInstr - wmin)/2;
		itsRG->Move(delta, 0);
		wmin = wminInstr;
		}

	y = (itsRG->GetFrame()).bottom + kRGButtonVDelta;

	// OK and Cancel buttons

	wmin += 2*kHMarginWidth;
	const JCoordinate wminButton = 3*kMinButtonHMargin + 2*kButtonWidth;
	if (wmin < wminButton)
		{
		const JCoordinate delta = (wminButton - wmin)/2;
		instrText->Move(delta, 0);
		itsRG->Move(delta, 0);
		wmin = wminButton;
		}

	const JCoordinate buttonX = (wmin - 2*kButtonWidth)/3;

	JXTextButton* cancelButton =
		new JXTextButton("Cancel", window,
						 JXWidget::kFixedLeft, JXWidget::kFixedTop,
						 buttonX,y, kButtonWidth,kTextHeight);
	assert( cancelButton != NULL );

//.........这里部分代码省略.........
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:101,代码来源:JXRadioGroupDialog.cpp

示例14: JXWindow

void
CMArray1DDir::BuildWindow()
{
// begin JXLayout

	JXWindow* window = jnew JXWindow(this, 300,500, "");
	assert( window != NULL );

	itsExprInput =
		jnew CMArrayExprInput(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 110,40, 170,20);
	assert( itsExprInput != NULL );

	JXStaticText* startLabel =
		jnew JXStaticText(JGetString("startLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,70, 90,20);
	assert( startLabel != NULL );
	startLabel->SetToLabel();

	JXStaticText* endLabel =
		jnew JXStaticText(JGetString("endLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,100, 90,20);
	assert( endLabel != NULL );
	endLabel->SetToLabel();

	itsStopButton =
		jnew JXTextButton(JGetString("itsStopButton::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 200,85, 60,20);
	assert( itsStopButton != NULL );
	itsStopButton->SetShortcuts(JGetString("itsStopButton::CMArray1DDir::shortcuts::JXLayout"));

	JXMenuBar* menuBar =
		jnew JXMenuBar(window,
					JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 300,30);
	assert( menuBar != NULL );

	JXScrollbarSet* scrollbarSet =
		jnew JXScrollbarSet(window,
					JXWidget::kHElastic, JXWidget::kVElastic, 0,130, 300,370);
	assert( scrollbarSet != NULL );

	itsStartIndex =
		jnew CMArrayIndexInput(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,70, 60,20);
	assert( itsStartIndex != NULL );

	itsEndIndex =
		jnew CMArrayIndexInput(window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,100, 60,20);
	assert( itsEndIndex != NULL );

	JXStaticText* exprLabel =
		jnew JXStaticText(JGetString("exprLabel::CMArray1DDir::JXLayout"), window,
					JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,40, 90,20);
	assert( exprLabel != NULL );
	exprLabel->SetToLabel();

// end JXLayout

	window->SetMinSize(300, 200);
	window->ShouldFocusWhenShow(kJTrue);
	window->SetWMClass(CMGetWMClassInstance(), CMGetArray1DWindowClass());

	UpdateWindowTitle();

	JXDisplay* display = GetDisplay();
	JXImage* icon      = jnew JXImage(display, medic_1d_array_window);
	assert( icon != NULL );
	window->SetIcon(icon);

	CMGetPrefsManager()->GetWindowSize(kArray1DWindSizeID, window, kJTrue);

	CMVarNode* root = itsLink->CreateVarNode();
	assert( root != NULL );
	itsTree = jnew JTree(root);
	assert( itsTree != NULL );
	JNamedTreeList* treeList = jnew JNamedTreeList(itsTree);
	assert( treeList != NULL );

	itsWidget =
		jnew CMVarTreeWidget(itsCommandDir, kJFalse, menuBar, itsTree, treeList,
							scrollbarSet, scrollbarSet->GetScrollEnclosure(),
							JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
	assert(itsWidget != NULL);
	itsWidget->FitToEnclosure();

	itsExprInput->SetText(itsExpr);
	itsExprInput->SetIsRequired();
	ListenTo(itsExprInput);

	itsStartIndex->SetValue(itsRequestRange.first);
	ListenTo(itsStartIndex);

	itsEndIndex->SetValue(itsRequestRange.last);
	ListenTo(itsEndIndex);

	itsStopButton->Hide();
	ListenTo(itsStopButton);

	// menus
//.........这里部分代码省略.........
开发者ID:jafl,项目名称:jx_application_framework,代码行数:101,代码来源:CMArray1DDir.cpp

示例15: JXWindow

void
JXHintDirector::BuildWindow
	(
	const JRect&		frameR,
	const JCharacter*	text
	)
{
	// create window and contents

	JXWindow* window = jnew JXWindow(this, 10,10, "", kJTrue);
	assert( window != NULL );

	window->SetWMWindowType(JXWindow::kWMTooltipType);

	JXBorderRect* border =
		jnew JXBorderRect(window, JXWidget::kHElastic, JXWidget::kVElastic,
						 0,0, 10,10);
	assert( border != NULL );
	border->FitToEnclosure();

	JXStaticText* textWidget =
		jnew JXStaticText(text, border,
						 JXWidget::kFixedLeft, JXWidget::kFixedTop,
						 kHMargin, kVMargin, 0,0);
	assert( textWidget != NULL );

	JCoordinate ascent = 0, descent = 0;
	if (!JStringEmpty(text))
		{
		(textWidget->GetFont(1)).GetLineHeight(&ascent, &descent);
		}

	const JCoordinate w = 2*kHMargin + textWidget->GetFrameWidth();
	const JCoordinate h = 2*kVMargin + ascent + descent;
	window->SetSize(w,h);

	// place window

	const JRect rootBounds = GetDisplay()->GetBounds();

	JCoordinate x = frameR.left + 1;
	JCoordinate y = frameR.bottom + 1;

	if (x + w > rootBounds.right)
		{
		x = rootBounds.right - w - 1;
		}
	if (x < 0)
		{
		x = rootBounds.left + 1;
		}

	if (y + h > rootBounds.bottom)
		{
		y = frameR.top - h - 1;
		}

	window->Place(x,y);

	// use standard background color

	JColorIndex backColorIndex = GetColormap()->JColormap::GetColor(kBackColor);
	window->SetBackColor(backColorIndex);
	border->SetBackColor(backColorIndex);
	textWidget->SetBackgroundColor(backColorIndex);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:66,代码来源:JXHintDirector.cpp


注:本文中的JXStaticText类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。