本文整理汇总了C++中JXWindow类的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow类的具体用法?C++ JXWindow怎么用?C++ JXWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JXWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindow
void
JXButton::SetShortcuts
(
const JCharacter* list
)
{
JXWindow* w = GetWindow();
w->ClearShortcuts(this);
w->InstallShortcuts(this, list);
const JBoolean wasReturnButton = itsIsReturnButtonFlag;
itsIsReturnButtonFlag = kJFalse;
if (list != NULL)
{
JString shortcuts = list;
if (shortcuts.Contains("^M") || shortcuts.Contains("^m"))
{
itsIsReturnButtonFlag = kJTrue;
}
}
const JSize borderWidth = GetBorderWidth();
if (!wasReturnButton && itsIsReturnButtonFlag)
{
SetBorderWidth(borderWidth+1);
}
else if (wasReturnButton && !itsIsReturnButtonFlag && borderWidth > 0)
{
SetBorderWidth(borderWidth-1);
}
Refresh();
}
示例2: JXWindowDirector
THXBaseConvDirector::THXBaseConvDirector
(
istream& input,
const JFileVersion vers,
JXDirector* supervisor
)
:
JXWindowDirector(supervisor)
{
BuildWindow();
JSize fromBase, toBase;
input >> fromBase >> toBase;
itsFromBase->SetBase(fromBase);
itsToBase->SetBase(toBase);
JString fromValue;
input >> fromValue;
itsFromValue->SetText(fromValue);
JXWindow* window = GetWindow();
window->ReadGeometry(input);
JBoolean active;
input >> active;
if (active)
{
Activate();
}
}
示例3: JXWindowDirector
SVNMainDirector::SVNMainDirector
(
JXDirector* supervisor,
const JCharacter* path
)
:
JXWindowDirector(supervisor),
itsPath(path)
{
SVNMainDirectorX();
JPoint desktopLoc;
JCoordinate w,h;
if ((SVNGetPrefsManager())->GetWindowSize(kSVNMainDirectorWindSizeID,
&desktopLoc, &w, &h))
{
JXWindow* window = GetWindow();
window->Place(desktopLoc.x, desktopLoc.y);
window->SetSize(w,h);
}
if (itsRepoWidget != NULL)
{
itsRepoWidget->RefreshContent();
}
}
示例4: JXWindow
JXScrollbarSet*
CBFnListDirector::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 170,250, "");
assert( window != NULL );
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 170,220);
assert( scrollbarSet != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 170,30);
assert( menuBar != NULL );
// end JXLayout
window->SetMinSize(150,150);
itsActionsMenu = menuBar->AppendTextMenu(kActionsMenuTitleStr);
itsActionsMenu->SetMenuItems(kActionsMenuStr, "CBFnListDirector");
ListenTo(itsActionsMenu);
return scrollbarSet;
}
示例5: JXWindow
void
JXMessageDialog::BuildWindow
(
const JCharacter* message
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 330,110, "");
assert( window != NULL );
JXTextButton* okButton =
new JXTextButton(JGetString("okButton::JXMessageDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 140,80, 60,20);
assert( okButton != NULL );
okButton->SetShortcuts(JGetString("okButton::JXMessageDialog::shortcuts::JXLayout"));
JXStaticText* text =
new JXStaticText(JGetString("text::JXMessageDialog::JXLayout"), window,
JXWidget::kHElastic, JXWidget::kVElastic, 60,20, 250,50);
assert( text != NULL );
JXImageWidget* icon =
new JXImageWidget(window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 40,40);
assert( icon != NULL );
// end JXLayout
window->SetTitle("Message");
SetButtons(okButton, NULL);
Init(window, text, message, icon, jx_un_message);
}
示例6: JXWindow
void
DragWidgetDir::BuildWindow()
{
// Create the window
JXWindow* window = new JXWindow(this, 300,200, "Drag Painter Program");
assert( window != NULL );
// Give the window to the director
SetWindow(window);
// Set the window sizing
window->SetMinSize(300,200);
window->SetMaxSize(800,600);
// Create the scrollbar set
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 300,200);
assert( scrollbarSet != NULL );
// Create the custom widget with the scrollbarset as its enclosure
DragWidget* widget =
new DragWidget(scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0, 0, 10, 10);
assert( widget != NULL );
// Fit the widget within the scrollbarset enclosure
widget->FitToEnclosure(kJTrue, kJTrue);
}
示例7: GetWindow
void
SyGViewManPageDialog::ReadPrefs
(
istream& input
)
{
JFileVersion vers;
input >> vers;
if (vers > kCurrentSetupVersion)
{
return;
}
JXWindow* window = GetWindow();
window->ReadGeometry(input);
window->Deiconify();
itsFnHistoryMenu->ReadSetup(input);
if (vers >= 1)
{
JBoolean stayOpen;
input >> stayOpen;
itsStayOpenCB->SetState(stayOpen);
}
示例8: assert
void
JXDialogDirector::SetButtons
(
JXButton* okButton,
JXButton* cancelButton
)
{
assert( !itsModalFlag || okButton != NULL );
JXWindow* window = GetWindow();
assert( window != NULL );
if (itsModalFlag)
{
window->HideFromTaskbar();
}
itsOKButton = okButton;
if (itsOKButton != NULL)
{
ListenTo(itsOKButton);
}
itsCancelButton = cancelButton;
if (itsCancelButton != NULL)
{
ListenTo(itsCancelButton);
window->InstallShortcuts(itsCancelButton, "^[");
}
}
示例9: JXWindow
void
JXGetStringDialog::BuildWindow
(
const JCharacter* windowTitle,
const JCharacter* prompt,
const JCharacter* initialValue,
const JBoolean password
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 310,110, "");
assert( window != NULL );
JXTextButton* okButton =
new JXTextButton(JGetString("okButton::JXGetStringDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,80, 60,20);
assert( okButton != NULL );
okButton->SetShortcuts(JGetString("okButton::JXGetStringDialog::shortcuts::JXLayout"));
JXTextButton* cancelButton =
new JXTextButton(JGetString("cancelButton::JXGetStringDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 60,20);
assert( cancelButton != NULL );
cancelButton->SetShortcuts(JGetString("cancelButton::JXGetStringDialog::shortcuts::JXLayout"));
itsInputField =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 270,20);
assert( itsInputField != NULL );
JXStaticText* promptDisplay =
new JXStaticText(JGetString("promptDisplay::JXGetStringDialog::JXLayout"), window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 270,20);
assert( promptDisplay != NULL );
promptDisplay->SetToLabel();
// end JXLayout
window->SetTitle(windowTitle);
SetButtons(okButton, cancelButton);
promptDisplay->SetText(prompt);
if (password)
{
const JRect r = itsInputField->GetFrame();
delete itsInputField;
itsInputField =
new JXPasswordInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop,
r.left, r.top, r.width(), r.height());
assert( itsInputField != NULL );
}
else if (!JStringEmpty(initialValue))
{
itsInputField->SetText(initialValue);
}
itsInputField->SetIsRequired();
}
示例10: JXWindow
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();
}
示例11: JXWindow
void
SimpleTableDir::BuildWindow()
{
// Create the window
JXWindow* window = new JXWindow(this, 300,200, "Test SimpleTable Program");
assert( window != NULL );
// Give the window to the director
SetWindow(window);
// Set sizing
window->SetMinSize(300,200);
window->SetMaxSize(800,600);
// Create the scrollbar set to hold the table
JXScrollbarSet* scrollbarSet =
new JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 300,200);
assert( scrollbarSet != NULL );
// Create our SimpleTable. It must be placed inside the
// special widget that JXScrollbarSet creates. We get a
// pointer to this special widget by calling GetScrollEnclosure().
SimpleTable* table =
new SimpleTable(scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic,
0, 0, 10, 10);
assert( table != NULL );
table->FitToEnclosure();
}
示例12: JXWindow
void
SCPlotDirector::BuildWindow()
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 600,400, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 600,30);
assert( menuBar != NULL );
itsPlot =
new JX2DPlotWidget(menuBar, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,370);
assert( itsPlot != NULL );
// end JXLayout
window->LockCurrentMinSize();
ListenTo(itsPlot);
itsPlot->SetTitle("New plot");
itsPlot->SetXLabel("Frequency (Hz)");
}
示例13: StopListening
JXDockWidget::~JXDockWidget()
{
const JXDockManager::CloseDockMode mode = (JXGetDockManager())->GetCloseDockMode();
if (itsWindowList != NULL && mode == JXDockManager::kUndockWindows)
{
// can't call UndockAll() because that calls UpdateMinSize()
const JSize count = itsWindowList->GetElementCount();
for (JIndex i=1; i<=count; i++)
{
JXWindow* w = itsWindowList->NthElement(i);
StopListening(w);
w->Undock();
}
delete itsWindowList;
}
else if (itsWindowList != NULL)
{
assert( mode == JXDockManager::kCloseWindows );
const JSize count = itsWindowList->GetElementCount();
for (JIndex i=1; i<=count; i++)
{
JXWindow* w = itsWindowList->NthElement(i);
StopListening(w);
w->Close();
}
delete itsWindowList;
}
}
示例14: JXWindow
void
ResizeWidgetDialog::BuildWindow
(
const JXWidget* widget
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 160,120, "");
assert( window != NULL );
JXTextButton* cancelButton =
new JXTextButton(JGetString("cancelButton::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 20,90, 50,20);
assert( cancelButton != NULL );
JXTextButton* okButton =
new JXTextButton(JGetString("okButton::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 90,90, 50,20);
assert( okButton != NULL );
okButton->SetShortcuts(JGetString("okButton::ResizeWidgetDialog::shortcuts::JXLayout"));
itsWidth =
new JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,20, 70,20);
assert( itsWidth != NULL );
itsHeight =
new JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,50, 70,20);
assert( itsHeight != NULL );
JXStaticText* obj1_JXLayout =
new JXStaticText(JGetString("obj1_JXLayout::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,20);
assert( obj1_JXLayout != NULL );
obj1_JXLayout->SetToLabel();
JXStaticText* obj2_JXLayout =
new JXStaticText(JGetString("obj2_JXLayout::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,50, 50,20);
assert( obj2_JXLayout != NULL );
obj2_JXLayout->SetToLabel();
// end JXLayout
window->SetTitle("Change widget size");
SetButtons(okButton, cancelButton);
const JRect r = widget->GetBoundsGlobal();
itsWidth->SetLowerLimit(50);
itsWidth->SetUpperLimit(2000);
itsWidth->SetValue(r.width());
itsHeight->SetLowerLimit(50);
itsHeight->SetUpperLimit(2000);
itsHeight->SetValue(r.height());
}
示例15: heights
void
SCXferFnDirector::BuildWindow
(
SCCircuitDocument* doc
)
{
JArray<JCoordinate> heights(2);
heights.AppendElement(kInitExprHeight);
heights.AppendElement(kInitExprHeight);
JArray<JCoordinate> minHeights(2);
minHeights.AppendElement(kMinExprHeight);
minHeights.AppendElement(kMinExprHeight);
// begin JXLayout
JXWindow* window = new JXWindow(this, 500,230, "");
assert( window != NULL );
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 430,30);
assert( menuBar != NULL );
itsPartition =
new JXVertPartition(heights, 0, minHeights, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 500,205);
assert( itsPartition != NULL );
itsEvalButton =
new JXTextButton(JGetString("itsEvalButton::SCXferFnDirector::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 430,0, 70,30);
assert( itsEvalButton != NULL );
// end JXLayout
window->SetTitle("Transfer function");
const JRect frame = itsPartition->GetFrame();
window->SetMinSize(150, frame.top + itsPartition->GetMinTotalSize());
ListenTo(itsEvalButton);
SCExprEditorSet* exprSet =
new SCExprEditorSet(doc, menuBar, &itsXferFn,
itsPartition->GetCompartment(1),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( exprSet != NULL );
exprSet->FitToEnclosure();
exprSet =
new SCExprEditorSet(doc, itsXferFn, &itsResult,
itsPartition->GetCompartment(2),
JXWidget::kHElastic, JXWidget::kVElastic,
0,0, 100,100);
assert( exprSet != NULL );
exprSet->FitToEnclosure();
}