本文整理汇总了C++中JXWindow::SetWMClass方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::SetWMClass方法的具体用法?C++ JXWindow::SetWMClass怎么用?C++ JXWindow::SetWMClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::SetWMClass方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXHorizDockPartition
void
JXDockDirector::BuildWindow
(
const JCharacter* title,
const JBoolean splitHoriz
)
{
const JCoordinate kSize = 300;
JArray<JCoordinate> sizes;
sizes.AppendElement(kSize);
sizes.AppendElement(kSize);
JArray<JCoordinate> minSizes;
minSizes.AppendElement(JXDockWidget::kDefaultMinSize);
minSizes.AppendElement(JXDockWidget::kDefaultMinSize);
const JCoordinate w = 2*kSize + (splitHoriz ? JPartition::kDragRegionSize : 0);
const JCoordinate h = 2*kSize + (splitHoriz ? 0 : JPartition::kDragRegionSize);
JXWindow* window = jnew JXWindow(this, w, h, title);
assert( window != NULL );
JXImage* icon;
if ((JXGetDockManager())->CreateIcon(&icon))
{
window->SetIcon(icon);
}
if (splitHoriz)
{
itsHorizPartition =
jnew JXHorizDockPartition(this, NULL, sizes, 0, minSizes,
window, JXWidget::kHElastic, JXWidget::kVElastic,
0,0, w,h);
assert( itsHorizPartition != NULL );
}
else
{
itsVertPartition =
jnew JXVertDockPartition(this, NULL, sizes, 0, minSizes,
window, JXWidget::kHElastic, JXWidget::kVElastic,
0,0, w,h);
assert( itsVertPartition != NULL );
}
window->SetMinSize(100,100);
window->SetWMClass("Dock", JXGetDockWindowClass());
}
示例2: JXMenuBar
void
GPMMainDirector::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 530,350, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 540,30);
assert( menuBar != NULL );
itsToolBar =
new JXToolBar(GPMGetPrefsManager(), kGPMMainToolBarID, menuBar, 540, 250, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 530,300);
assert( itsToolBar != NULL );
itsFullCmdDisplay =
new JXStaticText("", kJFalse, kJTrue, NULL, window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 0,330, 530,20);
assert( itsFullCmdDisplay != NULL );
// end JXLayout
window->SetTitle("Drakon Process Manager");
window->SetCloseAction(JXWindow::kQuitApp);
window->SetWMClass(GPMGetWMClassInstance(), GPMGetMainWindowClass());
JXImage* image = new JXImage(GetDisplay(), gpm_main_window_icon);
assert( image != NULL );
window->SetIcon(image);
// system stats
itsSystemStats =
new GPMSystemStats(itsProcessList, itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic, JXWidget::kFixedTop,
0,kStatusMargin, 100,kStatusHeight);
assert( itsSystemStats != NULL );
itsSystemStats->FitToEnclosure(kJTrue, kJFalse);
// tab group
itsTabGroup =
new JXTabGroup(itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( itsTabGroup != NULL );
itsTabGroup->FitToEnclosure();
ListenTo(itsTabGroup->GetCardEnclosure());
const JCoordinate statusHeight = kStatusHeight + 2*kStatusMargin;
itsTabGroup->AdjustSize(0, -statusHeight);
itsTabGroup->Move(0, statusHeight);
JXWidgetSet* listTab = itsTabGroup->AppendTab("List");
JXWidgetSet* treeTab = itsTabGroup->AppendTab("Tree");
// list view
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(listTab, JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( scrollbarSet != NULL );
scrollbarSet->FitToEnclosure();
const JCoordinate kHeaderHeight = 25;
const JCoordinate tableHeight = scrollbarSet->GetScrollEnclosure()->GetBoundsHeight() - kHeaderHeight;
itsProcessTable =
new GPMProcessTable(itsProcessList, itsFullCmdDisplay,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,kHeaderHeight, 100,tableHeight);
assert( itsProcessTable != NULL );
itsProcessTable->FitToEnclosure(kJTrue, kJFalse);
GPMListHeaderWidget* tableHeader =
new GPMListHeaderWidget(itsProcessTable, itsProcessList,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, 100,kHeaderHeight);
assert( tableHeader != NULL );
tableHeader->FitToEnclosure(kJTrue, kJFalse);
// tree view
scrollbarSet =
new JXScrollbarSet(treeTab, JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( scrollbarSet != NULL );
scrollbarSet->FitToEnclosure();
JNamedTreeList* treeList = new JNamedTreeList(itsProcessList->GetProcessTree());
assert( treeList != NULL );
itsProcessTree =
new GPMProcessTreeList(itsProcessList, treeList, itsFullCmdDisplay,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
//.........这里部分代码省略.........
示例3: 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;
//.........这里部分代码省略.........
示例4: 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);
}
示例5: JXMenuBar
void
CMSourceDirector::BuildWindow()
{
const JIndex prefID = itsType == kMainSourceType ? kMainSrcToolBarID :
itsType == kMainAsmType ? kMainAsmToolBarID :
itsType == kAsmType ? kOtherAsmToolBarID :
kOtherSrcToolBarID;
// begin JXLayout
JXWindow* window = jnew JXWindow(this, 600,550, "");
assert( window != NULL );
itsMenuBar =
jnew JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 600,30);
assert( itsMenuBar != NULL );
itsToolBar =
jnew JXToolBar(CMGetPrefsManager(), prefID, itsMenuBar, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,500);
assert( itsToolBar != NULL );
itsFileDisplay =
jnew JXFileNameDisplay("", window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 20,530, 580,20);
assert( itsFileDisplay != NULL );
CMFileDragSource* dragSource =
jnew CMFileDragSource(this, window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 0,530, 20,20);
assert( dragSource != NULL );
// end JXLayout
window->SetTitle(JGetString(
itsType == kMainAsmType ? "InitAsmWindowTitle::CMSourceDirector" :
"InitSourceWindowTitle::CMSourceDirector"));
window->SetMinSize(300, 200);
if (itsType == kMainSourceType)
{
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->SetWMClass(CMGetWMClassInstance(), CMGetMainSourceWindowClass());
CMGetPrefsManager()->GetWindowSize(kMainCodeWindSizeID, window);
JXDisplay* display = GetDisplay();
JXImage* icon = jnew JXImage(display, medic_current_source_window);
assert( icon != NULL );
window->SetIcon(icon);
}
else if (itsType == kMainAsmType)
{
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->SetWMClass(CMGetWMClassInstance(), CMGetMainAsmWindowClass());
CMGetPrefsManager()->GetWindowSize(kMainAsmWindSizeID, window);
JXDisplay* display = GetDisplay();
JXImage* icon = jnew JXImage(display, medic_current_asm_window);
assert( icon != NULL );
window->SetIcon(icon);
}
else if (itsType == kAsmType)
{
window->SetWMClass(CMGetWMClassInstance(), CMGetAsmViewWindowClass());
CMGetPrefsManager()->GetWindowSize(kAsmWindSizeID, window, kJTrue);
}
else
{
window->SetWMClass(CMGetWMClassInstance(), CMGetSourceViewWindowClass());
CMGetPrefsManager()->GetWindowSize(kCodeWindSizeID, window, kJTrue);
}
JCoordinate w = window->GetFrameWidth();
itsFileMenu = itsMenuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr, "CMSourceDirector");
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);
itsFileMenu->SetItemImage(kPrintCmd, jx_file_print);
// appends Edit & Search menus
const JCoordinate kInitTableWidth = 50;
JXScrollbarSet* scrollbarSet =
jnew JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
assert( scrollbarSet != NULL );
scrollbarSet->FitToEnclosure();
JXContainer* encl = scrollbarSet->GetScrollEnclosure();
itsText =
jnew CMSourceText(this, itsCommandDir, itsMenuBar, scrollbarSet, encl,
//.........这里部分代码省略.........
示例6: JXTextButton
//.........这里部分代码省略.........
{
itsProcess = NULL;
itsRecordLink = NULL;
itsDataLink = NULL;
itsCmdStream = NULL;
itsReceivedDataFlag = kJFalse;
itsProcessPausedFlag = kJFalse;
itsClearWhenStartFlag = kJTrue;
itsUseCount = 0;
itsDontCloseMsg = JGetString("WaitCloseMsg::CBExecOutputDocument");
// buttons in upper right
JXWindow* window = GetWindow();
const JRect rect = window->GetBounds();
JXMenuBar* menuBar = GetMenuBar();
const JSize h = menuBar->GetFrameHeight();
const JCoordinate x = (allowStop ? 3 : 2) * kMenuButtonWidth;
itsPauseButton =
jnew JXTextButton(JGetString("PauseLabel::CBExecOutputDocument"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
rect.right - x,0, kMenuButtonWidth,h);
assert( itsPauseButton != NULL );
ListenTo(itsPauseButton);
itsPauseButton->SetShortcuts("^Z");
itsPauseButton->SetHint(JGetString("PauseButtonHint::CBExecOutputDocument"));
if (allowStop)
{
itsStopButton =
jnew JXTextButton(JGetString("StopLabel::CBExecOutputDocument"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
rect.right - 2*kMenuButtonWidth,0, kMenuButtonWidth,h);
assert( itsStopButton != NULL );
ListenTo(itsStopButton);
itsStopButton->SetShortcuts("^C#.");
itsStopButton->SetHint(JGetString("StopButtonHint::CBExecOutputDocument"));
}
else
{
itsStopButton = NULL;
}
itsKillButton =
jnew JXTextButton(JGetString("KillLabel::CBExecOutputDocument"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
rect.right - kMenuButtonWidth,0, kMenuButtonWidth,h);
assert( itsKillButton != NULL );
ListenTo(itsKillButton);
if (!allowStop)
{
itsKillButton->SetShortcuts("^C#.");
itsKillButton->SetHint(JGetString("StopButtonHint::CBExecOutputDocument"));
}
menuBar->AdjustSize(-x, 0);
// command line input
JXWidget::HSizingOption hSizing;
JXWidget::VSizingOption vSizing;
GetFileDisplayInfo(&hSizing, &vSizing);
itsCmdPrompt =
jnew JXStaticText(JGetString("CmdPrompt::CBExecOutputDocument"), window,
JXWidget::kFixedLeft, vSizing,
-1000, -1000, 0, 500);
assert( itsCmdPrompt != NULL );
itsCmdPrompt->SetToLabel();
itsCmdPrompt->Hide();
itsCmdInput =
jnew CBCmdLineInput(this, window, hSizing, vSizing,
-1000, -1000, 500, 500);
assert( itsCmdInput != NULL );
itsCmdInput->ShareEditMenu(GetTextEditor());
itsCmdInput->Hide();
itsEOFButton =
jnew JXTextButton(JGetString("EOFButtonTitle::CBExecOutputDocument"), window,
JXWidget::kFixedRight, vSizing,
-1000, -1000, 500, 500);
assert( itsEOFButton != NULL );
itsEOFButton->SetShortcuts("^D");
itsEOFButton->Hide();
ListenTo(itsEOFButton);
JXUrgentTask* task = jnew CBExecOutputPostFTCTask(this);
assert( task != NULL );
task->Go();
GetTextEditor()->SetWritable(kJFalse);
(JXGetDocumentManager())->DocumentMustStayOpen(this, kJTrue);
window->SetWMClass(CBGetWMClassInstance(), CBGetExecOutputWindowClass());
}
示例7: JXMenuBar
void
TestPartitionDirector::BuildWindow()
{
JIndex i;
JArray<JCoordinate> sizes;
JArray<JCoordinate> minSizes;
for (i=1; i<=kInitCompartmentCount; i++)
{
sizes.AppendElement(kInitSize);
minSizes.AppendElement(kMinSize);
}
// begin JXLayout
JXWindow* window = jnew JXWindow(this, 310,340, "");
assert( window != NULL );
JXMenuBar* menuBar =
jnew JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 310,30);
assert( menuBar != NULL );
itsHorizPartition =
jnew JXHorizPartition(sizes, kInitElasticIndex, minSizes, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 310,310);
assert( itsHorizPartition != NULL );
// end JXLayout
itsVertPartition =
jnew JXVertPartition(sizes, kInitElasticIndex, minSizes,
itsHorizPartition->GetCompartment(kInitElasticIndex),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 10,315);
assert( itsVertPartition != NULL );
itsVertPartition->FitToEnclosure(kJTrue, kJTrue);
window->SetTitle("Test Partitions");
window->SetWMClass("testjx", "TestPartitionDirector");
AdjustMinWindowSize();
itsHorizMenu = menuBar->AppendTextMenu(kHorizMenuTitleStr);
itsHorizMenu->SetShortcuts(kHorizMenuShortcuts);
itsHorizMenu->SetMenuItems(kHorizMenuStr);
itsHorizMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHorizMenu);
itsVertMenu = menuBar->AppendTextMenu(kVertMenuTitleStr);
itsVertMenu->SetShortcuts(kVertMenuShortcuts);
itsVertMenu->SetMenuItems(kVertMenuStr);
itsVertMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsVertMenu);
for (i=1; i<=kInitCompartmentCount; i++)
{
if (i != kInitElasticIndex)
{
CreateTestWidget(itsHorizPartition, i);
}
CreateTestWidget(itsVertPartition, i);
}
}
示例8: 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);
}
示例9: JXFontNameMenu
void
TestTabDirector::BuildWindow()
{
JXWindow* window = new JXWindow(this, 300,300, "");
assert( window != NULL );
window->SetTitle("Test Tab Group");
window->SetWMClass("testjx", "TestTabDirector");
window->LockCurrentMinSize();
itsTabGroup = new JXTabGroup(window, JXWidget::kHElastic, JXWidget::kVElastic,
5, 5, 290, 290);
assert( itsTabGroup != NULL );
JXWidgetSet* card3 = itsTabGroup->AppendTab("Testing");
JXWidgetSet* card1 = itsTabGroup->PrependTab("First tab");
JXWidgetSet* card2 = itsTabGroup->InsertTab(2, "Tab #2");
// card 1
itsFontMenu =
new JXFontNameMenu("Font:", card1,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,30);
assert( itsFontMenu != NULL );
itsFontMenu->SetFontName(itsTabGroup->GetFontName());
itsFontMenu->SetToPopupChoice();
ListenTo(itsFontMenu);
const JString fontName = itsFontMenu->GetFontName();
itsSizeMenu =
new JXFontSizeMenu(fontName, "Size:", card1,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 50,30);
assert( itsSizeMenu != NULL );
itsSizeMenu->SetToPopupChoice();
ListenTo(itsSizeMenu);
itsEdgeRG = new JXRadioGroup(card1, JXWidget::kFixedLeft, JXWidget::kFixedTop,
20,100, 100,140);
assert( itsEdgeRG != NULL );
JXTextRadioButton* rb1 =
new JXTextRadioButton(JXTabGroup::kTop, "Top", itsEdgeRG,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
10,10, 80,20);
assert( rb1 != NULL );
JXTextRadioButton* rb2 =
new JXTextRadioButton(JXTabGroup::kLeft, "Left", itsEdgeRG,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
10,40, 80,20);
assert( rb2 != NULL );
JXTextRadioButton* rb3 =
new JXTextRadioButton(JXTabGroup::kBottom, "Bottom", itsEdgeRG,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
10,70, 80,20);
assert( rb3 != NULL );
JXTextRadioButton* rb4 =
new JXTextRadioButton(JXTabGroup::kRight, "Right", itsEdgeRG,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
10,100, 80,20);
assert( rb4 != NULL );
itsEdgeRG->SelectItem(itsTabGroup->GetTabEdge());
ListenTo(itsEdgeRG);
// card 2
itsAddTabButton =
new JXTextButton("Add new tab", card2,
JXWidget::kFixedLeft, JXWidget::kFixedBottom,
20, 20, 200, 30);
assert( itsAddTabButton != NULL );
ListenTo(itsAddTabButton);
JXIntegerInput* input =
new JXIntegerInput(card2, JXWidget::kHElastic, JXWidget::kFixedTop,
20, 60, 250, 20);
assert( input != NULL );
input->SetLimits(-10, 10);
input->SetValue(0);
// card 3
itsMonoFontSample =
new JXInputField(card3, JXWidget::kHElastic, JXWidget::kFixedTop,
20, 20, 250, 20);
assert( itsMonoFontSample != NULL );
itsMonoFontSample->SetText("I code, therefore I am. ©Åå");
itsMonoFont =
new JXChooseMonoFont(card3, JXWidget::kHElastic, JXWidget::kFixedTop,
20, 50, 300, 100);
assert( itsMonoFont != NULL );
ListenTo(itsMonoFont);
UpdateFontSample();
//.........这里部分代码省略.........
示例10: JXMenuBar
void
TestDirector::BuildWindow
(
const JBoolean isMaster,
const JBoolean bufferTestWidget,
const JBoolean testWidgetIsImage
)
{
JXDisplay* display = (JXGetApplication())->GetCurrentDisplay();
JXColormap* colormap = display->GetColormap();
// begin JXLayout
JXWindow* window = new JXWindow(this, 400,330, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 400,30);
assert( menuBar != NULL );
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 400,300);
assert( scrollbarSet != NULL );
// end JXLayout
window->SetTitle("Test Director");
window->SetWMClass("testjx", "TestDirector");
window->SetMinSize(150,150);
if (isMaster)
{
window->SetCloseAction(JXWindow::kQuitApp);
}
else
{
window->SetCloseAction(JXWindow::kCloseDisplay);
}
itsAnimIconTask = new AnimateWindowIconTask(GetWindow());
assert( itsAnimIconTask != NULL );
ListenTo(window); // for icon animation
// menus
JXImage* aboutTitleImage =
new JXImage(display, kSmileyBitmap[ kHappySmileyIndex ], colormap->GetRedColor());
assert( aboutTitleImage != NULL );
itsAboutMenu = menuBar->AppendTextMenu(aboutTitleImage, kJTrue);
itsAboutMenu->SetShortcuts(kAboutMenuShortcuts);
itsAboutMenu->SetMenuItems(kAboutMenuStr, "TestDirector");
itsAboutMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsAboutMenu);
itsAnimHelpTask = new AnimateHelpMenuTask(itsAboutMenu, kHelpCmd);
assert( itsAnimHelpTask != NULL );
itsPrintPSMenu = new JXTextMenu(itsAboutMenu, kPrintPSMenuCmd, menuBar);
assert( itsPrintPSMenu != NULL );
itsPrintPSMenu->SetMenuItems(kPrintPSMenuStr);
itsPrintPSMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsPrintPSMenu);
itsTestMenu = menuBar->AppendTextMenu(kTestMenuTitleStr);
itsTestMenu->SetMenuItems(kTestMenuStr);
itsTestMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsTestMenu);
itsUNMenu = new JXTextMenu(itsTestMenu, kTestUserNotifyMenuCmd, menuBar);
assert( itsUNMenu != NULL );
itsUNMenu->SetMenuItems(kUserNotificationMenuStr);
itsUNMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsUNMenu);
itsCSFMenu = new JXTextMenu(itsTestMenu, kTestChooseSaveFileMenuCmd, menuBar);
assert( itsCSFMenu != NULL );
itsCSFMenu->SetMenuItems(kChooseSaveFileMenuStr);
itsCSFMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsCSFMenu);
itsPGMenu = new JXTextMenu(itsTestMenu, kTestPGMenuCmd, menuBar);
assert( itsPGMenu != NULL );
itsPGMenu->SetMenuItems(kProgressDisplayMenuStr);
itsPGMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsPGMenu);
if (isMaster)
{
itsDisplayMenu =
new JXDisplayMenu(kDisplayMenuName, menuBar,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
0,0, 10,10);
assert( itsDisplayMenu != NULL );
menuBar->AppendMenu(itsDisplayMenu);
}
else
{
itsDisplayMenu = NULL;
//.........这里部分代码省略.........
示例11: 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
//.........这里部分代码省略.........
示例12: 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();
}
示例13: 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())
//.........这里部分代码省略.........
示例14: JXMenuBar
void
WizChatDirector::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 600,250, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 600,30);
assert( menuBar != NULL );
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,180);
assert( scrollbarSet != NULL );
itsChatInput =
new WizChatInput(window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 90,210, 510,40);
assert( itsChatInput != NULL );
itsChatShortcutMenu =
new WizChatShortcutMenu(itsChatInput, window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 0,210, 90,20);
assert( itsChatShortcutMenu != NULL );
itsChatTargetMenu =
new WizChatTargetMenu(itsChatInput, itsChatShortcutMenu, window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 0,230, 90,20);
assert( itsChatTargetMenu != NULL );
// end JXLayout
window->SetTitle("Chat");
window->SetMinSize(150, 150);
window->SetWMClass(WizGetWMClassInstance(), WizGetChatWindowClass());
JXDisplay* display = GetDisplay();
JXImage* icon = new JXImage(display, display->GetColormap(), jx_un_message);
assert( icon != NULL );
window->SetIcon(icon);
itsMessageDisplay =
new JXStaticText("", kJTrue, kJTrue,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( itsMessageDisplay != NULL );
itsMessageDisplay->FitToEnclosure();
itsChatInput->SetShortcutMenu(itsChatShortcutMenu);
ListenTo(itsChatTargetMenu);
itsActionsMenu = menuBar->AppendTextMenu(kActionsMenuTitleStr);
itsActionsMenu->SetMenuItems(kActionsMenuStr);
itsActionsMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsActionsMenu);
itsMessageDisplay->AppendEditMenu(menuBar);
itsChatInput->ShareEditMenu(itsMessageDisplay);
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);
}