本文整理汇总了C++中JXWindow::GetDisplay方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::GetDisplay方法的具体用法?C++ JXWindow::GetDisplay怎么用?C++ JXWindow::GetDisplay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::GetDisplay方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXMenuBar
SMTPDebugDir::SMTPDebugDir
(
JXDirector* supervisor
)
:
GMManagedDirector(supervisor)
{
JSize w = 400;
JSize h = 300;
JXWindow* window = new JXWindow(this, w,h, "Debug Window");
assert( window != NULL );
SetWindow(window);
window->SetCloseAction(JXWindow::kDeactivateDirector);
JXMenuBar* menuBar =
new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, w,kJXStdMenuBarHeight);
assert( menuBar != NULL );
itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr);
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
GMDirectorMenu* menu =
new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
assert(menu != NULL);
menuBar->AppendMenu(menu);
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic,
0,kJXStdMenuBarHeight,w,h - kJXStdMenuBarHeight);
assert ( scrollbarSet != NULL );
itsText =
new JXStaticText("", kJFalse, kJTrue,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,w,h - kJXStdMenuBarHeight);
assert (itsText != NULL);
itsMenuIcon = new JXImage(window->GetDisplay(), window->GetColormap(), JXPM(debug_xpm));
assert(itsMenuIcon != NULL);
itsMenuIcon->ConvertToRemoteStorage();
GGetDirMgr()->DirectorCreated(this);
}
示例2: CBPrefsManager
JBoolean
CBCreateGlobals
(
CBApp* app,
const JBoolean useMDI
)
{
if (JAssertBase::GetAction() == JAssertBase::kAskUser)
{
JAssertBase::SetAction(JAssertBase::kAbort);
}
theApplication = app;
CBCreateIcons();
// prefs must be created first so everybody can read from it
JBoolean isNew;
thePrefsManager = new CBPrefsManager(&isNew);
assert( thePrefsManager != NULL );
JXInitHelp(kCBTOCHelpName, kCBHelpSectionCount, kCBHelpSectionName);
thePrefsManager->UpgradeHelpPrefs();
theDocManager = new CBDocumentManager;
assert( theDocManager != NULL );
if (useMDI)
{
CBDockManager* dockManager = new CBDockManager();
assert( dockManager != NULL );
dockManager->JPrefObject::ReadPrefs();
theMDIServer = new CBMDIServer;
assert( theMDIServer != NULL );
}
theSearchTextDialog = CBSearchTextDialog::Create();
assert( theSearchTextDialog != NULL );
theRunTEScriptDialog = new CBRunTEScriptDialog(JXGetPersistentWindowOwner());
assert( theRunTEScriptDialog != NULL );
theViewManPageDialog = new CBViewManPageDialog(JXGetPersistentWindowOwner());
assert( theViewManPageDialog != NULL );
theFindFileDialog = new CBFindFileDialog(JXGetPersistentWindowOwner());
assert( theFindFileDialog != NULL );
theDiffFileDialog = new CBDiffFileDialog(JXGetPersistentWindowOwner());
assert( theDiffFileDialog != NULL );
// widgets hidden in permanent window
JXWindow* permWindow = theSearchTextDialog->GetWindow();
theDocManager->CreateFileHistoryMenus(permWindow);
// global commands
theCmdManager = new CBCommandManager(theDocManager);
assert( theCmdManager != NULL );
theCmdManager->JPrefObject::ReadPrefs();
// fn menu updater
theFnMenuUpdater = new CBFnMenuUpdater;
assert( theFnMenuUpdater != NULL );
// symbol type list
theSymbolTypeList = new CBSymbolTypeList(permWindow->GetColormap());
assert( theSymbolTypeList != NULL );
// printers
thePTTextPrinter = new CBPTPrinter;
assert( thePTTextPrinter != NULL );
thePSTextPrinter = new CBPSPrinter(permWindow->GetDisplay());
assert( thePSTextPrinter != NULL );
return isNew;
}
示例3: JXMenuBar
//.........这里部分代码省略.........
0,0,
100,100);
assert(itsSBSet != NULL);
itsSBSet->FitToEnclosure(kJTrue, kJTrue);
itsView =
new GMessageView(menuBar, itsSBSet, itsSBSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,10,10);
assert (itsView != NULL);
itsView->FitToEnclosure(kJTrue, kJTrue);
itsView->SetPTPrinter(GMGetAltPTPrinter());
window->InstallShortcuts(itsView, "#_");
ListenTo(itsView);
JXScrollbarSet* sbs =
new JXScrollbarSet(itsPart->GetCompartment(1),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,
100,50);
assert(sbs != NULL);
sbs->FitToEnclosure(kJTrue, kJTrue);
itsHeader =
new GMessageView(sbs, sbs->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0,10,10);
assert (itsHeader != NULL);
itsHeader->FitToEnclosure(kJTrue, kJTrue);
itsHeader->ShareEditMenu(itsView);
itsHeader->ShareSearchMenu(itsView);
GMDirectorMenu* menu =
new GMDirectorMenu(kWindowsMenuTitleStr, menuBar,
JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
assert(menu != NULL);
menuBar->AppendMenu(menu);
itsPrefsMenu = menuBar->AppendTextMenu(kPrefsMenuTitleStr);
itsPrefsMenu->SetMenuItems(kPrefsMenuStr);
itsPrefsMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsPrefsMenu);
itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
itsHelpMenu->SetMenuItems(kHelpMenuStr);
itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHelpMenu);
itsFileMenu->SetItemImage(kNewCmd, filenew);
itsFileMenu->SetItemImage(kNewMBox, envelopes);
itsFileMenu->SetItemImage(kOpenCmd, fileopen);
itsFileMenu->SetItemImage(kSaveCmd, filefloppy);
itsFileMenu->SetItemImage(kPrintCmd, fileprint);
itsFileMenu->SetItemImage(kShowNextCmd, mini_right);
itsFileMenu->SetItemImage(kDeleteShowNextCmd, mini_del_right);
itsFileMenu->SetItemImage(kShowPrevCmd, mini_left);
itsMessageMenu->SetItemImage(kDecryptCmd, unlock_xpm);
itsMessageMenu->SetItemImage(kSaveAttachCmd, paperclip);
itsMessageMenu->SetItemImage(kReplyCmd, reply_xpm);
itsMessageMenu->SetItemImage(kReplySenderCmd, reply_sender_xpm);
itsMessageMenu->SetItemImage(kReplyAllCmd, reply_all_xpm);
itsMessageMenu->SetItemImage(kForwardCmd, forward_xpm);
itsMessageMenu->SetItemImage(kRedirectCmd, redirect_xpm);
itsHelpMenu->SetItemImage(kTOCCmd, jx_help_toc);
itsHelpMenu->SetItemImage(kThisWindowCmd, JXPM(jx_help_specific));
itsToolBar->LoadPrefs();
if (itsToolBar->IsEmpty())
{
itsToolBar->AppendButton(itsFileMenu, kNewCmd);
itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
itsToolBar->NewGroup();
itsToolBar->AppendButton(itsFileMenu, kSaveCmd);
itsToolBar->NewGroup();
itsToolBar->AppendButton(itsFileMenu, kPrintCmd);
itsToolBar->NewGroup();
itsToolBar->AppendButton(itsFileMenu, kShowNextCmd);
itsToolBar->AppendButton(itsFileMenu, kShowPrevCmd);
itsToolBar->AppendButton(itsFileMenu, kDeleteShowNextCmd);
itsToolBar->NewGroup();
itsToolBar->AppendButton(itsMessageMenu, kReplyCmd);
itsToolBar->AppendButton(itsMessageMenu, kReplySenderCmd);
itsToolBar->AppendButton(itsMessageMenu, kReplyAllCmd);
itsToolBar->AppendButton(itsMessageMenu, kForwardCmd);
itsToolBar->AppendButton(itsMessageMenu, kRedirectCmd);
}
itsMenuIcon = new JXImage(window->GetDisplay(), jx_plain_file_small);
assert(itsMenuIcon != NULL);
itsMenuIcon->ConvertToRemoteStorage();
}
示例4: 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();
}
示例5: JXMenuBar
//.........这里部分代码省略.........
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())
{
itsToolBar->AppendButton(itsFileMenu, kNewCmd);
itsToolBar->AppendButton(itsFileMenu, kOpenCmd);
itsToolBar->NewGroup();
itsToolBar->AppendButton(itsFileMenu, kCheckMailCmd);
itsToolBar->NewGroup();
itsWidget->AddDefaultButtcons(itsToolBar);
itsToolBar->AppendButton(itsHelpMenu, kTOCCmd);
itsToolBar->AppendButton(itsHelpMenu, kThisWindowCmd);
}
itsMenuIcon = new JXImage(window->GetDisplay(), mailbox);
assert(itsMenuIcon != NULL);
itsMenuIcon->ConvertToRemoteStorage();
}