本文整理汇总了C++中JXWindow::ShouldFocusWhenShow方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::ShouldFocusWhenShow方法的具体用法?C++ JXWindow::ShouldFocusWhenShow怎么用?C++ JXWindow::ShouldFocusWhenShow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::ShouldFocusWhenShow方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindow
void
JXDialogDirector::Activate()
{
if (!IsActive())
{
assert( !itsModalFlag || itsOKButton != NULL );
JXWindow* window = GetWindow();
assert( window != NULL );
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->ShouldFocusWhenShow(kJTrue);
JXDirector* supervisor = GetSupervisor();
if (supervisor->IsWindowDirector())
{
JXWindowDirector* windowDir =
dynamic_cast(JXWindowDirector*, supervisor);
assert( windowDir != NULL );
window->SetTransientFor(windowDir);
}
示例2: JXTextButton
//.........这里部分代码省略.........
new JXStaticText(JGetString("obj9_JXLayout::JXWMainDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,160, 120,20);
assert( obj9_JXLayout != NULL );
obj9_JXLayout->SetToLabel();
JXStaticText* obj10_JXLayout =
new JXStaticText(JGetString("obj10_JXLayout::JXWMainDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,110, 120,20);
assert( obj10_JXLayout != NULL );
obj10_JXLayout->SetToLabel();
itsCompanyName =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,110, 350,20);
assert( itsCompanyName != NULL );
itsDevURL =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,130, 350,20);
assert( itsDevURL != NULL );
itsBinaryName =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,160, 350,20);
assert( itsBinaryName != NULL );
itsSrcPrefix =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,180, 350,20);
assert( itsSrcPrefix != NULL );
itsProjectDir =
new JXPathInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,240, 290,20);
assert( itsProjectDir != NULL );
itsTemplateDir =
new JXPathInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,270, 260,20);
assert( itsTemplateDir != NULL );
itsTmplDirHistory =
new JXPathHistoryMenu(kHistoryLength, "", window,
JXWidget::kHElastic, JXWidget::kFixedTop, 450,270, 30,20);
assert( itsTmplDirHistory != NULL );
JXStaticText* obj11_JXLayout =
new JXStaticText(JGetString("obj11_JXLayout::JXWMainDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,300, 120,20);
assert( obj11_JXLayout != NULL );
obj11_JXLayout->SetToLabel();
itsOpenCmd =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 130,300, 350,20);
assert( itsOpenCmd != NULL );
// end JXLayout
const JCharacter* map[] =
{
"vers", JXWGetVersionNumberStr()
};
const JString title = JGetString(kWindowTitleID, map, sizeof(map));
window->SetTitle(title);
window->ShouldFocusWhenShow(kJTrue);
window->PlaceAsDialogWindow();
window->LockCurrentMinSize();
ListenTo(itsCreateButton);
ListenTo(itsQuitButton);
ListenTo(itsHelpButton);
ListenTo(itsChooseProjDirButton);
ListenTo(itsChooseTmplDirButton);
ListenTo(itsTmplDirHistory);
itsProgramVersion->SetText("1.0.0");
itsDevURL->SetText(kDefaultURLText);
itsNeedsMDICB->SetState(kJTrue);
itsProjectDir->ShouldAllowInvalidPath();
itsProjectDir->ShouldRequireWritable();
itsProjectDir->SetText(kDefaultProjDir);
itsTemplateDir->ShouldAllowInvalidPath();
itsTemplateDir->SetText(kDefaultTemplateDir);
itsOpenCmd->SetText(kDefaultOpenCmd);
JPrefObject::ReadPrefs();
// after read prefs to overwrite itsProjectDir
if (argc == 3)
{
itsProjectDir->SetText(argv[1]);
itsProgramName->SetText(argv[2]);
itsBinaryName->SetText(argv[2]);
}
}
示例3: JXDownRect
void
JXSearchTextDialog::SetObjects
(
JXInputField* searchInput,
JXStringHistoryMenu* prevSearchMenu,
JXTextCheckbox* ignoreCaseCB,
JXTextCheckbox* entireWordCB,
JXTextCheckbox* wrapSearchCB,
JXTextCheckbox* searchIsRegexCB,
JXTextCheckbox* singleLineCB,
JXInputField* replaceInput,
JXStringHistoryMenu* prevReplaceMenu,
JXTextCheckbox* replaceIsRegexCB,
JXTextCheckbox* preserveCaseCB,
JXTextCheckbox* stayOpenCB,
JXTextCheckbox* retainFocusCB,
JXSearchTextButton* findFwdButton,
JXSearchTextButton* findBackButton,
JXTextButton* replaceButton,
JXSearchTextButton* replaceFindFwdButton,
JXSearchTextButton* replaceFindBackButton,
JXSearchTextButton* replaceAllFwdButton,
JXSearchTextButton* replaceAllBackButton,
JXTextButton* replaceAllInSelButton,
JXTextButton* closeButton,
JXTextButton* helpButton,
JXTextButton* qRefButton
)
{
JXWindow* window = searchInput->GetWindow();
window->SetTitle("Search text");
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->PlaceAsDialogWindow();
window->LockCurrentMinSize();
window->ShouldFocusWhenShow(kJTrue);
ListenTo(window);
itsSearchInput = searchInput;
itsPrevSearchMenu = prevSearchMenu;
itsIgnoreCaseCB = ignoreCaseCB;
itsEntireWordCB = entireWordCB;
itsWrapSearchCB = wrapSearchCB;
itsSearchIsRegexCB = searchIsRegexCB;
itsSingleLineCB = singleLineCB;
itsReplaceInput = replaceInput;
itsPrevReplaceMenu = prevReplaceMenu;
itsReplaceIsRegexCB = replaceIsRegexCB;
itsPreserveCaseCB = preserveCaseCB;
itsStayOpenCB = stayOpenCB;
itsRetainFocusCB = retainFocusCB;
itsFindFwdButton = findFwdButton;
itsFindBackButton = findBackButton;
itsReplaceButton = replaceButton;
itsReplaceFindFwdButton = replaceFindFwdButton;
itsReplaceFindBackButton = replaceFindBackButton;
itsReplaceAllFwdButton = replaceAllFwdButton;
itsReplaceAllBackButton = replaceAllBackButton;
itsReplaceAllInSelButton = replaceAllInSelButton;
itsCloseButton = closeButton;
itsHelpButton = helpButton;
itsQRefButton = qRefButton;
SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize);
// decor
const JRect wFrame = window->GetFrame();
const JRect soFrame = itsStayOpenCB->GetFrame();
JXDownRect* line =
new JXDownRect(window, JXWidget::kFixedLeft, JXWidget::kFixedTop,
soFrame.left, soFrame.top-6,
wFrame.right-10-soFrame.left, 2);
assert( line != NULL );
line->SetBorderWidth(1);
// shortcuts
itsCloseButton->SetShortcuts("#W^[");
itsIgnoreCaseCB->SetShortcuts("#I");
itsWrapSearchCB->SetShortcuts("#S");
itsEntireWordCB->SetShortcuts("#E");
itsSearchIsRegexCB->SetShortcuts("#X");
itsSingleLineCB->SetShortcuts("#T");
itsPreserveCaseCB->SetShortcuts("#P");
if (JXMenu::GetDefaultStyle() == JXMenu::kMacintoshStyle)
{
itsFindFwdButton->SetShortcuts("#G");
itsFindFwdButton->SetHint("Return / Meta-G");
itsFindBackButton->SetHint("Shift-Return / Meta-Shift-G");
//.........这里部分代码省略.........
示例4: JXMenuBar
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;
//.........这里部分代码省略.........
示例5: JXTextButton
void
THXBaseConvDirector::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 300,130, "");
assert( window != NULL );
SetWindow(window);
itsCloseButton =
new JXTextButton("Close", window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 180,100, 60,20);
assert( itsCloseButton != NULL );
itsCloseButton->SetShortcuts("#W^[");
itsFromValue =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 110,20, 70,20);
assert( itsFromValue != NULL );
JXStaticText* obj1 =
new JXStaticText("Convert from:", window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 90,20);
assert( obj1 != NULL );
itsHelpButton =
new JXTextButton("Help", window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 60,100, 60,20);
assert( itsHelpButton != NULL );
itsFromBase =
new THXBaseConvMenu(window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 190,15, 90,30);
assert( itsFromBase != NULL );
JXStaticText* obj2 =
new JXStaticText("Result:", window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 90,20);
assert( obj2 != NULL );
itsToBase =
new THXBaseConvMenu(window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 190,55, 90,30);
assert( itsToBase != NULL );
itsToValue =
new JXStaticText("", kJFalse, kJTrue, NULL, window,
JXWidget::kHElastic, JXWidget::kFixedTop, 110,60, 70,20);
assert( itsToValue != NULL );
// end JXLayout
window->SetTitle("Base Conversion");
window->SetWMClass(THXGetWMClassInstance(), THXGetBaseConvWindowClass());
window->LockCurrentMinSize();
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->ShouldFocusWhenShow(kJTrue);
window->PlaceAsDialogWindow();
JXDisplay* display = GetDisplay();
JXImage* icon = new JXImage(display, display->GetColormap(), thx_base_conv_window);
assert( icon != NULL );
window->SetIcon(icon);
itsFromValue->ShouldBroadcastAllTextChanged(kJTrue); // want every keypress
ListenTo(itsFromValue);
ListenTo(itsFromBase);
ListenTo(itsToBase);
ListenTo(itsCloseButton);
ListenTo(itsHelpButton);
}
示例6: JXRadioGroup
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());
//.........这里部分代码省略.........
示例7: JXMenuBar
void
CMLocalVarsDir::BuildWindow()
{
// begin JXLayout
JXWindow* window = jnew JXWindow(this, 450,500, "");
assert( window != NULL );
JXMenuBar* menuBar =
jnew JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 450,30);
assert( menuBar != NULL );
JXScrollbarSet* scrollbarSet =
jnew JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 450,470);
assert( scrollbarSet != NULL );
// end JXLayout
window->SetTitle(kWindowTitleSuffix);
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->SetMinSize(150, 150);
window->ShouldFocusWhenShow(kJTrue);
window->SetWMClass(CMGetWMClassInstance(), CMGetVariableWindowClass());
CMGetPrefsManager()->GetWindowSize(kLocalVarWindSizeID, window);
JXDisplay* display = GetDisplay();
JXImage* icon = jnew JXImage(display, medic_local_variables_window);
assert( icon != NULL );
window->SetIcon(icon);
CMVarNode* root = itsLink->CreateVarNode(kJFalse);
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();
itsGetLocalsCmd = itsLink->CreateGetLocalVars(root);
// menus
itsFileMenu = menuBar->PrependTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr, "CMThreadsDir");
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);
itsActionMenu = menuBar->AppendTextMenu(kActionMenuTitleStr);
menuBar->InsertMenu(3, itsActionMenu);
itsActionMenu->SetMenuItems(kActionMenuStr, "CMLocalVarsDir");
ListenTo(itsActionMenu);
itsActionMenu->SetItemImage(kDisplay1DArrayCmd, medic_show_1d_array);
itsActionMenu->SetItemImage(kPlot1DArrayCmd, medic_show_2d_plot);
itsActionMenu->SetItemImage(kDisplay2DArrayCmd, medic_show_2d_array);
itsActionMenu->SetItemImage(kExamineMemCmd, medic_show_memory);
JXWDMenu* wdMenu =
jnew JXWDMenu(kWindowsMenuTitleStr, menuBar,
JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
assert( wdMenu != NULL );
menuBar->AppendMenu(wdMenu);
itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
itsHelpMenu->SetMenuItems(kHelpMenuStr, "CMLocalVarsDir");
itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHelpMenu);
itsHelpMenu->SetItemImage(kTOCCmd, jx_help_toc);
itsHelpMenu->SetItemImage(kThisWindowCmd, jx_help_specific);
}
示例8: JXTextButton
void
SyGViewManPageDialog::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 360,150, "");
assert( window != NULL );
itsCloseButton =
new JXTextButton(JGetString("itsCloseButton::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 120,120, 60,20);
assert( itsCloseButton != NULL );
itsCloseButton->SetShortcuts(JGetString("itsCloseButton::SyGViewManPageDialog::shortcuts::JXLayout"));
itsViewButton =
new JXTextButton(JGetString("itsViewButton::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 280,120, 60,20);
assert( itsViewButton != NULL );
itsViewButton->SetShortcuts(JGetString("itsViewButton::SyGViewManPageDialog::shortcuts::JXLayout"));
itsFnName =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 290,20);
assert( itsFnName != NULL );
JXStaticText* obj1_JXLayout =
new JXStaticText(JGetString("obj1_JXLayout::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 100,20);
assert( obj1_JXLayout != NULL );
obj1_JXLayout->SetToLabel();
JXStaticText* obj2_JXLayout =
new JXStaticText(JGetString("obj2_JXLayout::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,80, 90,20);
assert( obj2_JXLayout != NULL );
obj2_JXLayout->SetToLabel();
itsAproposCheckbox =
new JXTextCheckbox(JGetString("itsAproposCheckbox::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 210,80, 80,20);
assert( itsAproposCheckbox != NULL );
itsAproposCheckbox->SetShortcuts(JGetString("itsAproposCheckbox::SyGViewManPageDialog::shortcuts::JXLayout"));
itsHelpButton =
new JXTextButton(JGetString("itsHelpButton::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 200,120, 60,20);
assert( itsHelpButton != NULL );
itsHelpButton->SetShortcuts(JGetString("itsHelpButton::SyGViewManPageDialog::shortcuts::JXLayout"));
itsFnHistoryMenu =
new JXStringHistoryMenu(kHistoryLength, "", window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 310,40, 30,20);
assert( itsFnHistoryMenu != NULL );
itsManIndex =
new JXCharInput(window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 110,80, 30,20);
assert( itsManIndex != NULL );
itsStayOpenCB =
new JXTextCheckbox(JGetString("itsStayOpenCB::SyGViewManPageDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,120, 90,20);
assert( itsStayOpenCB != NULL );
// end JXLayout
window->SetTitle("Man pages");
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->PlaceAsDialogWindow();
window->LockCurrentMinSize();
window->ShouldFocusWhenShow(kJTrue);
ListenTo(itsViewButton);
ListenTo(itsCloseButton);
ListenTo(itsHelpButton);
ListenTo(itsFnHistoryMenu);
itsFnName->ShouldBroadcastAllTextChanged(kJTrue);
itsFnName->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord);
ListenTo(itsFnName);
itsManIndex->SetIsRequired(kJFalse);
itsStayOpenCB->SetState(kJTrue);
UpdateDisplay();
}
示例9: CMArrayExprInput
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
//.........这里部分代码省略.........
示例10: JXMenuBar
void
GAddressBookTreeDir::BuildWindow()
{
JCoordinate w = 300;
JCoordinate minW = 250;
JCoordinate h = 500;
JCoordinate minH = 250;
JXWindow* window = new JXWindow(this, w,h, "Addresses");
assert( window != NULL );
window->SetWMClass(GMGetWMClassInstance(), GMGetAddressBookWindowClass());
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->PlaceAsDialogWindow();
window->ShouldFocusWhenShow(kJTrue);
//window->SetMinSize(200, 300);
//window->LockCurrentMinSize();
JXMenuBar* menuBar =
new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, w - kCloseButtonWidth,kJXDefaultMenuBarHeight);
assert( menuBar != NULL );
itsCloseButton =
new JXTextButton("Close", window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
w - kCloseButtonWidth,0,
kCloseButtonWidth,kJXDefaultMenuBarHeight);
assert( itsCloseButton != NULL );
itsCloseButton->SetShortcuts("#W"); //^[
ListenTo(itsCloseButton);
itsToolBar =
new JXToolBar(GGetPrefsMgr(), kGAddressToolBarID,
menuBar, minW, minH, window,
JXWidget::kHElastic, JXWidget::kVElastic,
0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
assert(itsToolBar != NULL);
const JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic,JXWidget::kVElastic,
0, 0,
w, newHeight);
assert( scrollbarSet != NULL );
JNamedTreeNode* base = new JNamedTreeNode(NULL, "");
assert(base != NULL);
itsTree = new JTree(base);
assert(itsTree != NULL);
JNamedTreeList* list = new JNamedTreeList(itsTree);
itsWidget =
new GAddressBookTreeWidget(itsTree, list, menuBar,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,w,newHeight);
assert(itsWidget != NULL);
GMDirectorMenu* menu =
new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
assert(menu != NULL);
menuBar->AppendMenu(menu);
itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
itsHelpMenu->SetMenuItems(kHelpMenuStr);
itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHelpMenu);
itsHelpMenu->SetItemImage(kTOCCmd, JXPM(jx_help_toc));
itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));
itsToolBar->LoadPrefs();
if (itsToolBar->IsEmpty())
{
itsWidget->AddDefaultButtcons(itsToolBar);
itsToolBar->AppendButton(itsHelpMenu, kTOCCmd);
itsToolBar->AppendButton(itsHelpMenu, kThisWindowCmd);
}
itsMenuIcon = new JXImage(window->GetDisplay(), address_entry);
assert(itsMenuIcon != NULL);
itsMenuIcon->ConvertToRemoteStorage();
}
示例11: JXMenuBar
void
GMailboxTreeDir::BuildWindow()
{
JCoordinate w = 360;
JCoordinate h = 500;
JXWindow* window = new JXWindow(this, w,h, "Mailbox window");
assert( window != NULL );
window->SetWMClass(GMGetWMClassInstance(), GMGetMailboxWindowClass());
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->PlaceAsDialogWindow();
window->ShouldFocusWhenShow(kJTrue);
window->LockCurrentMinSize();
JXMenuBar* menuBar =
new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, w - kCloseButtonWidth,kJXDefaultMenuBarHeight);
assert( menuBar != NULL );
itsCloseButton =
new JXTextButton("Close", window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
w - kCloseButtonWidth,0,
kCloseButtonWidth,kJXDefaultMenuBarHeight);
assert( itsCloseButton != NULL );
itsCloseButton->SetShortcuts("#W"); //^[
ListenTo(itsCloseButton);
itsToolBar =
new JXToolBar(GGetPrefsMgr(), kGMailboxToolBarID,
menuBar, w, h, window,
JXWidget::kHElastic, JXWidget::kVElastic,
0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
assert(itsToolBar != NULL);
itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr);
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
GMPOPRetrieverMenu* popmenu =
new GMPOPRetrieverMenu(itsFileMenu, kCheckAccountCmd, menuBar);
assert(popmenu != NULL);
itsFileMenu->SetItemImage(kNewCmd, filenew);
itsFileMenu->SetItemImage(kOpenCmd, fileopen);
itsFileMenu->SetItemImage(kCheckMailCmd, check_mail);
const JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic,JXWidget::kVElastic,
0, 0,
w, newHeight);
assert( scrollbarSet != NULL );
GMTreeRootNode* base = new GMTreeRootNode();
assert(base != NULL);
JDirInfo* info;
if (base->GetDirInfo(&info))
{
JString regex("^$|");
regex += GMGetMailRegexStr();
info->SetContentFilter(regex);
}
itsTree = new GMFileTree(base);
assert(itsTree != NULL);
JNamedTreeList* list = new JNamedTreeList(itsTree);
itsWidget =
new GMailboxTreeWidget(itsTree, list, menuBar,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,w,newHeight);
assert(itsWidget != NULL);
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);
itsHelpMenu->SetItemImage(kTOCCmd, JXPM(jx_help_toc));
itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));
itsToolBar->LoadPrefs();
if (itsToolBar->IsEmpty())
//.........这里部分代码省略.........