void SyGNewGitRemoteDialog::BuildWindow() { // begin JXLayout JXWindow* window = jnew JXWindow(this, 310,160, ""); assert( window != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::SyGNewGitRemoteDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,130, 60,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::SyGNewGitRemoteDialog::shortcuts::JXLayout")); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::SyGNewGitRemoteDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,130, 60,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::SyGNewGitRemoteDialog::shortcuts::JXLayout")); itsRemoteURLInputField = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 270,20); assert( itsRemoteURLInputField != NULL ); JXStaticText* remoteLabel = jnew JXStaticText(JGetString("remoteLabel::SyGNewGitRemoteDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 270,20); assert( remoteLabel != NULL ); remoteLabel->SetToLabel(); itsLocalNameInputField = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,90, 270,20); assert( itsLocalNameInputField != NULL ); JXStaticText* localLabel = jnew JXStaticText(JGetString("localLabel::SyGNewGitRemoteDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,70, 270,20); assert( localLabel != NULL ); localLabel->SetToLabel(); // end JXLayout window->SetTitle(JGetString("WindowTitle::SyGNewGitRemoteDialog")); SetButtons(okButton, cancelButton); itsRemoteURLInputField->SetIsRequired(); itsLocalNameInputField->SetIsRequired(); }
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(); }
void JXVarLenPGDirector::BuildWindow ( JXProgressDisplay* pg, const JCharacter* message, const JBoolean allowCancel ) { // begin JXLayout JXWindow* window = new JXWindow(this, 270,80, ""); assert( window != NULL ); JXTextButton* cancelButton = new JXTextButton(JGetString("cancelButton::JXVarLenPGDirector::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,40, 60,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::JXVarLenPGDirector::shortcuts::JXLayout")); JXStaticText* text = new JXStaticText(JGetString("text::JXVarLenPGDirector::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,10, 230,20); assert( text != NULL ); text->SetToLabel(); JXStaticText* counter = new JXStaticText(JGetString("counter::JXVarLenPGDirector::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,40, 100,20); assert( counter != NULL ); counter->SetToLabel(); // end JXLayout Init(window, text, message, allowCancel, cancelButton); pg->SetItems(cancelButton, counter, NULL); }
void JXFixLenPGDirector::BuildWindow ( JXProgressDisplay* pg, const JCharacter* message, const JBoolean allowCancel ) { // begin JXLayout JXWindow* window = new JXWindow(this, 270,80, ""); assert( window != NULL ); JXTextButton* cancelButton = new JXTextButton(JGetString("cancelButton::JXFixLenPGDirector::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 190,10, 60,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::JXFixLenPGDirector::shortcuts::JXLayout")); JXStaticText* text = new JXStaticText(JGetString("text::JXFixLenPGDirector::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,10, 160,20); assert( text != NULL ); text->SetToLabel(); JXProgressIndicator* indicator = new JXProgressIndicator(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,50, 230,10); assert( indicator != NULL ); // end JXLayout if (!allowCancel) { // expand text to fill window because Cancel button will be hidden text->AdjustSize(indicator->GetFrameWidth() - text->GetFrameWidth(), 0); } Init(window, text, message, allowCancel, cancelButton); pg->SetItems(cancelButton, NULL, indicator); }
void SetElasticDialog::BuildWindow ( const JIndex index, const JIndex maxIndex ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 200,90, ""); assert( window != NULL ); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::SetElasticDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 30,60, 50,20); assert( cancelButton != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::SetElasticDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 120,60, 50,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::SetElasticDialog::shortcuts::JXLayout")); itsElasticIndex = jnew JXIntegerInput(window, JXWidget::kHElastic, JXWidget::kFixedTop, 140,20, 40,20); assert( itsElasticIndex != NULL ); JXStaticText* elasticLabel = jnew JXStaticText(JGetString("elasticLabel::SetElasticDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,20, 130,20); assert( elasticLabel != NULL ); elasticLabel->SetToLabel(); // end JXLayout window->SetTitle("Set elastic compartment"); SetButtons(okButton, cancelButton); itsElasticIndex->SetValue(index); itsElasticIndex->SetLimits(0, maxIndex); }
void CBExtEditorDialog::BuildWindow ( const JBoolean editTextLocally, const JCharacter* editTextFileCmd, const JCharacter* editTextFileLineCmd, const JBoolean editBinaryLocally, const JCharacter* editBinaryFileCmd ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 450,220, ""); assert( window != NULL ); itsEditTextFileCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kVElastic, 200,40, 230,20); assert( itsEditTextFileCmdInput != NULL ); itsEditTextFileLineCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kVElastic, 200,60, 230,20); assert( itsEditTextFileLineCmdInput != NULL ); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 100,190, 70,20); assert( cancelButton != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 270,190, 70,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::CBExtEditorDialog::shortcuts::JXLayout")); JXStaticText* editTextHint = jnew JXStaticText(JGetString("editTextHint::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 160,80, 270,20); assert( editTextHint != NULL ); editTextHint->SetFontSize(JGetDefaultFontSize()-2); editTextHint->SetToLabel(); JXStaticText* editTextLabel = jnew JXStaticText(JGetString("editTextLabel::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 30,40, 170,20); assert( editTextLabel != NULL ); editTextLabel->SetToLabel(); JXStaticText* editLineLabel = jnew JXStaticText(JGetString("editLineLabel::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 30,60, 170,20); assert( editLineLabel != NULL ); editLineLabel->SetToLabel(); itsExtTextEditorCB = jnew JXTextCheckbox(JGetString("itsExtTextEditorCB::CBExtEditorDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,20, 160,20); assert( itsExtTextEditorCB != NULL ); itsEditBinaryFileCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kVElastic, 200,130, 230,20); assert( itsEditBinaryFileCmdInput != NULL ); JXStaticText* editBinaryHint = jnew JXStaticText(JGetString("editBinaryHint::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 200,150, 230,20); assert( editBinaryHint != NULL ); editBinaryHint->SetFontSize(JGetDefaultFontSize()-2); editBinaryHint->SetToLabel(); JXStaticText* editBinaryLabel = jnew JXStaticText(JGetString("editBinaryLabel::CBExtEditorDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 30,130, 170,20); assert( editBinaryLabel != NULL ); editBinaryLabel->SetToLabel(); itsExtBinaryEditorCB = jnew JXTextCheckbox(JGetString("itsExtBinaryEditorCB::CBExtEditorDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,110, 180,20); assert( itsExtBinaryEditorCB != NULL ); // end JXLayout window->SetTitle("External Editor"); SetButtons(okButton, cancelButton); itsExtTextEditorCB->SetState(!editTextLocally); itsEditTextFileCmdInput->SetText(editTextFileCmd); itsEditTextFileCmdInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord); itsEditTextFileLineCmdInput->SetText(editTextFileLineCmd); itsEditTextFileLineCmdInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord); itsExtBinaryEditorCB->SetState(!editBinaryLocally); itsEditBinaryFileCmdInput->SetText(editBinaryFileCmd); itsEditBinaryFileCmdInput->SetCharacterInWordFunction(JXChooseSaveFile::IsCharacterInWord); // until we have a built-in one itsExtBinaryEditorCB->SetState(kJTrue); itsExtBinaryEditorCB->Deactivate(); UpdateDisplay(); ListenTo(itsExtTextEditorCB); ListenTo(itsExtBinaryEditorCB); }
void GXCreatePlotDialog::BuildWindow ( GRaggedFloatTableData* data, const JIndex startX, const JIndex startY, const JIndex startXErr, const JIndex startYErr ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 370,160, ""); assert( window != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 280,130, 70,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::GXCreatePlotDialog::shortcuts::JXLayout")); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 180,130, 70,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::GXCreatePlotDialog::shortcuts::JXLayout")); itsLabelInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kVElastic, 115,10, 200,20); assert( itsLabelInput != NULL ); JXStaticText* labelLabel = jnew JXStaticText(JGetString("labelLabel::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 65,10, 50,20); assert( labelLabel != NULL ); labelLabel->SetToLabel(); itsXMenu = jnew JXTextMenu(JGetString("itsXMenu::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 10,40, 160,30); assert( itsXMenu != NULL ); itsXErrMenu = jnew JXTextMenu(JGetString("itsXErrMenu::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 10,80, 160,30); assert( itsXErrMenu != NULL ); itsYErrMenu = jnew JXTextMenu(JGetString("itsYErrMenu::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 200,80, 160,30); assert( itsYErrMenu != NULL ); itsYMenu = jnew JXTextMenu(JGetString("itsYMenu::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 200,40, 160,30); assert( itsYMenu != NULL ); itsPlotsMenu = jnew JXTextMenu(JGetString("itsPlotsMenu::GXCreatePlotDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 10,120, 130,30); assert( itsPlotsMenu != NULL ); // end JXLayout window->SetTitle("Choose Plot Data Columns"); SetButtons(okButton, cancelButton); itsXErrMenu->AppendItem("None"); itsYErrMenu->AppendItem("None"); const JSize count = data->GetDataColCount(); for (JSize i = 1; i <= count; i++) { JString str(i); str.Prepend("Column "); itsXMenu->AppendItem(str); itsXErrMenu->AppendItem(str); itsYMenu->AppendItem(str); itsYErrMenu->AppendItem(str); } itsStartX = startX; if (startX == 0) { itsStartX = 1; } itsStartXErr = startXErr + 1; itsStartY = startY; if (startY == 0) { itsStartY = 1; } itsStartYErr = startYErr + 1; JPtrArray<JString> names(JPtrArrayT::kDeleteAll); itsTableDir->GetPlotNames(names); itsPlotsMenu->AppendItem("New Plot"); const JSize strCount = names.GetElementCount(); for (JSize i = 1; i <= strCount; i++) { itsPlotsMenu->AppendItem(*(names.NthElement(i))); } itsPlotsMenu->ShowSeparatorAfter(1, kJTrue); itsPlotIndex = 1; itsXMenu->SetToPopupChoice(kJTrue, itsStartX); itsXErrMenu->SetToPopupChoice(kJTrue, itsStartXErr); itsYMenu->SetToPopupChoice(kJTrue, itsStartY); itsYErrMenu->SetToPopupChoice(kJTrue, itsStartYErr); itsPlotsMenu->SetToPopupChoice(kJTrue, itsPlotIndex); itsXMenu->SetUpdateAction(JXMenu::kDisableNone); itsXErrMenu->SetUpdateAction(JXMenu::kDisableNone); itsYMenu->SetUpdateAction(JXMenu::kDisableNone); itsYErrMenu->SetUpdateAction(JXMenu::kDisableNone); itsPlotsMenu->SetUpdateAction(JXMenu::kDisableNone); ListenTo(itsXMenu); ListenTo(itsXErrMenu); ListenTo(itsYMenu); ListenTo(itsYErrMenu); ListenTo(itsPlotsMenu); itsLabelInput->SetText("Untitled"); }
void CBEditTextPrefsDialog::BuildWindow ( CBTextDocument* doc ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 640,530, ""); assert( window != NULL ); itsTabCharCountInput = jnew JXIntegerInput(window, JXWidget::kHElastic, JXWidget::kVElastic, 540,130, 40,20); assert( itsTabCharCountInput != NULL ); itsCRMLineWidthInput = jnew JXIntegerInput(window, JXWidget::kHElastic, JXWidget::kVElastic, 540,150, 40,20); assert( itsCRMLineWidthInput != NULL ); itsUndoDepthInput = jnew JXIntegerInput(window, JXWidget::kHElastic, JXWidget::kVElastic, 540,170, 40,20); assert( itsUndoDepthInput != NULL ); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 40,490, 60,20); assert( cancelButton != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 220,490, 60,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::CBEditTextPrefsDialog::shortcuts::JXLayout")); itsCreateBackupCB = jnew JXTextCheckbox(JGetString("itsCreateBackupCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,230, 300,20); assert( itsCreateBackupCB != NULL ); itsAutoIndentCB = jnew JXTextCheckbox(JGetString("itsAutoIndentCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,160, 280,20); assert( itsAutoIndentCB != NULL ); JXStaticText* spacesPerTabLabel = jnew JXStaticText(JGetString("spacesPerTabLabel::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,130, 210,20); assert( spacesPerTabLabel != NULL ); spacesPerTabLabel->SetToLabel(); itsExtraSpaceWindTitleCB = jnew JXTextCheckbox(JGetString("itsExtraSpaceWindTitleCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,310, 300,20); assert( itsExtraSpaceWindTitleCB != NULL ); itsOpenComplFileOnTopCB = jnew JXTextCheckbox(JGetString("itsOpenComplFileOnTopCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,280, 300,20); assert( itsOpenComplFileOnTopCB != NULL ); itsFontMenu = jnew JXChooseMonoFont(window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 280,60); assert( itsFontMenu != NULL ); itsEmulatorMenu = jnew JXTextMenu(JGetString("itsEmulatorMenu::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,90, 280,25); assert( itsEmulatorMenu != NULL ); JXStaticText* undoDepthLabel = jnew JXStaticText(JGetString("undoDepthLabel::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,170, 210,20); assert( undoDepthLabel != NULL ); undoDepthLabel->SetToLabel(); itsUseDNDCB = jnew JXTextCheckbox(JGetString("itsUseDNDCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,130, 280,20); assert( itsUseDNDCB != NULL ); itsOnlyBackupIfNoneCB = jnew JXTextCheckbox(JGetString("itsOnlyBackupIfNoneCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,250, 300,20); assert( itsOnlyBackupIfNoneCB != NULL ); itsLeftToFrontOfTextCB = jnew JXTextCheckbox(JGetString("itsLeftToFrontOfTextCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,450, 300,20); assert( itsLeftToFrontOfTextCB != NULL ); itsHelpButton = jnew JXTextButton(JGetString("itsHelpButton::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 130,490, 60,20); assert( itsHelpButton != NULL ); itsHelpButton->SetShortcuts(JGetString("itsHelpButton::CBEditTextPrefsDialog::shortcuts::JXLayout")); itsBalanceWhileTypingCB = jnew JXTextCheckbox(JGetString("itsBalanceWhileTypingCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,310, 280,20); assert( itsBalanceWhileTypingCB != NULL ); itsScrollToBalanceCB = jnew JXTextCheckbox(JGetString("itsScrollToBalanceCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,330, 280,20); assert( itsScrollToBalanceCB != NULL ); itsBeepWhenTypeUnbalancedCB = jnew JXTextCheckbox(JGetString("itsBeepWhenTypeUnbalancedCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,350, 280,20); assert( itsBeepWhenTypeUnbalancedCB != NULL ); JXStaticText* cpmLabel = jnew JXStaticText(JGetString("cpmLabel::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,150, 210,20); assert( cpmLabel != NULL ); cpmLabel->SetToLabel(); itsSmartTabCB = jnew JXTextCheckbox(JGetString("itsSmartTabCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,220, 280,20); assert( itsSmartTabCB != NULL ); itsPWModRG = jnew JXRadioGroup(window, JXWidget::kHElastic, JXWidget::kVElastic, 460,350, 160,80); assert( itsPWModRG != NULL ); JXTextRadioButton* ctrlMetaLabel = jnew JXTextRadioButton(JXTEBase::kCtrlMetaPWMod, JGetString("ctrlMetaLabel::CBEditTextPrefsDialog::JXLayout"), itsPWModRG, JXWidget::kHElastic, JXWidget::kVElastic, 10,10, 90,20); assert( ctrlMetaLabel != NULL ); JXTextRadioButton* mod2Label = jnew JXTextRadioButton(JXTEBase::kMod2PWMod, JGetString("mod2Label::CBEditTextPrefsDialog::JXLayout"), itsPWModRG, JXWidget::kHElastic, JXWidget::kVElastic, 10,30, 70,20); assert( mod2Label != NULL ); JXTextRadioButton* mod3Label = jnew JXTextRadioButton(JXTEBase::kMod3PWMod, JGetString("mod3Label::CBEditTextPrefsDialog::JXLayout"), itsPWModRG, JXWidget::kHElastic, JXWidget::kVElastic, 10,50, 70,20); assert( mod3Label != NULL ); JXTextRadioButton* mod4Label = jnew JXTextRadioButton(JXTEBase::kMod4PWMod, JGetString("mod4Label::CBEditTextPrefsDialog::JXLayout"), itsPWModRG, JXWidget::kHElastic, JXWidget::kVElastic, 90,30, 60,20); assert( mod4Label != NULL ); JXTextRadioButton* mod5Label = jnew JXTextRadioButton(JXTEBase::kMod5PWMod, JGetString("mod5Label::CBEditTextPrefsDialog::JXLayout"), itsPWModRG, JXWidget::kHElastic, JXWidget::kVElastic, 90,50, 60,20); assert( mod5Label != NULL ); JXStaticText* partialWordTitle = jnew JXStaticText(JGetString("partialWordTitle::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,360, 120,60); assert( partialWordTitle != NULL ); itsCopyWhenSelectCB = jnew JXTextCheckbox(JGetString("itsCopyWhenSelectCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,250, 280,20); assert( itsCopyWhenSelectCB != NULL ); itsColorButton[CBPrefsManager::kTextColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kTextColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 400,50, 40,20); assert( itsColorButton[CBPrefsManager::kTextColorIndex-1] != NULL ); itsColorButton[CBPrefsManager::kBackColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kBackColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 440,50, 80,20); assert( itsColorButton[CBPrefsManager::kBackColorIndex-1] != NULL ); JXStaticText* changeColorLabel = jnew JXStaticText(JGetString("changeColorLabel::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 310,50, 90,20); assert( changeColorLabel != NULL ); changeColorLabel->SetToLabel(); itsColorButton[CBPrefsManager::kSelColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kSelColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 560,50, 60,20); assert( itsColorButton[CBPrefsManager::kSelColorIndex-1] != NULL ); itsColorButton[CBPrefsManager::kSelLineColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kSelLineColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 400,70, 50,20); assert( itsColorButton[CBPrefsManager::kSelLineColorIndex-1] != NULL ); itsColorButton[CBPrefsManager::kCaretColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kCaretColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 520,50, 40,20); assert( itsColorButton[CBPrefsManager::kCaretColorIndex-1] != NULL ); itsDefColorsButton = jnew JXTextButton(JGetString("itsDefColorsButton::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 400,95, 100,20); assert( itsDefColorsButton != NULL ); itsInvColorsButton = jnew JXTextButton(JGetString("itsInvColorsButton::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 500,95, 100,20); assert( itsInvColorsButton != NULL ); JXStaticText* colorSetsLabel = jnew JXStaticText(JGetString("colorSetsLabel::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 310,95, 90,20); assert( colorSetsLabel != NULL ); colorSetsLabel->SetToLabel(); itsTabToSpacesCB = jnew JXTextCheckbox(JGetString("itsTabToSpacesCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,190, 280,20); assert( itsTabToSpacesCB != NULL ); itsHomeEndCB = jnew JXTextCheckbox(JGetString("itsHomeEndCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 330,470, 300,20); assert( itsHomeEndCB != NULL ); itsScrollCaretCB = jnew JXTextCheckbox(JGetString("itsScrollCaretCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 330,490, 300,20); assert( itsScrollCaretCB != NULL ); itsSortFnMenuCB = jnew JXTextCheckbox(JGetString("itsSortFnMenuCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,390, 280,20); assert( itsSortFnMenuCB != NULL ); itsPackFnMenuCB = jnew JXTextCheckbox(JGetString("itsPackFnMenuCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,430, 280,20); assert( itsPackFnMenuCB != NULL ); itsColorButton[CBPrefsManager::kRightMarginColorIndex-1] = jnew JXTextButton(JGetString("itsColorButton[CBPrefsManager::kRightMarginColorIndex-1]::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 450,70, 160,20); assert( itsColorButton[CBPrefsManager::kRightMarginColorIndex-1] != NULL ); itsRightMarginCB = jnew JXTextCheckbox(JGetString("itsRightMarginCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 330,190, 210,20); assert( itsRightMarginCB != NULL ); itsRightMarginInput = jnew JXIntegerInput(window, JXWidget::kHElastic, JXWidget::kVElastic, 540,190, 40,20); assert( itsRightMarginInput != NULL ); itsSampleText = jnew CBSampleText(window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 310,20, 310,25); assert( itsSampleText != NULL ); itsNSInFnMenuCB = jnew JXTextCheckbox(JGetString("itsNSInFnMenuCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 20,410, 280,20); assert( itsNSInFnMenuCB != NULL ); JXStaticText* wordWrapHint = jnew JXStaticText(JGetString("wordWrapHint::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kVElastic, 40,460, 250,20); assert( wordWrapHint != NULL ); wordWrapHint->SetFontSize(JGetDefaultFontSize()-2); wordWrapHint->SetToLabel(); itsMiddleButtonPasteCB = jnew JXTextCheckbox(JGetString("itsMiddleButtonPasteCB::CBEditTextPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,270, 280,20); assert( itsMiddleButtonPasteCB != NULL ); // end JXLayout window->SetTitle("Text Editor Preferences"); SetButtons(okButton, cancelButton); ListenTo(itsHelpButton); itsEmulatorMenu->SetMenuItems(kEmulatorMenuStr); itsEmulatorMenu->SetUpdateAction(JXMenu::kDisableNone); itsEmulatorMenu->SetToPopupChoice(kJTrue, itsEmulatorIndex); ListenTo(itsEmulatorMenu); itsCreateBackupCB->SetState(doc->WillMakeBackupFile()); itsOnlyBackupIfNoneCB->SetState(!doc->WillMakeNewBackupEveryOpen()); itsExtraSpaceWindTitleCB->SetState(doc->WillAllocateTitleSpace()); itsOpenComplFileOnTopCB->SetState(doc->WillOpenComplFileOnTop()); CBTextEditor* te = doc->GetTextEditor(); itsAutoIndentCB->SetState(te->WillAutoIndent()); itsUseDNDCB->SetState(te->CBAllowsDragAndDrop()); itsLeftToFrontOfTextCB->SetState(te->WillMoveToFrontOfText()); itsBalanceWhileTypingCB->SetState(te->WillBalanceWhileTyping()); itsScrollToBalanceCB->SetState(te->WillScrollToBalance()); itsBeepWhenTypeUnbalancedCB->SetState(te->WillBeepWhenTypeUnbalanced()); CBFnMenuUpdater* updater = CBGetFnMenuUpdater(); itsSortFnMenuCB->SetState(updater->WillSortFnNames()); itsNSInFnMenuCB->SetState(updater->WillIncludeNamespace()); itsPackFnMenuCB->SetState(updater->WillPackFnNames()); itsSmartTabCB->SetState(te->TabIsSmart()); itsTabToSpacesCB->SetState(te->TabInsertsSpaces()); itsCopyWhenSelectCB->SetState(te->WillCopyWhenSelect()); itsMiddleButtonPasteCB->SetState(te->MiddleButtonWillPaste()); const JFont& font = te->GetDefaultFont(); itsFontMenu->SetFont(font.GetName(), font.GetSize()); itsTabCharCountInput->SetValue(te->GetTabCharCount()); itsTabCharCountInput->SetLowerLimit(1); itsCRMLineWidthInput->SetValue(te->GetCRMLineWidth()); itsCRMLineWidthInput->SetLowerLimit(1); itsUndoDepthInput->SetValue(te->GetUndoDepth()); itsUndoDepthInput->SetLowerLimit(1); JSize margin; itsRightMarginCB->SetState(te->GetRightMarginWidth(&margin)); itsRightMarginInput->SetValue(margin); itsRightMarginInput->SetLowerLimit(1); itsPWModRG->SelectItem(te->GetPartialWordModifier()); itsHomeEndCB->SetState(JXTEBase::WillUseWindowsHomeEnd()); itsScrollCaretCB->SetState(CBTextEditor::CaretWillFollowScroll()); ListenTo(itsCreateBackupCB); ListenTo(itsBalanceWhileTypingCB); UpdateDisplay(); // must do this after SetWindow() CBPrefsManager* prefsMgr = CBGetPrefsManager(); JXColormap* colormap = GetColormap(); for (JIndex i=0; i<CBPrefsManager::kColorCount; i++) { itsColor[i] = prefsMgr->GetColor(i+1); ListenTo(itsColorButton[i]); } ListenTo(itsDefColorsButton); ListenTo(itsInvColorsButton); ListenTo(itsFontMenu); ListenTo(itsRightMarginCB); UpdateSampleText(); }
void JXSaveFileDialog::BuildWindow ( const JCharacter* origName, const JCharacter* prompt, const JCharacter* message ) { // begin JXLayout JXWindow* window = new JXWindow(this, 310,340, ""); assert( window != NULL ); JXScrollbarSet* scrollbarSet = new JXScrollbarSet(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,140, 180,140); assert( scrollbarSet != NULL ); JXTextButton* saveButton = new JXTextButton(JGetString("saveButton::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,280, 70,20); assert( saveButton != NULL ); saveButton->SetShortcuts(JGetString("saveButton::JXSaveFileDialog::shortcuts::JXLayout")); JXTextButton* cancelButton = new JXTextButton(JGetString("cancelButton::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,310, 70,20); assert( cancelButton != NULL ); JXTextButton* homeButton = new JXTextButton(JGetString("homeButton::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 250,140, 40,20); assert( homeButton != NULL ); JXStaticText* pathLabel = new JXStaticText(JGetString("pathLabel::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,20, 40,20); assert( pathLabel != NULL ); pathLabel->SetToLabel(); JXSaveFileInput* fileNameInput = new JXSaveFileInput(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,310, 180,20); assert( fileNameInput != NULL ); JXPathInput* pathInput = new JXPathInput(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,20, 200,20); assert( pathInput != NULL ); JXTextCheckbox* showHiddenCB = new JXTextCheckbox(JGetString("showHiddenCB::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 130,20); assert( showHiddenCB != NULL ); JXStaticText* promptLabel = new JXStaticText(JGetString("promptLabel::JXSaveFileDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,290, 180,20); assert( promptLabel != NULL ); promptLabel->SetToLabel(); JXStaticText* filterLabel = new JXStaticText(JGetString("filterLabel::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,50, 40,20); assert( filterLabel != NULL ); filterLabel->SetToLabel(); JXInputField* filterInput = new JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,50, 200,20); assert( filterInput != NULL ); JXPathHistoryMenu* pathHistory = new JXPathHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,20, 30,20); assert( pathHistory != NULL ); JXStringHistoryMenu* filterHistory = new JXStringHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,50, 30,20); assert( filterHistory != NULL ); JXTextButton* upButton = new JXTextButton(JGetString("upButton::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,140, 30,20); assert( upButton != NULL ); JXNewDirButton* newDirButton = new JXNewDirButton(window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,190, 70,20); assert( newDirButton != NULL ); JXCurrentPathMenu* currPathMenu = new JXCurrentPathMenu("/", window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,110, 180,20); assert( currPathMenu != NULL ); JXTextButton* desktopButton = new JXTextButton(JGetString("desktopButton::JXSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,160, 70,20); assert( desktopButton != NULL ); // end JXLayout SetObjects(scrollbarSet, promptLabel, prompt, fileNameInput, origName, pathLabel, pathInput, pathHistory, filterLabel, filterInput, filterHistory, saveButton, cancelButton, upButton, homeButton, desktopButton, newDirButton, showHiddenCB, currPathMenu, message); }
void JX2DPlotPrintEPSDialog::BuildWindow ( const JCharacter* fileName, const JBoolean printPreview, const JBoolean bw, const JCoordinate w, const JCoordinate h, const Unit unit ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 370,190, ""); assert( window != NULL ); JXTextButton* chooseFileButton = jnew JXTextButton(JGetString("chooseFileButton::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 80,20); assert( chooseFileButton != NULL ); chooseFileButton->SetShortcuts(JGetString("chooseFileButton::JX2DPlotPrintEPSDialog::shortcuts::JXLayout")); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 230,160, 70,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::JX2DPlotPrintEPSDialog::shortcuts::JXLayout")); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 80,160, 70,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::JX2DPlotPrintEPSDialog::shortcuts::JXLayout")); JXTextCheckbox* bwCB = jnew JXTextCheckbox(JGetString("bwCB::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 190,120, 150,20); assert( bwCB != NULL ); bwCB->SetShortcuts(JGetString("bwCB::JX2DPlotPrintEPSDialog::shortcuts::JXLayout")); JXTextCheckbox* previewCB = jnew JXTextCheckbox(JGetString("previewCB::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 30,120, 130,20); assert( previewCB != NULL ); previewCB->SetShortcuts(JGetString("previewCB::JX2DPlotPrintEPSDialog::shortcuts::JXLayout")); JXFileInput* fileInput = jnew JXFileInput(window, JXWidget::kHElastic, JXWidget::kFixedTop, 100,20, 250,20); assert( fileInput != NULL ); itsWidthInput = jnew JXFloatInput(window, JXWidget::kHElastic, JXWidget::kFixedTop, 70,60, 60,20); assert( itsWidthInput != NULL ); itsHeightInput = jnew JXFloatInput(window, JXWidget::kHElastic, JXWidget::kFixedTop, 70,80, 60,20); assert( itsHeightInput != NULL ); JXStaticText* widthLabel = jnew JXStaticText(JGetString("widthLabel::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 50,20); assert( widthLabel != NULL ); widthLabel->SetToLabel(); JXStaticText* heightLabel = jnew JXStaticText(JGetString("heightLabel::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,80, 50,20); assert( heightLabel != NULL ); heightLabel->SetToLabel(); itsUnitMenu = jnew JXTextMenu(JGetString("itsUnitMenu::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 130,70, 60,20); assert( itsUnitMenu != NULL ); itsPredefSizeMenu = jnew JXTextMenu(JGetString("itsPredefSizeMenu::JX2DPlotPrintEPSDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 220,65, 120,30); assert( itsPredefSizeMenu != NULL ); // end JXLayout // size itsWidthInput->SetValue(w); itsWidthInput->SetLowerLimit(0.01); itsHeightInput->SetValue(h); itsHeightInput->SetLowerLimit(0.01); // unit itsUnit = kPixels; HandleUnitMenu(unit); itsUnitMenu->SetMenuItems(kUnitMenuStr); itsUnitMenu->SetUpdateAction(JXMenu::kDisableNone); itsUnitMenu->SetToPopupChoice(kJTrue, unit); ListenTo(itsUnitMenu); // predefined sizes itsPredefSizeMenu->SetMenuItems(kPredefSizeMenuStr); itsPredefSizeMenu->SetUpdateAction(JXMenu::kDisableNone); ListenTo(itsPredefSizeMenu); // last, because file chooser may open, and that runs FTC SetObjects(okButton, cancelButton, fileInput, fileName, chooseFileButton, previewCB, printPreview, bwCB, bw); }
void SyGChoosePathDialog::BuildWindow ( const JBoolean newWindow, const JCharacter* message ) { // begin JXLayout JXWindow* window = new JXWindow(this, 310,400, ""); assert( window != NULL ); JXTextButton* cancelButton = new JXTextButton(JGetString("cancelButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,310, 70,20); assert( cancelButton != NULL ); cancelButton->SetShortcuts(JGetString("cancelButton::SyGChoosePathDialog::shortcuts::JXLayout")); JXTextButton* homeButton = new JXTextButton(JGetString("homeButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 250,140, 40,20); assert( homeButton != NULL ); homeButton->SetShortcuts(JGetString("homeButton::SyGChoosePathDialog::shortcuts::JXLayout")); JXStaticText* pathLabel = new JXStaticText(JGetString("pathLabel::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,20, 40,20); assert( pathLabel != NULL ); pathLabel->SetToLabel(); JXScrollbarSet* scrollbarSet = new JXScrollbarSet(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,140, 180,190); assert( scrollbarSet != NULL ); itsSelectButton = new JXTextButton(JGetString("itsSelectButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,250, 70,20); assert( itsSelectButton != NULL ); itsSelectButton->SetShortcuts(JGetString("itsSelectButton::SyGChoosePathDialog::shortcuts::JXLayout")); JXPathInput* pathInput = new JXPathInput(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,20, 200,20); assert( pathInput != NULL ); JXTextCheckbox* showHiddenCB = new JXTextCheckbox(JGetString("showHiddenCB::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 130,20); assert( showHiddenCB != NULL ); showHiddenCB->SetShortcuts(JGetString("showHiddenCB::SyGChoosePathDialog::shortcuts::JXLayout")); JXStaticText* filterLabel = new JXStaticText(JGetString("filterLabel::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,50, 40,20); assert( filterLabel != NULL ); filterLabel->SetToLabel(); JXInputField* filterInput = new JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,50, 200,20); assert( filterInput != NULL ); JXStaticText* explanText = new JXStaticText(JGetString("explanText::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,340, 270,20); assert( explanText != NULL ); explanText->SetToLabel(); JXPathHistoryMenu* pathHistory = new JXPathHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,20, 30,20); assert( pathHistory != NULL ); JXStringHistoryMenu* filterHistory = new JXStringHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,50, 30,20); assert( filterHistory != NULL ); JXTextButton* upButton = new JXTextButton(JGetString("upButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,140, 30,20); assert( upButton != NULL ); upButton->SetShortcuts(JGetString("upButton::SyGChoosePathDialog::shortcuts::JXLayout")); JXNewDirButton* newDirButton = new JXNewDirButton(window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,190, 70,20); assert( newDirButton != NULL ); itsNewWindowCB = new JXTextCheckbox(JGetString("itsNewWindowCB::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,370, 150,20); assert( itsNewWindowCB != NULL ); itsNewWindowCB->SetShortcuts(JGetString("itsNewWindowCB::SyGChoosePathDialog::shortcuts::JXLayout")); JXCurrentPathMenu* currPathMenu = new JXCurrentPathMenu("/", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 20,110, 180,20); assert( currPathMenu != NULL ); itsOpenButton = new JXTextButton(JGetString("itsOpenButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,280, 70,20); assert( itsOpenButton != NULL ); itsOpenButton->SetShortcuts(JGetString("itsOpenButton::SyGChoosePathDialog::shortcuts::JXLayout")); JXTextButton* desktopButton = new JXTextButton(JGetString("desktopButton::SyGChoosePathDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,160, 70,20); assert( desktopButton != NULL ); // end JXLayout itsNewWindowCB->SetState(newWindow); SetObjects(scrollbarSet, pathLabel, pathInput, pathHistory, filterLabel, filterInput, filterHistory, itsOpenButton, itsSelectButton, cancelButton, upButton, homeButton, desktopButton, newDirButton, showHiddenCB, currPathMenu, message); }
void JXEditWWWPrefsDialog::BuildWindow ( const JCharacter* showURLCmd, const JCharacter* showFileContentCmd, const JCharacter* showFileLocationCmd, const JCharacter* composeMailCmd ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 520,290, ""); assert( window != NULL ); itsShowURLCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 250,20, 250,20); assert( itsShowURLCmdInput != NULL ); itsShowFileContentCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 250,80, 250,20); assert( itsShowFileContentCmdInput != NULL ); itsShowFileLocationCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 250,140, 250,20); assert( itsShowFileLocationCmdInput != NULL ); itsComposeMailCmdInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 250,200, 250,20); assert( itsComposeMailCmdInput != NULL ); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 120,260, 70,20); assert( cancelButton != NULL ); JXTextButton* okButton = jnew JXTextButton(JGetString("okButton::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 330,260, 70,20); assert( okButton != NULL ); okButton->SetShortcuts(JGetString("okButton::JXEditWWWPrefsDialog::shortcuts::JXLayout")); JXStaticText* urlVarHint = jnew JXStaticText(JGetString("urlVarHint::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,40, 250,20); assert( urlVarHint != NULL ); urlVarHint->SetToLabel(); JXStaticText* urlLabel = jnew JXStaticText(JGetString("urlLabel::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 230,20); assert( urlLabel != NULL ); urlLabel->SetToLabel(); JXStaticText* mailLabel = jnew JXStaticText(JGetString("mailLabel::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,200, 230,20); assert( mailLabel != NULL ); mailLabel->SetToLabel(); JXStaticText* mailVarHint = jnew JXStaticText(JGetString("mailVarHint::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,220, 250,20); assert( mailVarHint != NULL ); mailVarHint->SetToLabel(); JXStaticText* file1VarHint = jnew JXStaticText(JGetString("file1VarHint::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,100, 250,20); assert( file1VarHint != NULL ); file1VarHint->SetToLabel(); JXStaticText* file1Label = jnew JXStaticText(JGetString("file1Label::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,80, 230,20); assert( file1Label != NULL ); file1Label->SetToLabel(); JXStaticText* file2VarHint = jnew JXStaticText(JGetString("file2VarHint::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 250,160, 250,20); assert( file2VarHint != NULL ); file2VarHint->SetToLabel(); JXStaticText* file2Label = jnew JXStaticText(JGetString("file2Label::JXEditWWWPrefsDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,140, 230,20); assert( file2Label != NULL ); file2Label->SetToLabel(); // end JXLayout window->SetTitle("Web Browser Preferences"); SetButtons(okButton, cancelButton); const JFont& font = (window->GetFontManager())->GetDefaultMonospaceFont(); itsShowURLCmdInput->SetText(showURLCmd); itsShowURLCmdInput->SetIsRequired(); itsShowURLCmdInput->SetFont(font); itsShowFileContentCmdInput->SetText(showFileContentCmd); itsShowFileContentCmdInput->SetIsRequired(); itsShowFileContentCmdInput->SetFont(font); itsShowFileLocationCmdInput->SetText(showFileLocationCmd); itsShowFileLocationCmdInput->SetIsRequired(); itsShowFileLocationCmdInput->SetFont(font); itsComposeMailCmdInput->SetText(composeMailCmd); itsComposeMailCmdInput->SetIsRequired(); itsComposeMailCmdInput->SetFont(font); }
void CBNewProjectSaveFileDialog::BuildWindow ( const JCharacter* origName, const JCharacter* prompt, const JCharacter* message ) { // begin JXLayout JXWindow* window = jnew JXWindow(this, 310,500, ""); assert( window != NULL ); JXScrollbarSet* scrollbarSet = jnew JXScrollbarSet(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,140, 180,140); assert( scrollbarSet != NULL ); JXTextButton* saveButton = jnew JXTextButton(JGetString("saveButton::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,280, 70,20); assert( saveButton != NULL ); saveButton->SetShortcuts(JGetString("saveButton::CBNewProjectSaveFileDialog::shortcuts::JXLayout")); JXTextButton* cancelButton = jnew JXTextButton(JGetString("cancelButton::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,310, 70,20); assert( cancelButton != NULL ); JXTextButton* homeButton = jnew JXTextButton(JGetString("homeButton::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 250,140, 40,20); assert( homeButton != NULL ); JXStaticText* pathLabel = jnew JXStaticText(JGetString("pathLabel::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,20, 40,20); assert( pathLabel != NULL ); pathLabel->SetToLabel(); JXSaveFileInput* fileNameInput = jnew JXSaveFileInput(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,310, 180,20); assert( fileNameInput != NULL ); JXPathInput* pathInput = jnew JXPathInput(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,20, 200,20); assert( pathInput != NULL ); JXTextCheckbox* showHiddenCB = jnew JXTextCheckbox(JGetString("showHiddenCB::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 130,20); assert( showHiddenCB != NULL ); JXStaticText* promptLabel = jnew JXStaticText(JGetString("promptLabel::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,290, 180,20); assert( promptLabel != NULL ); promptLabel->SetToLabel(); JXStaticText* filterLabel = jnew JXStaticText(JGetString("filterLabel::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,50, 40,20); assert( filterLabel != NULL ); filterLabel->SetToLabel(); JXInputField* filterInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedBottom, 60,50, 200,20); assert( filterInput != NULL ); JXStaticText* makefileTitle = jnew JXStaticText(JGetString("makefileTitle::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 20,420, 140,20); assert( makefileTitle != NULL ); makefileTitle->SetToLabel(); itsMethodRG = jnew JXRadioGroup(window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 160,390, 132,106); assert( itsMethodRG != NULL ); JXTextRadioButton* manualRB = jnew JXTextRadioButton(CBBuildManager::kManual, JGetString("manualRB::CBNewProjectSaveFileDialog::JXLayout"), itsMethodRG, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,10, 110,20); assert( manualRB != NULL ); JXTextRadioButton* qmakeRB = jnew JXTextRadioButton(CBBuildManager::kQMake, JGetString("qmakeRB::CBNewProjectSaveFileDialog::JXLayout"), itsMethodRG, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,70, 110,20); assert( qmakeRB != NULL ); JXTextRadioButton* makemakeRB = jnew JXTextRadioButton(CBBuildManager::kMakemake, JGetString("makemakeRB::CBNewProjectSaveFileDialog::JXLayout"), itsMethodRG, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,30, 110,20); assert( makemakeRB != NULL ); JXPathHistoryMenu* pathHistory = jnew JXPathHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,20, 30,20); assert( pathHistory != NULL ); JXStringHistoryMenu* filterHistory = jnew JXStringHistoryMenu(1, "", window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 260,50, 30,20); assert( filterHistory != NULL ); JXTextButton* upButton = jnew JXTextButton(JGetString("upButton::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,140, 30,20); assert( upButton != NULL ); JXNewDirButton* newDirButton = jnew JXNewDirButton(window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,190, 70,20); assert( newDirButton != NULL ); JXCurrentPathMenu* currPathMenu = jnew JXCurrentPathMenu("/", window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,110, 180,20); assert( currPathMenu != NULL ); itsTemplateMenu = jnew JXTextMenu(JGetString("itsTemplateMenu::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedBottom, 20,350, 270,30); assert( itsTemplateMenu != NULL ); JXTextRadioButton* cmakeRB = jnew JXTextRadioButton(CBBuildManager::kCMake, JGetString("cmakeRB::CBNewProjectSaveFileDialog::JXLayout"), itsMethodRG, JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,50, 110,20); assert( cmakeRB != NULL ); JXTextButton* desktopButton = jnew JXTextButton(JGetString("desktopButton::CBNewProjectSaveFileDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedBottom, 220,160, 70,20); assert( desktopButton != NULL ); // end JXLayout SetObjects(scrollbarSet, promptLabel, prompt, fileNameInput, origName, pathLabel, pathInput, pathHistory, filterLabel, filterInput, filterHistory, saveButton, cancelButton, upButton, homeButton, desktopButton, newDirButton, showHiddenCB, currPathMenu, message); itsMethodRG->SelectItem(itsMakefileMethod); }
void CBSearchTextDialog::BuildWindow() { // begin JXLayout JXWindow* window = jnew JXWindow(this, 450,470, ""); assert( window != NULL ); JXStaticText* replaceLabel = jnew JXStaticText(JGetString("replaceLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,101, 220,20); assert( replaceLabel != NULL ); replaceLabel->SetToLabel(); JXStaticText* searchLabel = jnew JXStaticText(JGetString("searchLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,31, 220,20); assert( searchLabel != NULL ); searchLabel->SetToLabel(); JXInputField* searchInput = jnew JXInputField(kJTrue, kJFalse, window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,50, 220,40); assert( searchInput != NULL ); JXInputField* replaceInput = jnew JXInputField(kJTrue, kJFalse, window, JXWidget::kHElastic, JXWidget::kFixedTop, 20,120, 220,40); assert( replaceInput != NULL ); JXTextButton* closeButton = jnew JXTextButton(JGetString("closeButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 320,440, 80,20); assert( closeButton != NULL ); JXTextCheckbox* ignoreCaseCB = jnew JXTextCheckbox(JGetString("ignoreCaseCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,180, 130,20); assert( ignoreCaseCB != NULL ); JXTextCheckbox* wrapSearchCB = jnew JXTextCheckbox(JGetString("wrapSearchCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,240, 130,20); assert( wrapSearchCB != NULL ); JXTextButton* replaceButton = jnew JXTextButton(JGetString("replaceButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 300,50, 140,20); assert( replaceButton != NULL ); JXTextCheckbox* entireWordCB = jnew JXTextCheckbox(JGetString("entireWordCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,210, 130,20); assert( entireWordCB != NULL ); JXStringHistoryMenu* prevReplaceMenu = jnew JXStringHistoryMenu(kHistoryLength, "", window, JXWidget::kFixedRight, JXWidget::kFixedTop, 250,130, 30,20); assert( prevReplaceMenu != NULL ); JXStringHistoryMenu* prevSearchMenu = jnew JXStringHistoryMenu(kHistoryLength, "", window, JXWidget::kFixedRight, JXWidget::kFixedTop, 250,60, 30,20); assert( prevSearchMenu != NULL ); JXTextButton* helpButton = jnew JXTextButton(JGetString("helpButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,440, 80,20); assert( helpButton != NULL ); helpButton->SetShortcuts(JGetString("helpButton::CBSearchTextDialog::shortcuts::JXLayout")); JXTextCheckbox* searchIsRegexCB = jnew JXTextCheckbox(JGetString("searchIsRegexCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,180, 150,20); assert( searchIsRegexCB != NULL ); JXTextCheckbox* replaceIsRegexCB = jnew JXTextCheckbox(JGetString("replaceIsRegexCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 320,180, 110,20); assert( replaceIsRegexCB != NULL ); JXTextCheckbox* singleLineCB = jnew JXTextCheckbox(JGetString("singleLineCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,210, 150,20); assert( singleLineCB != NULL ); JXTextCheckbox* preserveCaseCB = jnew JXTextCheckbox(JGetString("preserveCaseCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 320,210, 110,20); assert( preserveCaseCB != NULL ); JXTextButton* qRefButton = jnew JXTextButton(JGetString("qRefButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedBottom, 190,440, 80,20); assert( qRefButton != NULL ); itsMultifileCB = jnew JXTextCheckbox(JGetString("itsMultifileCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,360, 100,20); assert( itsMultifileCB != NULL ); itsMultifileCB->SetShortcuts(JGetString("itsMultifileCB::CBSearchTextDialog::shortcuts::JXLayout")); JXScrollbarSet* scrollbarSet = jnew JXScrollbarSet(window, JXWidget::kHElastic, JXWidget::kVElastic, 140,360, 300,60); assert( scrollbarSet != NULL ); JXStaticText* findLabel = jnew JXStaticText(JGetString("findLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 320,20, 100,20); assert( findLabel != NULL ); findLabel->SetToLabel(kJTrue); JXSearchTextButton* findBackButton = jnew JXSearchTextButton(kJFalse, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 300,20, 20,20); assert( findBackButton != NULL ); JXSearchTextButton* findFwdButton = jnew JXSearchTextButton(kJTrue, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 420,20, 20,20); assert( findFwdButton != NULL ); JXStaticText* replaceFindLabel = jnew JXStaticText(JGetString("replaceFindLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 320,80, 100,20); assert( replaceFindLabel != NULL ); replaceFindLabel->SetToLabel(kJTrue); JXSearchTextButton* replaceFindBackButton = jnew JXSearchTextButton(kJFalse, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 300,80, 20,20); assert( replaceFindBackButton != NULL ); JXSearchTextButton* replaceFindFwdButton = jnew JXSearchTextButton(kJTrue, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 420,80, 20,20); assert( replaceFindFwdButton != NULL ); JXStaticText* replaceAllLabel = jnew JXStaticText(JGetString("replaceAllLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 320,110, 100,20); assert( replaceAllLabel != NULL ); replaceAllLabel->SetToLabel(kJTrue); JXSearchTextButton* replaceAllBackButton = jnew JXSearchTextButton(kJFalse, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 300,110, 20,20); assert( replaceAllBackButton != NULL ); JXSearchTextButton* replaceAllFwdButton = jnew JXSearchTextButton(kJTrue, window, JXWidget::kFixedRight, JXWidget::kFixedTop, 420,110, 20,20); assert( replaceAllFwdButton != NULL ); JXTextButton* replaceAllInSelButton = jnew JXTextButton(JGetString("replaceAllInSelButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 300,140, 140,20); assert( replaceAllInSelButton != NULL ); JXTextCheckbox* stayOpenCB = jnew JXTextCheckbox(JGetString("stayOpenCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 160,240, 150,20); assert( stayOpenCB != NULL ); JXTextCheckbox* retainFocusCB = jnew JXTextCheckbox(JGetString("retainFocusCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 320,240, 110,20); assert( retainFocusCB != NULL ); itsFileListMenu = jnew JXTextMenu(JGetString("itsFileListMenu::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 30,390, 90,30); assert( itsFileListMenu != NULL ); itsSearchDirCB = jnew JXTextCheckbox(JGetString("itsSearchDirCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,270, 130,20); assert( itsSearchDirCB != NULL ); itsSearchDirCB->SetShortcuts(JGetString("itsSearchDirCB::CBSearchTextDialog::shortcuts::JXLayout")); itsDirInput = jnew JXPathInput(window, JXWidget::kHElastic, JXWidget::kFixedTop, 150,270, 190,20); assert( itsDirInput != NULL ); JXStaticText* filterLabel = jnew JXStaticText(JGetString("filterLabel::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 50,300, 100,20); assert( filterLabel != NULL ); filterLabel->SetToLabel(); itsDirHistory = jnew CBSearchPathHistoryMenu(kHistoryLength, "", window, JXWidget::kFixedRight, JXWidget::kFixedTop, 340,270, 30,20); assert( itsDirHistory != NULL ); itsFileFilterInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 150,300, 190,20); assert( itsFileFilterInput != NULL ); itsFileFilterHistory = jnew CBSearchFilterHistoryMenu(kHistoryLength, "", window, JXWidget::kFixedRight, JXWidget::kFixedTop, 340,300, 30,20); assert( itsFileFilterHistory != NULL ); itsRecurseDirCB = jnew JXTextCheckbox(JGetString("itsRecurseDirCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 40,330, 215,20); assert( itsRecurseDirCB != NULL ); itsChooseDirButton = jnew JXTextButton(JGetString("itsChooseDirButton::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 380,270, 60,20); assert( itsChooseDirButton != NULL ); itsInvertFileFilterCB = jnew JXTextCheckbox(JGetString("itsInvertFileFilterCB::CBSearchTextDialog::JXLayout"), window, JXWidget::kFixedRight, JXWidget::kFixedTop, 380,300, 60,20); assert( itsInvertFileFilterCB != NULL ); itsPathFilterInput = jnew JXInputField(window, JXWidget::kHElastic, JXWidget::kFixedTop, 255,330, 155,20); assert( itsPathFilterInput != NULL ); itsPathFilterHistory = jnew CBSearchFilterHistoryMenu(kHistoryLength, "", window, JXWidget::kFixedRight, JXWidget::kFixedTop, 410,330, 30,20); assert( itsPathFilterHistory != NULL ); // end JXLayout SetObjects(searchInput, prevSearchMenu, ignoreCaseCB, entireWordCB, wrapSearchCB, searchIsRegexCB, singleLineCB, replaceInput, prevReplaceMenu, replaceIsRegexCB, preserveCaseCB, stayOpenCB, retainFocusCB, findFwdButton, findBackButton, replaceButton, replaceFindFwdButton, replaceFindBackButton, replaceAllFwdButton, replaceAllBackButton, replaceAllInSelButton, closeButton, helpButton, qRefButton); ListenTo(itsSearchDirCB); ListenTo(itsDirInput); ListenTo(itsMultifileCB); itsFileList = jnew JXFileListTable(scrollbarSet, scrollbarSet->GetScrollEnclosure(), JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 10,10); assert( itsFileList != NULL ); itsFileList->FitToEnclosure(); itsFileList->ShouldAcceptFileDrop(); itsFileList->BackspaceShouldRemoveSelectedFiles(); ListenTo(itsFileList); itsFileListMenu->SetMenuItems(kFileListMenuStr, "CBSearchTextDialog"); ListenTo(itsFileListMenu); ListenTo(itsChooseDirButton); ListenTo(itsDirHistory); ListenTo(itsFileFilterHistory); ListenTo(itsPathFilterHistory); const JFont& font = window->GetFontManager()->GetDefaultMonospaceFont(); itsDirInput->ShouldAllowInvalidPath(); itsDirHistory->SetDefaultFont(font, kJTrue); itsFileFilterInput->SetDefaultFont(font); itsFileFilterHistory->SetDefaultFont(font, kJTrue); itsPathFilterInput->SetDefaultFont(font); itsPathFilterHistory->SetDefaultFont(font, kJTrue); itsRecurseDirCB->SetState(kJTrue); UpdateBasePath(); ListenTo(CBGetDocumentManager()); CBPrefsManager* prefsMgr = CBGetPrefsManager(); JPrefObject::ReadPrefs(); JString fontName; JSize fontSize; prefsMgr->GetDefaultFont(&fontName, &fontSize); SetFont(fontName, fontSize); searchInput->SetCharacterInWordFunction(CBMIsCharacterInWord); replaceInput->SetCharacterInWordFunction(CBMIsCharacterInWord); // create hidden JXDocument so Meta-# shortcuts work JXDocumentMenu* fileListMenu = jnew JXDocumentMenu("", window, JXWidget::kFixedLeft, JXWidget::kFixedTop, 0,-20, 10,10); assert( fileListMenu != NULL ); // decor const JRect wFrame = window->GetFrame(); const JRect cbFrame = itsSearchDirCB->GetFrame(); JXDownRect* line = jnew JXDownRect(window, JXWidget::kFixedLeft, JXWidget::kFixedTop, cbFrame.left, cbFrame.top-6, wFrame.right-10-cbFrame.left, 2); assert( line != NULL ); line->SetBorderWidth(1); }
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 itsFileMenu = menuBar->PrependTextMenu(kFileMenuTitleStr); itsFileMenu->SetMenuItems(kFileMenuStr, "CMThreadsDir"); itsFileMenu->SetUpdateAction(JXMenu::kDisableNone); ListenTo(itsFileMenu); itsFileMenu->SetItemImage(kOpenCmd, jx_file_open); JXTEBase* te = itsWidget->GetEditMenuHandler(); itsExprInput->ShareEditMenu(te); itsStartIndex->ShareEditMenu(te); itsEndIndex->ShareEditMenu(te); itsActionMenu = menuBar->AppendTextMenu(kActionMenuTitleStr); menuBar->InsertMenu(3, itsActionMenu); itsActionMenu->SetMenuItems(kActionMenuStr, "CMArray1DDir"); 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, "CMArray1DDir"); itsHelpMenu->SetUpdateAction(JXMenu::kDisableNone); ListenTo(itsHelpMenu); itsHelpMenu->SetItemImage(kTOCCmd, jx_help_toc); itsHelpMenu->SetItemImage(kThisWindowCmd, jx_help_specific); (GetDisplay()->GetWDManager())->DirectorCreated(this); }