FXCY_ReaderView::FXCY_ReaderView(FXComposite *p, FXuint opts, FXint x, FXint y, FXint w, FXint h) :FXHorizontalFrame(p, opts, x, y, w, h) ,m_readerList(NULL){ FXVerticalFrame *vf; #ifndef DISABLE_FLASHING FXButton *btn; #endif m_readerList=new FXCY_ReaderList(this, this, ID_READER_LIST, LAYOUT_FILL_X | LAYOUT_FILL_Y | ICONLIST_BROWSESELECT | /*ICONLIST_DETAILED |*/ ICONLIST_BIG_ICONS | ICONLIST_COLUMNS); vf=new FXVerticalFrame(this, LAYOUT_FILL_Y | PACK_UNIFORM_WIDTH | PACK_UNIFORM_HEIGHT); new FXButton(vf, "Details", NULL, this, ID_BUTTON_DETAILS, BUTTON_NORMAL); new FXButton(vf, "Test", NULL, this, ID_BUTTON_TEST, BUTTON_NORMAL); #ifdef HAVE_LIBXML2 new FXButton(vf, "Firmware\naktualisieren", NULL, this, ID_BUTTON_FIRMWARE, BUTTON_NORMAL); #endif #ifndef DISABLE_FLASHING btn=new FXButton(vf, "Schluessel\naktualisieren", NULL, this, ID_BUTTON_UPD_KEYS, BUTTON_NORMAL); btn->setTipText("Aktualisiert die Schluessel im Leser (nur neuere cyberJacks)"); btn=new FXButton(vf, "Alle Module\nentfernen", NULL, this, ID_BUTTON_DEL_MODS, BUTTON_NORMAL); btn->setTipText("Entfernt alle Module (nur neuere cyberJacks)"); btn=new FXButton(vf, "Modul\ninstallieren", NULL, this, ID_BUTTON_FLASH, BUTTON_NORMAL); btn->setTipText("Installiert ein neues Modul auf dem Leser (nur neuere cyberJacks)"); #endif }
// Construct free-floating window CommandWindow::CommandWindow(FXApp* a, const FXString& name, FXString strcmd, int nblines, int nbcols) : DialogBox(a, name, DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE|DECOR_MAXIMIZE|DECOR_MINIMIZE|DECOR_CLOSE, 0, 0, 0, 0, 6, 6, 6, 6, 4, 4) { // Get command to execute command = strcmd; // Bottom part FXHorizontalFrame* buttonbox = new FXHorizontalFrame(this, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH); new FXButton(buttonbox, _("Cl&ose"), NULL, this, ID_CLOSE, BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20, 5, 5); FXButton* cancelbutton = new FXButton(buttonbox, _("&Cancel"), NULL, this, ID_KILLPROCESS, BUTTON_INITIAL|BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK, 0, 0, 0, 0, 20, 20, 5, 5); // Text part FXHorizontalFrame* textbox = new FXHorizontalFrame(this, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN, 0, 0, 0, 0, 0, 0, 0, 0); text = new FXText(textbox, NULL, 0, TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y); text->setVisibleRows(nblines); text->setVisibleColumns(nbcols); appendText(_("Please wait...\n\n")); cancelbutton->setFocus(); // Initialize variables pid = -1; killed = false; closed = false; }
void fx_disp_fb_window::add_dispersion_element() { int n = disp->disp.fb.n; disp_add_osc(disp); FXButton *db = new FXButton(matrix, "", regressProApp()->delete_icon, this, ID_DISP_ELEMENT_DELETE + n, FRAME_SUNKEN); db->create(); for (int j = 3*n; j < 3*(n+1); j++) { FXTextField *tf = create_textfield(matrix, this, ID_PARAM_0 + j + 2); tf->create(); } matrix->childAtRowCol(1, 0)->enable(); vframe->recalc(); }
// Update close button long CommandWindow::onUpdClose(FXObject* sender, FXSelector, void*) { FXButton* btn = (FXButton*)sender; if (!getApp()->hasChore(this, ID_WATCHPROCESS)) { btn->enable(); } else { btn->disable(); } return(1); }
void fx_disp_lookup_window::add_matrix_component(int index, bool create) { FXString istr; istr.format("%d", index + 1); FXButton *db = new FXButton(matrix, istr, NULL, this, ID_MENU_COMPONENT + index, FRAME_SUNKEN); FXTextField *tf1 = new FXTextField(matrix, 24, this, ID_COMPONENT_NAME + index, FRAME_SUNKEN); tf1->setText(CSTR(disp->disp.lookup.component[index].disp->name)); FXTextField *tf2 = create_textfield(matrix, this, ID_PARAM_0 + 1 + index); if (create) { db->create(); tf1->create(); tf2->create(); } }
// =========================================================================== // method definitions // =========================================================================== GUIDialog_EditViewport::GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, SUMOReal zoom, SUMOReal xoff, SUMOReal yoff, int x, int y) throw() : FXDialogBox(parent, name, DECOR_TITLE|DECOR_BORDER, x, y, 0, 0), myParent(parent), myOldZoom(zoom), myOldXOff(xoff), myOldYOff(yoff) { FXVerticalFrame *f1 = new FXVerticalFrame(this, LAYOUT_TOP|FRAME_NONE|LAYOUT_FILL_X, 0,0,0,0, 0,0,1,1); { FXHorizontalFrame *frame0 = new FXHorizontalFrame(f1,FRAME_THICK, 0,0,0,0, 0,0,0,0, 2,2); new FXButton(frame0,"\t\tLoad viewport from file", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, GUIDialog_EditViewport::MID_LOAD, ICON_ABOVE_TEXT|BUTTON_TOOLBAR|FRAME_RAISED|LAYOUT_TOP|LAYOUT_LEFT); new FXButton(frame0,"\t\tSave viewport to file", GUIIconSubSys::getIcon(ICON_SAVE), this, GUIDialog_EditViewport::MID_SAVE, ICON_ABOVE_TEXT|BUTTON_TOOLBAR|FRAME_RAISED|LAYOUT_TOP|LAYOUT_LEFT); } FXMatrix *m1 = new FXMatrix(f1, 2, MATRIX_BY_COLUMNS); { new FXLabel(m1, "Zoom:", 0, LAYOUT_CENTER_Y); myZoom = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y|LAYOUT_TOP|FRAME_SUNKEN|FRAME_THICK); myZoom->setRange(0.0001, 100000); myZoom->setNumberFormat(4); myZoom->setValue(zoom); } { new FXLabel(m1, "X Offset:", 0, LAYOUT_CENTER_Y); myXOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y|LAYOUT_TOP|FRAME_SUNKEN|FRAME_THICK); myXOff->setRange(-1000000, 1000000); myXOff->setNumberFormat(4); myXOff->setValue(xoff); } { new FXLabel(m1, "Y Offset:", 0, LAYOUT_CENTER_Y); myYOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y|LAYOUT_TOP|FRAME_SUNKEN|FRAME_THICK); myYOff->setRange(-1000000, 1000000); myYOff->setNumberFormat(4); myYOff->setValue(yoff); } // ok/cancel new FXHorizontalSeparator(f1,SEPARATOR_GROOVE|LAYOUT_FILL_X); FXHorizontalFrame *f6 = new FXHorizontalFrame(f1, LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH, 0,0,0,0, 10,10,5,0); FXButton *initial = new FXButton(f6, "&OK", NULL, this, GUIDialog_EditViewport::MID_OK, BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0,0,0,0, 4,4,3,3); new FXButton(f6,"&Cancel", NULL, this, GUIDialog_EditViewport::MID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0,0,0,0, 4,4,3,3); initial->setFocus(); setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); }
// Create message box ExecuteBox::ExecuteBox(FXWindow* win, const FXString& name, const FXString& text, FXuint opts, int x, int y) : DialogBox(win, name, opts|DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE, x, y, 0, 0) { FXVerticalFrame* content = new FXVerticalFrame(this, LAYOUT_FILL_X|LAYOUT_FILL_Y); FXHorizontalFrame* info = new FXHorizontalFrame(content, LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 10, 10); new FXLabel(info, FXString::null, questionbigicon, ICON_BEFORE_TEXT|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y); new FXLabel(info, text, NULL, JUSTIFY_LEFT|ICON_BEFORE_TEXT|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y); FXHorizontalFrame* buttons = new FXHorizontalFrame(content, LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 10, 10); FXButton* cancel = new FXButton(buttons, _("&Cancel"), NULL, this, ID_CLICKED_CANCEL, BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0, 0, 0, 0, HORZ_PAD, HORZ_PAD, VERT_PAD, VERT_PAD); new FXButton(buttons, _("E&xecute"), NULL, this, ID_CLICKED_EXECUTE, FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0, 0, 0, 0, HORZ_PAD, HORZ_PAD, VERT_PAD, VERT_PAD); new FXButton(buttons, _("Execute in Console &Mode"), NULL, this, ID_CLICKED_CONSOLE, FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0, 0, 0, 0, HORZ_PAD, HORZ_PAD, VERT_PAD, VERT_PAD); new FXButton(buttons, _("&Edit"), NULL, this, ID_CLICKED_EDIT, FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X, 0, 0, 0, 0, HORZ_PAD, HORZ_PAD, VERT_PAD, VERT_PAD); cancel->setFocus(); }
// =========================================================================== // method definitions // =========================================================================== GNEDialog_About::GNEDialog_About(FXWindow* parent) : FXDialogBox(parent, "About Eclipse SUMO netedit", GUIDesignDialogBox) { // set dialog icon setIcon(GUIIconSubSys::getIcon(ICON_NETEDIT)); // create frame for main info FXHorizontalFrame* mainInfoFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); // Netedit icon new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(ICON_NETEDIT), GUIDesignLabelIcon64x64noSpacing); // "SUMO <VERSION>" FXVerticalFrame* descriptionFrame = new FXVerticalFrame(mainInfoFrame, GUIDesignLabelAboutInfo); myHeadlineFont = new FXFont(getApp(), "Arial", 18, FXFont::Bold); FXLabel* neteditLabel = new FXLabel(descriptionFrame, "SUMO netedit " VERSION_STRING, 0, GUIDesignLabelAboutInfo); neteditLabel->setFont(myHeadlineFont); new FXLabel(descriptionFrame, "Network editor for Eclipse SUMO, the Simulation of Urban MObility", 0, GUIDesignLabelAboutInfo); new FXLabel(descriptionFrame, HAVE_ENABLED, 0, GUIDesignLabelAboutInfo); // write HAVE_ENABLED with the current modules (except Windows) if (OptionsCont::getOptions().getBool("gui-testing-debug")) { std::string modules(HAVE_ENABLED); while((modules.size() > 0) && (modules.front() != ' ')) { modules.erase(modules.begin()); } WRITE_WARNING(("Modules: " + modules).c_str()); } // copyright notice new FXLabel(this, "Graphical editor for networks of the traffic simulation SUMO.", 0, GUIDesignLabelAboutInfo); new FXLabel(this, "Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.", 0, GUIDesignLabelAboutInfo); new FXLabel(this, "This application is based on code provided by the Eclipse SUMO project.", 0, GUIDesignLabelAboutInfo); new FXLabel(this, "These core components are available under the conditions of the Eclipse Public License v2.", 0, GUIDesignLabelAboutInfo); (new FXLinkLabel(this, "SPDX-License-Identifier: EPL-2.0", 0, GUIDesignLabelAboutInfo))->setTipText("http://www.eclipse.org/legal/epl-v20.html"); // link to homepage (new FXLinkLabel(this, "http://sumo.dlr.de", 0, GUIDesignLabelCenter))->setTipText("http://sumo.dlr.de"); // centered ok-button FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); FXButton* OKButton = new FXButton(buttonFrame, "&OK\t\t", GUIIconSubSys::getIcon(ICON_ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); // focus OK button OKButton->setFocus(); }
// =========================================================================== // method definitions // =========================================================================== GUIDialog_EditViewport::GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name, int x, int y) : FXDialogBox(parent, name, DECOR_TITLE | DECOR_BORDER, x, y, 0, 0), myParent(parent) { FXVerticalFrame* f1 = new FXVerticalFrame(this, LAYOUT_TOP | FRAME_NONE | LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 1, 1); { FXHorizontalFrame* frame0 = new FXHorizontalFrame(f1, FRAME_THICK, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); new FXButton(frame0, "\t\tLoad viewport from file", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, GUIDialog_EditViewport::MID_LOAD, GUIDesignButtonToolbar); new FXButton(frame0, "\t\tSave viewport to file", GUIIconSubSys::getIcon(ICON_SAVE), this, GUIDialog_EditViewport::MID_SAVE, GUIDesignButtonToolbar); } FXMatrix* m1 = new FXMatrix(f1, 2, MATRIX_BY_COLUMNS); new FXLabel(m1, "Zoom:", 0, LAYOUT_CENTER_Y); myZoom = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); myZoom->setRange(0.0001, 100000); myZoom->setNumberFormat(4); new FXLabel(m1, "X:", 0, LAYOUT_CENTER_Y); myXOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); new FXLabel(m1, "Y:", 0, LAYOUT_CENTER_Y); myYOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); new FXLabel(m1, "Z:", 0, LAYOUT_CENTER_Y); myZOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); #ifdef HAVE_OSG new FXLabel(m1, "LookAtX:", 0, LAYOUT_CENTER_Y); myLookAtX = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); new FXLabel(m1, "LookAtY:", 0, LAYOUT_CENTER_Y); myLookAtY = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); new FXLabel(m1, "LookAtZ:", 0, LAYOUT_CENTER_Y); myLookAtZ = new FXRealSpinDial(m1, 16, this, MID_CHANGED, GUIDesignSpinDial | SPINDIAL_NOMIN | SPINDIAL_NOMAX); #endif // ok/cancel new FXHorizontalSeparator(f1, GUIDesignHorizontalSeparator); FXHorizontalFrame* f6 = new FXHorizontalFrame(f1, LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 10, 10, 5, 0); FXButton* initial = new FXButton(f6, "&OK", NULL, this, GUIDialog_EditViewport::MID_OK, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 4, 4, 3, 3); new FXButton(f6, "&Cancel", NULL, this, GUIDialog_EditViewport::MID_CANCEL, FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 4, 4, 3, 3); initial->setFocus(); setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); }
void fx_disp_fb_window::setup_dialog() { FXScrollWindow *scroll_window = new FXScrollWindow(this, LAYOUT_FILL_X|LAYOUT_FILL_Y); vframe = new FXVerticalFrame(scroll_window, LAYOUT_FILL_X|LAYOUT_FILL_Y); static const char *fb_parameter_names[] = {"N(inf)", "Eg", "A", "B", "C"}; static const char *tl_parameter_names[] = {"Eps(inf)", "Eg", "AL", "E0", "C"}; const char **pname = (disp->type == DISP_FB ? fb_parameter_names : tl_parameter_names); FXHorizontalFrame *coeff_frame = new FXHorizontalFrame(vframe, LAYOUT_FILL_X); new FXLabel(coeff_frame, "Parametrization"); FXListBox *coeff_box = new FXListBox(coeff_frame, this, ID_COEFF_FORM, LISTBOX_NORMAL|FRAME_SUNKEN); coeff_box->setNumVisible(2); coeff_box->appendItem("Standard"); coeff_box->appendItem("Peak-based"); coeff_box->setCurrentItem(this->disp->disp.fb.form); FXHorizontalFrame *ninf_frame = new FXHorizontalFrame(vframe, LAYOUT_FILL_X); new FXLabel(ninf_frame, pname[0]); create_textfield(ninf_frame, this, ID_PARAM_0); new FXLabel(ninf_frame, pname[1]); create_textfield(ninf_frame, this, ID_PARAM_0 + 1); matrix = new FXMatrix(vframe, 4, LAYOUT_SIDE_TOP|MATRIX_BY_COLUMNS); new FXLabel(matrix, ""); new FXLabel(matrix, pname[2]); new FXLabel(matrix, pname[3]); new FXLabel(matrix, pname[4]); for (int i = 0; i < disp->disp.fb.n; i++) { FXButton *db = new FXButton(matrix, "", regressProApp()->delete_icon, this, ID_DISP_ELEMENT_DELETE + i, FRAME_SUNKEN); if (disp->disp.fb.n == 1) { db->disable(); } for (int j = 3*i; j < 3*(i+1); j++) { create_textfield(matrix, this, ID_PARAM_0 + j + 2); } } new FXButton(vframe, "", regressProApp()->add_icon, this, ID_DISP_ELEMENT_ADD, FRAME_SUNKEN); }
void fx_disp_ho_window::setup_dialog() { FXScrollWindow *scroll_window = new FXScrollWindow(this, LAYOUT_FILL_X|LAYOUT_FILL_Y); vframe = new FXVerticalFrame(scroll_window, LAYOUT_FILL_X|LAYOUT_FILL_Y); matrix = new FXMatrix(vframe, 6, LAYOUT_SIDE_TOP|MATRIX_BY_COLUMNS); new FXLabel(matrix, ""); new FXLabel(matrix, "Nosc"); new FXLabel(matrix, "En"); new FXLabel(matrix, "Eg"); new FXLabel(matrix, "Nu"); new FXLabel(matrix, "Phi"); for (int i = 0; i < disp->disp.ho.nb_hos; i++) { FXButton *db = new FXButton(matrix, "", regressProApp()->delete_icon, this, ID_DISP_ELEMENT_DELETE + i, FRAME_SUNKEN); if (disp->disp.ho.nb_hos == 1) { db->disable(); } for (int j = 5*i; j < 5*(i+1); j++) { create_textfield(matrix, this, ID_PARAM_0 + j); } } new FXButton(vframe, "", regressProApp()->add_icon, this, ID_DISP_ELEMENT_ADD, FRAME_SUNKEN); }
GenesisFrame::GenesisFrame(CommandLineHandler *a_commandLineHandler, FXComposite *a_p, FXuint a_opts, FXint a_x, FXint a_y, FXint a_w, FXint a_h, FXint a_pl, FXint a_pr, FXint a_pt, FXint a_pb, FXint a_hs, FXint a_vs) : FXVerticalFrame(a_p, a_opts, a_x, a_y, a_w, a_h, a_pl, a_pr, a_pt, a_pb, a_hs, a_vs) { m_commandLineHandler = a_commandLineHandler; Frontend *app = (Frontend *) getApp(); FXFont *smallFont = app->getSmallFont(); FXFont *boldFont = app->getBoldFont(); FXHorizontalFrame *windowArea = new FXHorizontalFrame(this, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); FXVerticalFrame *leftArea = new FXVerticalFrame(windowArea, LAYOUT_FILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); #ifndef DISABLE_COPIER FXGroupBox *transferArea = new FXGroupBox(leftArea, "Data transfer", FRAME_GROOVE | LAYOUT_FILL); transferArea->setFont(boldFont); FXHorizontalFrame *transferAreaTop = new FXHorizontalFrame(transferArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); FXMatrix *transferAreaTopLeft = new FXMatrix(transferAreaTop, 2, MATRIX_BY_COLUMNS, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXLabel(transferAreaTopLeft, "Device:"); m_deviceTypes = new ComboBox(transferAreaTopLeft, 1, this, ID_DEVICETYPE, FRAME_SUNKEN | COMBOBOX_STATIC | LAYOUT_FILL_X); m_deviceTypes->appendItem("Super Magic Drive"); m_deviceTypes->appendItem("MD-PRO"); m_deviceTypes->appendItem("M. Pavone's cable"); m_deviceTypes->appendItem("Cyan's ROM copier"); m_deviceTypes->setNumVisible(4); new FXLabel(transferAreaTopLeft, "Data type:"); m_transferDataTypes = new ComboBox(transferAreaTopLeft, 1, this, ID_TRANSFERDATATYPE, FRAME_SUNKEN | COMBOBOX_STATIC | LAYOUT_FILL_X); m_transferDataTypes->appendItem("ROM"); m_transferDataTypes->appendItem("SRAM"); m_transferDataTypes->setNumVisible(2); FXMatrix *transferAreaTopRight = new FXMatrix(transferAreaTop, 2, MATRIX_BY_COLUMNS | LAYOUT_RIGHT, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_speedLabel = new FXLabel(transferAreaTopRight, "Speed:"); m_speed = new ComboBox(transferAreaTopRight, 2, NULL, 0, FRAME_SUNKEN | COMBOBOX_STATIC);// | LAYOUT_FILL_X); m_speed->appendItem("1"); m_speed->appendItem("2"); m_speed->appendItem("3"); m_speed->appendItem("4"); m_speed->setCurrentItem(2); m_speed->setNumVisible(4); m_bankLabel = new FXLabel(transferAreaTopRight, "Bank:"); m_bank = new FXTextField(transferAreaTopRight, 2, NULL, 0, FRAME_SUNKEN); FXHorizontalFrame *transferAreaBottom = new FXHorizontalFrame(transferArea, LAYOUT_CENTER_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); FXHorizontalFrame *transferButtonArea = new FXHorizontalFrame(transferAreaBottom, LAYOUT_CENTER_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_sendButton = new FXButton(transferButtonArea, "Send", NULL, this, ID_SEND); FXButton *receiveButton = new FXButton(transferButtonArea, "Receive", NULL, this, ID_RECEIVE); #ifdef __unix__ receiveButton->setTipText("Use quotes only if the file name should contain them"); #else (void) receiveButton; #endif m_testButton = new FXButton(transferButtonArea, "Run test", NULL, this, ID_TEST); m_test = new ComboBox(transferAreaBottom, 6, this, ID_TESTTYPE, FRAME_SUNKEN | COMBOBOX_STATIC);// | LAYOUT_FILL_X); m_test->appendItem("burn-in"); m_test->appendItem("testbench"); m_test->setNumVisible(2); #endif // DISABLE_COPIER FXGroupBox *multiGameArea = new FXGroupBox(leftArea, "Multi-game", FRAME_GROOVE | LAYOUT_FILL); multiGameArea->setFont(boldFont); FXHorizontalFrame *loaderArea = new FXHorizontalFrame(multiGameArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_loaderPath = TextFieldOption::add(loaderArea, "Loader:", 1, true, this, ID_MULTIGAMEPATH, false, "Genesis Settings", "Loader", ""); FXHorizontalFrame *multiGameNameArea = new FXHorizontalFrame(multiGameArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXLabel(multiGameNameArea, "Multi-game to create:"); m_multiGameName = new FXTextField(multiGameNameArea, 1, NULL, 0, FRAME_SUNKEN | LAYOUT_FILL_X); m_multiGameName->setTipText("Specify a file name without a path"); FXHorizontalFrame *sizeRegionArea = new FXHorizontalFrame(multiGameArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXLabel(sizeRegionArea, "Size:"); m_multiGameSize = new FXTextField(sizeRegionArea, 2, NULL, 0, FRAME_SUNKEN); m_multiGameSize->setText("32"); new FXLabel(sizeRegionArea, "Mbit"); FXHorizontalFrame *regionArea = new FXHorizontalFrame(sizeRegionArea, LAYOUT_RIGHT, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXLabel(regionArea, "Region:"); m_region = new ComboBox(regionArea, 1, NULL, 0, FRAME_SUNKEN | COMBOBOX_STATIC); m_region->appendItem("unspecified"); m_region->appendItem("force NTSC/Japan"); m_region->appendItem("force NTSC/U.S.A."); m_region->appendItem("force PAL"); m_region->appendItem("auto-detect"); m_region->setNumVisible(5); FXHorizontalFrame *createArea = new FXHorizontalFrame(multiGameArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_selectFilesButton = new FXButton(createArea, "Select files", NULL, this, ID_MULTIGAME, BUTTON_NORMAL | LAYOUT_CENTER_X); m_selectFilesButton->setTipText( "Select files or confirm selection for already selected files"); new FXButton(createArea, "Create file", NULL, this, ID_MULTIGAME, BUTTON_NORMAL | LAYOUT_CENTER_X); FXGroupBox *nameArea = new FXGroupBox(leftArea, "Internal name", FRAME_GROOVE | LAYOUT_FILL); nameArea->setFont(boldFont); FXMatrix *changeNameArea = new FXMatrix(nameArea, 2, MATRIX_BY_COLUMNS | LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_changeForeignName = new FXButton(changeNameArea, "Change foreign name to", NULL, this, ID_NAME, BUTTON_NORMAL | LAYOUT_FILL_X); m_foreignName = new FXTextField(changeNameArea, 1, NULL, 0, FRAME_SUNKEN | LAYOUT_FILL_X | LAYOUT_FILL_COLUMN); m_changeJapaneseName = new FXButton(changeNameArea, "Change Japanese name to", NULL, this, ID_NAME, BUTTON_NORMAL | LAYOUT_FILL_X); m_JapaneseName = new FXTextField(changeNameArea, 1, NULL, 0, FRAME_SUNKEN | LAYOUT_FILL_X | LAYOUT_FILL_COLUMN); FXButton *fix1991Button = new FXButton(nameArea, "1991 fix", NULL, this, ID_1991); fix1991Button->setTipText("foreign, Japanese names => \"(C)SEGA\", \"(C) SEGA\""); FXVerticalFrame *rightArea = new FXVerticalFrame(windowArea, LAYOUT_FILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); FXGroupBox *conversionAreaContainer = new FXGroupBox(rightArea, "Conversion", FRAME_GROOVE | LAYOUT_FILL); conversionAreaContainer->setFont(boldFont); FXVerticalFrame *conversionAreaContainer2 = new FXVerticalFrame( conversionAreaContainer, LAYOUT_CENTER_X, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); FXHorizontalFrame *conversionArea = new FXHorizontalFrame(conversionAreaContainer2, LAYOUT_FILL, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); m_dataTypes = new ComboBox(conversionArea, 4, this, ID_DATATYPE, FRAME_SUNKEN | COMBOBOX_STATIC); m_dataTypes->appendItem("ROM"); m_dataTypes->appendItem("SRAM"); m_dataTypes->setNumVisible(2); new FXLabel(conversionArea, "to"); m_formats = new ComboBox(conversionArea, 3, NULL, 0, FRAME_SUNKEN | COMBOBOX_STATIC | LAYOUT_FIX_WIDTH, 0, 0, 50, 0); m_formatsText[0] = "SMD"; m_formatsText[1] = "BIN"; m_formatsText[2] = "MGD"; m_formats->appendItem(m_formatsText[0]); m_formats->appendItem(m_formatsText[1]); m_formats->appendItem(m_formatsText[2]); m_formats->setNumVisible(3); new FXButton(conversionArea, "Convert", NULL, this, ID_CONVERT, BUTTON_NORMAL | LAYOUT_RIGHT); FXHorizontalFrame *splitArea = new FXHorizontalFrame(conversionAreaContainer2, LAYOUT_FILL, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); FXHorizontalFrame *leftSplitArea = new FXHorizontalFrame(splitArea, LAYOUT_LEFT, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXButton(leftSplitArea, "Split", NULL, this, ID_SPLIT, BUTTON_NORMAL, 0, 0, 0, 0, 5, 5); new FXLabel(leftSplitArea, "Part size:"); m_splitSize = new FXTextField(leftSplitArea, 2, NULL, 0, FRAME_SUNKEN); new FXLabel(leftSplitArea, "Mbit", NULL, 0, 0, 0, 0, 0, DEFAULT_PAD, 20); // spacer new FXButton(splitArea, "Join", NULL, this, ID_JOIN, BUTTON_NORMAL | LAYOUT_RIGHT, 0, 0, 0, 0, 5, 5); FXGroupBox *miscArea = new FXGroupBox(rightArea, "Miscellaneous", FRAME_GROOVE | LAYOUT_FILL); miscArea->setFont(boldFont); FXMatrix *miscButtonArea = new FXMatrix(miscArea, 3, MATRIX_BY_COLUMNS | LAYOUT_CENTER_X | PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 0, 0, 0, 0);//, 0, 0); new FXButton(miscButtonArea, "Show info", NULL, this, ID_SHOWINFO); new FXButton(miscButtonArea, "Strip header", NULL, this, ID_STRIPHEADER); new FXButton(miscButtonArea, "Fix checksum", NULL, this, ID_FIXCHECKSUM); new FXButton(miscButtonArea, "Region fix", NULL, this, ID_REGIONFIX); FXGroupBox *overrideArea = new FXGroupBox(rightArea, "Override auto-detection", FRAME_GROOVE | LAYOUT_FILL); overrideArea->setFont(boldFont); FXVerticalFrame *overrideButtonsArea = new FXVerticalFrame(overrideArea, LAYOUT_FILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); m_useOverride = new FXCheckButton(overrideButtonsArea, "Use override options", this, ID_OVERRIDE); m_useOverride->setFont(smallFont); new FXHorizontalSeparator(overrideButtonsArea, LAYOUT_FILL_X | SEPARATOR_GROOVE); m_overrideGenesis = new FXCheckButton(overrideButtonsArea, "File is a Genesis/Mega Drive file"); m_overrideGenesis->setFont(smallFont); new FXHorizontalSeparator(overrideButtonsArea, LAYOUT_FIX_WIDTH | SEPARATOR_GROOVE, 0, 0, 50); FXGroupBox *headerSizeArea = new FXGroupBox(overrideButtonsArea, "", GROUPBOX_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); FXHorizontalFrame *headerSizeArea2 = new FXHorizontalFrame(headerSizeArea, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); m_overrideHeaderSize = new FXRadioButton(headerSizeArea2, "File has header, size:", this, ID_HEADER1); m_overrideHeaderSize->setFont(smallFont); m_overrideHeaderSizeText = new FXTextField(headerSizeArea2, 4, NULL, 0, FRAME_SUNKEN | TEXTFIELD_INTEGER); m_overrideHeaderSizeText->setFont(smallFont); m_overrideHeaderSizeText->setText("512"); m_overrideHeader = new FXRadioButton(headerSizeArea, "File has header", this, ID_HEADER2); m_overrideHeader->setFont(smallFont); m_overrideNoHeader = new FXRadioButton(headerSizeArea, "File has no header", this, ID_HEADER3); m_overrideNoHeader->setFont(smallFont); m_headerChoice = 0; new FXHorizontalSeparator(overrideButtonsArea, LAYOUT_FIX_WIDTH | SEPARATOR_GROOVE, 0, 0, 50); m_overrideNotSplit = new FXCheckButton(overrideButtonsArea, "File is not split"); m_overrideNotSplit->setFont(smallFont); new FXHorizontalSeparator(overrideButtonsArea, LAYOUT_FIX_WIDTH | SEPARATOR_GROOVE, 0, 0, 50); FXGroupBox *interleaveArea = new FXGroupBox(overrideButtonsArea, "", GROUPBOX_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); m_overrideInterleaved = new FXRadioButton(interleaveArea, "File is interleaved (SMD)", this, ID_INTERLEAVE); m_overrideInterleaved->setFont(smallFont); m_overrideInterleaved2 = new FXRadioButton(interleaveArea, "File is interleaved (MGD)", this, ID_INTERLEAVE); m_overrideInterleaved2->setFont(smallFont); m_overrideNotInterleaved = new FXRadioButton(interleaveArea, "File is not interleaved", this, ID_INTERLEAVE); m_overrideNotInterleaved->setFont(smallFont); handle(m_useOverride, FXSEL(SEL_COMMAND, ID_OVERRIDE), (void *) 0); }
// Build contents void FXMessageBox::initialize(const FXString& text,FXIcon* icn,FXuint whichbuttons){ FXButton *initial; FXVerticalFrame* content=new FXVerticalFrame(this,LAYOUT_FILL_X|LAYOUT_FILL_Y); FXHorizontalFrame* info=new FXHorizontalFrame(content,LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,0,0,10,10,10,10); new FXLabel(info,FXString::null,icn,ICON_BEFORE_TEXT|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y); new FXLabel(info,text,NULL,JUSTIFY_LEFT|ICON_BEFORE_TEXT|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|LAYOUT_FILL_Y); new FXHorizontalSeparator(content,SEPARATOR_GROOVE|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X); FXHorizontalFrame* buttons=new FXHorizontalFrame(content,LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH,0,0,0,0,10,10,5,5); if(whichbuttons==MBOX_OK){ initial=new FXButton(buttons,tr("&OK"),NULL,this,ID_CLICKED_OK,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_OK_CANCEL){ initial=new FXButton(buttons,tr("&OK"),NULL,this,ID_CLICKED_OK,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_YES_NO){ initial=new FXButton(buttons,tr("&Yes"),NULL,this,ID_CLICKED_YES,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&No"),NULL,this,ID_CLICKED_NO,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_YES_NO_CANCEL){ initial=new FXButton(buttons,tr("&Yes"),NULL,this,ID_CLICKED_YES,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&No"),NULL,this,ID_CLICKED_NO,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_QUIT_CANCEL){ initial=new FXButton(buttons,tr("&Quit"),NULL,this,ID_CLICKED_QUIT,BUTTON_INITIAL|BUTTON_DEFAULT|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_QUIT_SAVE_CANCEL){ new FXButton(buttons,tr("&Quit"),NULL,this,ID_CLICKED_QUIT,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial=new FXButton(buttons,tr("&Save"),NULL,this,ID_CLICKED_SAVE,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_SKIP_SKIPALL_CANCEL){ initial=new FXButton(buttons,tr("&Skip"),NULL,this,ID_CLICKED_SKIP,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("Skip &All"),NULL,this,ID_CLICKED_SKIPALL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_SAVE_CANCEL_DONTSAVE){ buttons->setPackingHints(PACK_NORMAL); new FXButton(buttons,tr("&Don't Save"),NULL,this,ID_CLICKED_NO,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_CENTER_X,0,0,0,0,15,15,VERT_PAD,VERT_PAD); FXHorizontalFrame *buttons3=new FXHorizontalFrame(buttons,LAYOUT_RIGHT|PACK_UNIFORM_WIDTH,0,0,0,0,0,0,0,0); new FXButton(buttons3,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT,0,0,0,0,15,15,VERT_PAD,VERT_PAD); initial=new FXButton(buttons3,tr("&Save"),NULL,this,ID_CLICKED_SAVE,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT,0,0,0,0,15,15,VERT_PAD,VERT_PAD); initial->setFocus(); } else if(whichbuttons==MBOX_YES_YESALL_NO_NOALL_CANCEL){ initial=new FXButton(buttons,tr("&Yes"),NULL,this,ID_CLICKED_YES,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("Y&es to All"),NULL,this,ID_CLICKED_YESALL,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&No"),NULL,this,ID_CLICKED_NO,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("N&o to All"),NULL,this,ID_CLICKED_NOALL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); new FXButton(buttons,tr("&Cancel"),NULL,this,ID_CLICKED_CANCEL,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_CENTER_X,0,0,0,0,HORZ_PAD,HORZ_PAD,VERT_PAD,VERT_PAD); initial->setFocus(); } }
// File selector object FileSelector::FileSelector(FXComposite *p,FXObject* tgt,FXSelector sel,FXuint opts,FXint x,FXint y,FXint w,FXint h): FXPacker(p,opts,x,y,w,h,0,0,0,0,0,0) { FXAccelTable *table=getShell()->getAccelTable(); target=tgt; message=sel; // Global container FXVerticalFrame* cont=new FXVerticalFrame(this,LAYOUT_FILL_Y|LAYOUT_FILL_X|FRAME_NONE,0,0,0,0, 0,0,0,0, 0,0); // Container for the action buttons FXHorizontalFrame* buttons=new FXHorizontalFrame(cont,LAYOUT_SIDE_TOP|LAYOUT_FILL_X|FRAME_RAISED,0,0,0,0, 5,5,5,5, 0,0); // Container for the path linker FXHorizontalFrame* pathframe=new FXHorizontalFrame(cont,LAYOUT_FILL_X|FRAME_RAISED,0,0,0,0, 0,0,0,0, 0,0); // File list FXuint options = _ICONLIST_BROWSESELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y; FXbool thumbnails=getApp()->reg().readUnsignedEntry("FILEDIALOG","thumbnails",FALSE); list=new FileList(this,cont,this,ID_FILELIST,thumbnails,options); // Set list colors and columns size for detailed mode list->setTextColor(getApp()->reg().readColorEntry("SETTINGS","listforecolor",FXRGB(0,0,0))); list->setBackColor(getApp()->reg().readColorEntry("SETTINGS","listbackcolor",FXRGB(255,255,255))); list->setHeaderSize(0,getApp()->reg().readUnsignedEntry("FILEDIALOG","name_size",200)); list->setHeaderSize(1,getApp()->reg().readUnsignedEntry("FILEDIALOG","size_size",60)); list->setHeaderSize(2,getApp()->reg().readUnsignedEntry("FILEDIALOG","type_size",100)); list->setHeaderSize(3,getApp()->reg().readUnsignedEntry("FILEDIALOG","ext_size",100)); list->setHeaderSize(4,getApp()->reg().readUnsignedEntry("FILEDIALOG","modd_size",150)); list->setHeaderSize(5,getApp()->reg().readUnsignedEntry("FILEDIALOG","user_size",50)); list->setHeaderSize(6,getApp()->reg().readUnsignedEntry("FILEDIALOG","grou_size",50)); list->setHeaderSize(7,getApp()->reg().readUnsignedEntry("FILEDIALOG","attr_size",100)); // Set file selector options FXbool hiddenfiles=getApp()->reg().readUnsignedEntry("FILEDIALOG","hiddenfiles",FALSE); showHiddenFiles(hiddenfiles); FXuint listmode=getApp()->reg().readUnsignedEntry("FILEDIALOG","listmode",0); setFileBoxStyle(listmode); // Entry buttons FXMatrix* fields=new FXMatrix(cont,3,MATRIX_BY_COLUMNS|LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X); new FXLabel(fields,_("&File Name:"),NULL,JUSTIFY_LEFT|LAYOUT_CENTER_Y); filename=new FXTextField(fields,25,this,ID_ACCEPT,TEXTFIELD_ENTER_ONLY|LAYOUT_FILL_COLUMN|LAYOUT_FILL_X|FRAME_SUNKEN|FRAME_THICK); new FXButton(fields,_("&OK"),NULL,this,ID_ACCEPT,BUTTON_INITIAL|BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X,0,0,0,0,20,20); accept=new FXButton(buttons,FXString::null,NULL,NULL,0,LAYOUT_FIX_X|LAYOUT_FIX_Y|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT,0,0,0,0, 0,0,0,0); new FXLabel(fields,_("File F&ilter:"),NULL,JUSTIFY_LEFT|LAYOUT_CENTER_Y); FXHorizontalFrame* filterframe=new FXHorizontalFrame(fields,LAYOUT_FILL_COLUMN|LAYOUT_FILL_X|LAYOUT_FILL_Y); filefilter=new FXComboBox(filterframe,10,this,ID_FILEFILTER,COMBOBOX_STATIC|FRAME_SUNKEN|LAYOUT_FILL_X); filefilter->setNumVisible(4); readonly=new FXCheckButton(filterframe,_("Read Only"),NULL,0,ICON_BEFORE_TEXT|JUSTIFY_LEFT|LAYOUT_CENTER_Y); cancel=new FXButton(fields,_("&Cancel"),NULL,NULL,0,BUTTON_DEFAULT|FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X,0,0,0,0,20,20); // Action buttons FXString key; FXHotKey hotkey; FXButton *btn; FXToggleButton *tglbtn; new FXFrame(buttons,LAYOUT_FIX_WIDTH,0,0,4,1); key=getApp()->reg().readStringEntry("KEYBINDINGS","go_back","Ctrl-Backspace"); btn=new FXButton(buttons,TAB+_("Go to previous directory")+PARS(key),dirbackicon,this,ID_DIR_BACK,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); btnbackhist=new FXArrowButton(buttons,this,ID_DIR_BACK_HIST,LAYOUT_FILL_Y|FRAME_RAISED|FRAME_THICK|ARROW_DOWN|ARROW_TOOLBAR); key=getApp()->reg().readStringEntry("KEYBINDINGS","go_forward","Shift-Backspace"); btn=new FXButton(buttons,TAB+_("Go to next directory")+PARS(key),dirforwardicon,this,ID_DIR_FORWARD,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); btnforwardhist=new FXArrowButton(buttons,this,ID_DIR_FORWARD_HIST,LAYOUT_FILL_Y|FRAME_RAISED|FRAME_THICK|ARROW_DOWN|ARROW_TOOLBAR); key=getApp()->reg().readStringEntry("KEYBINDINGS","go_up","Backspace"); btn=new FXButton(buttons,TAB+_("Go to parent directory")+PARS(key),dirupicon,this,ID_DIR_UP,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","go_home","Ctrl-H"); btn=new FXButton(buttons,TAB+_("Go to home directory")+PARS(key),homeicon,this,ID_HOME,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","go_work","Shift-F2"); btn=new FXButton(buttons,TAB+_("Go to working directory")+PARS(key),workicon,this,ID_WORK,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","new_folder","F7"); btn=new FXButton(buttons,TAB+_("New folder")+PARS(key),newfoldericon,this,ID_NEWDIR,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","big_icons","F10"); btn=new FXButton(buttons,TAB+_("Big icon list")+PARS(key),bigiconsicon,list,FileList::ID_SHOW_BIG_ICONS,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","small_icons","F11"); btn=new FXButton(buttons,TAB+_("Small icon list")+PARS(key),smalliconsicon,list,FileList::ID_SHOW_MINI_ICONS,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","detailed_file_list","F12"); btn=new FXButton(buttons,TAB+_("Detailed file list")+PARS(key),detailsicon,list,FileList::ID_SHOW_DETAILS,BUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); btn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","hidden_files","Ctrl-F6"); tglbtn=new FXToggleButton(buttons,TAB+_("Show hidden files")+PARS(key),TAB+_("Hide hidden files")+PARS(key),showhiddenicon,hidehiddenicon,list,FileList::ID_TOGGLE_HIDDEN,TOGGLEBUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); tglbtn->addHotKey(hotkey); key=getApp()->reg().readStringEntry("KEYBINDINGS","thumbnails","Ctrl-F7"); tglbtn=new FXToggleButton(buttons,TAB+_("Show thumbnails")+PARS(key),TAB+_("Hide thumbnails")+PARS(key),showthumbicon,hidethumbicon,list,FileList::ID_TOGGLE_THUMBNAILS,TOGGLEBUTTON_TOOLBAR|FRAME_RAISED,0,0,0,0, 3,3,3,3); hotkey=_parseAccel(key); tglbtn->addHotKey(hotkey); // Path text pathtext=new TextLabel(pathframe,0,this,0,LAYOUT_FILL_X|LAYOUT_FILL_Y); pathtext->setBackColor(getApp()->getBaseColor()); // Path linker pathlink = new PathLinker(pathframe,list,NULL,LAYOUT_FILL_X); readonly->hide(); if(table) { FXString key; FXHotKey hotkey; key=getApp()->reg().readStringEntry("KEYBINDINGS","select_all","Ctrl-A"); hotkey=_parseAccel(key); table->addAccel(hotkey,list,FXSEL(SEL_COMMAND,FileList::ID_SELECT_ALL)); key=getApp()->reg().readStringEntry("KEYBINDINGS","deselect_all","Ctrl-Z"); hotkey=_parseAccel(key); table->addAccel(hotkey,list,FXSEL(SEL_COMMAND,FileList::ID_DESELECT_ALL)); key=getApp()->reg().readStringEntry("KEYBINDINGS","invert_selection","Ctrl-I"); hotkey=_parseAccel(key); table->addAccel(hotkey,list,FXSEL(SEL_COMMAND,FileList::ID_SELECT_INVERSE)); key=getApp()->reg().readStringEntry("KEYBINDINGS","new_file","F2"); hotkey=_parseAccel(key); table->addAccel(hotkey,this,FXSEL(SEL_COMMAND,ID_NEWFILE)); } setSelectMode(SELECT_FILE_ANY); // For backward compatibility, this HAS to be the default! setPatternList(allfiles); setDirectory(FXSystem::getCurrentDirectory()); // Update file list pathlink->setPath(FXSystem::getCurrentDirectory()); // Update path linker pathtext->setText(FXSystem::getCurrentDirectory()); // Update path text list->setFocus(); accept->hide(); // Change default cursor if single click navigation if (single_click==SINGLE_CLICK_DIR_FILE) list->setDefaultCursor(getApp()->getDefaultCursor(DEF_HAND_CURSOR)); }