本文整理汇总了C++中JXWindow::SetCloseAction方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::SetCloseAction方法的具体用法?C++ JXWindow::SetCloseAction怎么用?C++ JXWindow::SetCloseAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::SetCloseAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXScrollbarSet
void
JX2DCursorMarkTableDir::BuildWindow
(
J2DPlotWidget* plot
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 250,200, "");
assert( window != NULL );
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 250,200);
assert( scrollbarSet != NULL );
// end JXLayout
window->SetTitle("Cursor Mark Values");
window->SetMinSize(250,300);
window->SetCloseAction(JXWindow::kDeactivateDirector);
itsTable =
new JX2DCursorMarkTable(plot,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 10,10);
assert (itsTable != NULL);
itsTable->FitToEnclosure();
}
示例2: 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);
}
示例3: JXMenuBar
void
GloveHistoryDir::BuildWindow()
{
JCoordinate w = 485;
JCoordinate h = 320;
JPoint dtl;
// JBoolean foundWindowPref = gjdbApp->GetCmdWindowSize(&dtl, &w, &h);
JXWindow* window = jnew JXWindow(this, w,h, "Glove session");
assert( window != NULL );
window->SetMinSize(300,200);
window->SetCloseAction(JXWindow::kDeactivateDirector);
// if (foundWindowPref)
// {
// window->Place(dtl.x, dtl.y);
// }
itsMenuBar =
jnew JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, w,kJXDefaultMenuBarHeight);
assert( itsMenuBar != NULL );
itsFileMenu = itsMenuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr);
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
JXScrollbarSet* scrollbarSet =
jnew JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic,
0,kJXDefaultMenuBarHeight,
w,h - kJXDefaultMenuBarHeight);
assert( scrollbarSet != NULL );
itsHistory =
jnew GloveHistory(itsMenuBar,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0, 0, 10, 10);
assert( itsHistory != NULL );
itsHistory->FitToEnclosure(kJTrue, kJTrue);
ListenTo(itsHistory);
}
示例4: 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);
}
示例5: JXMenuBar
void
SCCircuitDocument::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 260,300, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 260,30);
assert( menuBar != NULL );
itsNetlistText =
new JXStaticText("", kJFalse, kJTrue, NULL, JGetString("itsNetlistText::SCCircuitDocument::JXLayout"), window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 260,270);
assert( itsNetlistText != NULL );
// end JXLayout
window->SetCloseAction(JXWindow::kQuitApp);
window->SetMinSize(100,100);
itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr);
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
itsAnalysisMenu = menuBar->AppendTextMenu(kAnalysisMenuTitleStr);
itsAnalysisMenu->SetMenuItems(kAnalysisMenuStr);
itsAnalysisMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsAnalysisMenu);
itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
itsHelpMenu->SetMenuItems(kHelpMenuStr);
itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHelpMenu);
}
示例6: 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);
}
示例7: JXMenuBar
void
GLFitDirector::BuildWindow()
{
JCoordinate w = 600;
JCoordinate h = 420;
JXWindow* window = new JXWindow(this, w,h, "Fit");
assert( window != NULL );
window->SetCloseAction(JXWindow::kDeactivateDirector);
JXMenuBar* menuBar =
new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, w,kJXDefaultMenuBarHeight);
assert( menuBar != NULL );
itsToolBar =
new JXToolBar(GetPrefsMgr(), kFitToolBarID,
menuBar, w, h,
window, JXWidget::kHElastic, JXWidget::kVElastic,
0,kJXDefaultMenuBarHeight, w,h - kJXDefaultMenuBarHeight);
assert( itsToolBar != NULL );
JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();
const JCoordinate kPartitionHandleWidth = 5;
const JCoordinate kFitListWidth = 155;
JArray<JCoordinate> widths(2);
widths.AppendElement(kFitListWidth);
widths.AppendElement(w - kFitListWidth - kPartitionHandleWidth);
JIndex elasticIndex = 2;
JArray<JCoordinate> minWidths(2);
minWidths.AppendElement(100);
minWidths.AppendElement(300);
itsMainPartition =
new JXHorizPartition(widths, elasticIndex, minWidths,
itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic,JXWidget::kVElastic,
0, 0, w, newHeight);
assert( itsMainPartition != NULL );
// This is the first column the contains the curve and fit lists.
JXContainer* container = itsMainPartition->GetCompartment(1);
const JCoordinate kCurveListHeight = 100;
const JCoordinate kColHeaderHeight = 20;
const JCoordinate kExprHeight = 50;
const JCoordinate kFitListHeight = newHeight - kCurveListHeight - 2 * kPartitionHandleWidth - kExprHeight;
JArray<JCoordinate> heights(3);
heights.AppendElement(kCurveListHeight);
heights.AppendElement(kFitListHeight);
heights.AppendElement(kExprHeight);
elasticIndex = 2;
JArray<JCoordinate> minHeights(3);
minHeights.AppendElement(50);
minHeights.AppendElement(100);
minHeights.AppendElement(40);
itsListPartition =
new JXVertPartition(heights, elasticIndex, minHeights, container,
JXWidget::kHElastic, JXWidget::kVElastic, 0, 0, kFitListWidth, newHeight);
assert( itsListPartition != NULL );
container = itsListPartition->GetCompartment(1);
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(container,
JXWidget::kHElastic,JXWidget::kVElastic,
0, kColHeaderHeight,
kFitListWidth, kCurveListHeight - kColHeaderHeight);
assert( scrollbarSet != NULL );
// This will be the curve list
itsCurveList =
new GLCurveNameList(itsDir, itsPlot,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0, 0, kFitListWidth, kCurveListHeight - kColHeaderHeight);
assert(itsCurveList != NULL);
ListenTo(itsCurveList);
JXColHeaderWidget* header =
new JXColHeaderWidget(itsCurveList, scrollbarSet,
container,
JXWidget::kHElastic, JXWidget::kFixedTop,
0, 0,
kFitListWidth,
kColHeaderHeight);
assert(header != NULL);
header->SetColTitle(1, "Curves");
container = itsListPartition->GetCompartment(2);
//.........这里部分代码省略.........
示例8: 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,
//.........这里部分代码省略.........
示例9: 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());
//.........这里部分代码省略.........
示例10: 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();
}
示例11: 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;
//.........这里部分代码省略.........
示例12: JXMenuBar
PlotDir::PlotDir
(
JXDirector* supervisor,
JXFileDocument* notifySupervisor,
const JCharacter* filename,
const JBoolean hideOnClose
)
:
JXDocument(supervisor),
itsFileName(filename)
{
itsSupervisor = notifySupervisor;
itsHideOnClose = hideOnClose;
itsPlotIsClosing = kJFalse;
itsPrinter = NULL;
JCoordinate w = 500;
JCoordinate h = 400;
JCoordinate minW = 400;
JCoordinate minH = 300;
JXWindow* window = jnew JXWindow(this, w,h, filename);
assert( window != NULL );
window->SetMinSize(minW,minH);
if (hideOnClose)
{
window->SetCloseAction(JXWindow::kDeactivateDirector);
}
JXMenuBar* menuBar =
jnew JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, w, kJXDefaultMenuBarHeight);
assert( menuBar != NULL );
itsPlotMenu = menuBar->AppendTextMenu(kPlotMenuTitleStr);
itsPlotMenu->SetMenuItems(kPlotMenuStr);
itsPlotMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsPlotMenu);
itsAnalysisMenu = menuBar->AppendTextMenu(kAnalysisMenuTitleStr);
itsAnalysisMenu->SetMenuItems(kAnalysisMenuStr);
itsAnalysisMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsAnalysisMenu);
itsFitParmsMenu = jnew JXTextMenu(itsAnalysisMenu, kFitParmsCmd, menuBar);
assert( itsFitParmsMenu != NULL );
itsFitParmsMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFitParmsMenu);
itsAnalysisMenu->DisableItem(kFitParmsCmd);
itsDiffMenu = jnew JXTextMenu(itsAnalysisMenu, kDiffPlotCmd, menuBar);
assert( itsDiffMenu != NULL );
itsDiffMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsDiffMenu);
itsAnalysisMenu->DisableItem(kDiffPlotCmd);
itsSessionDir =
jnew GloveHistoryDir(JXGetApplication());
assert(itsSessionDir != NULL);
JXGetDocumentManager()->DocumentMustStayOpen(itsSessionDir, kJTrue);
ListenTo(itsSessionDir);
itsPlot =
jnew GlovePlotter(itsSessionDir, menuBar, window,
JXWidget::kHElastic, JXWidget::kVElastic,
0, 30, w, h - kJXDefaultMenuBarHeight);
assert( itsPlot != NULL );
ListenTo(itsPlot);
JXDocumentMenu* windowListMenu =
jnew JXDocumentMenu(kWindowListMenuTitleStr, menuBar,
JXWidget::kFixedLeft, JXWidget::kVElastic, 0,0, 10,10);
assert( windowListMenu != NULL );
menuBar->AppendMenu(windowListMenu);
itsHelpMenu = menuBar->AppendTextMenu(kHelpMenuTitleStr);
itsHelpMenu->SetMenuItems(kHelpMenuStr);
itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsHelpMenu);
itsVarList = jnew GVarList();
itsVarList->AddVariable("x",0);
itsXVarIndex = 1;
itsFunctionDialog = NULL;
itsFitModuleDialog = NULL;
itsFits = jnew JPtrArray<JFitBase>(JPtrArrayT::kForgetAll);
assert( itsFits != NULL );
ListenTo(itsFits);
itsFitParmsDir = jnew FitParmsDir(this, itsFits);
assert( itsFitParmsDir != NULL );
itsCurveStats = jnew JArray<CurveStats>;
assert( itsCurveStats != NULL );
itsCurrentCurveType = kGDataCurve;
itsDiffDirs = jnew JPtrArray<PlotDir>(JPtrArrayT::kForgetAll);
assert( itsDiffDirs != NULL );
//.........这里部分代码省略.........
示例13: 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();
}
示例14: 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(),
//.........这里部分代码省略.........
示例15: 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);
}