CDStarRepeaterConfigControllerSet::CDStarRepeaterConfigControllerSet(wxWindow* parent, int id, const wxString& title, const wxString& type, unsigned int config, bool pttInvert, unsigned int time) : wxPanel(parent, id), m_title(title), m_type(NULL), m_config(NULL), m_pttInvert(NULL), m_time(NULL) { wxFlexGridSizer* sizer = new wxFlexGridSizer(2); wxStaticText* typeLabel = new wxStaticText(this, -1, _("Type")); sizer->Add(typeLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_type = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_type->Append(_("None")); #if defined(GPIO) m_type->Append(wxT("GPIO")); m_type->Append(wxT("UDRC")); #endif m_type->Append(wxT("Velleman K8055 - 0")); m_type->Append(wxT("Velleman K8055 - 1")); m_type->Append(wxT("Velleman K8055 - 2")); m_type->Append(wxT("Velleman K8055 - 3")); // Add the URI USB m_type->Append(wxT("URI USB - 1")); m_type->Append(wxT("URI USB - 2")); m_type->Append(wxT("URI USB - 3")); m_type->Append(wxT("URI USB - 4")); m_type->Append(wxT("URI USB - 5")); m_type->Append(wxT("URI USB - 6")); // Add the Serial ports wxArrayString serialDevs = CSerialPortSelector::getDevices(); for (size_t i = 0U; i < serialDevs.GetCount(); i++) m_type->Append(wxT("Serial - ") + serialDevs.Item(i)); // Add the Arduino ports serialDevs = CSerialPortSelector::getDevices(); for (size_t i = 0U; i < serialDevs.GetCount(); i++) m_type->Append(wxT("Arduino - ") + serialDevs.Item(i)); sizer->Add(m_type, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); if (type.IsEmpty()) m_type->SetSelection(0); else m_type->SetStringSelection(type); wxStaticText* configLabel = new wxStaticText(this, -1, _("Config")); sizer->Add(configLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_config = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH3, -1)); m_config->Append("1"); m_config->Append("2"); m_config->Append("3"); m_config->Append("4"); m_config->Append("5"); sizer->Add(m_config, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_config->SetSelection(config - 1); wxStaticText* pttInvertLabel = new wxStaticText(this, -1, _("PTT Inversion")); sizer->Add(pttInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_pttInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH3, -1)); m_pttInvert->Append(_("Off")); m_pttInvert->Append(_("On")); sizer->Add(m_pttInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_pttInvert->SetSelection(pttInvert ? 1 : 0); wxStaticText* timeLabel = new wxStaticText(this, -1, _("Time (secs)")); sizer->Add(timeLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_time = new wxSlider(this, -1, time, 0, 300, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS); sizer->Add(m_time, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); SetAutoLayout(true); sizer->Fit(this); sizer->SetSizeHints(this); SetSizer(sizer); }
// Constructor wxHandheldInstallCtrl::wxHandheldInstallCtrl(wxWindow *parent, wxWindowID id, const wxString &users_message, const wxString &directories_message, const wxPoint& pos, const wxSize& size, const wxString& name ) : wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name) { m_usersListCtrlImageId = 0; m_directoriesListCtrlImageId = 0; // Create a new instance of palm_installer to get data for the different controls m_palmInstaller = new palm_installer; // See constructor of winflip.cpp for comments wxFlexGridSizer *mainFlexGridSizer = new wxFlexGridSizer( 2, 3, 0 ); mainFlexGridSizer->AddGrowableCol( 0 ); mainFlexGridSizer->AddGrowableRow( 1 ); mainFlexGridSizer->AddGrowableRow( 3 ); wxStaticText *usersStaticText = new wxStaticText( this, -1, users_message, wxDefaultPosition, wxDefaultSize, 0 ); mainFlexGridSizer->Add( usersStaticText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); mainFlexGridSizer->Add( 1, 1, 0, wxALIGN_CENTRE, 25 ); m_usersListCtrl = new pda_listctrl( this, wxID_HANDHELDINSTALLCTRL_USERS_LISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER, wxDefaultValidator, wxT( "users_listctrl" ), _( "Handheld destination" ), optionIS_USERS_LISTCTRL ); mainFlexGridSizer->Add( m_usersListCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5 ); wxFlexGridSizer *usersFlexGridSizer = new wxFlexGridSizer( 1, 0, 0 ); usersFlexGridSizer->AddGrowableCol( 0 ); m_usersAddButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_USERS_ADD_BUTTON, _( "Add handheld..." ), wxDefaultPosition, wxDefaultSize, 0 ); usersFlexGridSizer->Add( m_usersAddButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_usersRemoveButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_USERS_REMOVE_BUTTON, _( "Remove selected handhelds" ), wxDefaultPosition, wxDefaultSize, 0 ); usersFlexGridSizer->Add( m_usersRemoveButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); mainFlexGridSizer->Add( usersFlexGridSizer, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); wxStaticText *directoriesStaticText = new wxStaticText( this, -1, directories_message, wxDefaultPosition, wxDefaultSize, 0 ); mainFlexGridSizer->Add( directoriesStaticText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ); mainFlexGridSizer->Add( 1, 1, 0, wxALIGN_CENTRE, 5 ); m_directoriesListCtrl = new pda_listctrl( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_LISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER, wxDefaultValidator, wxT( "directories_listctrl" ), _( "Directory destination" ), optionIS_DIRECTORIES_LISTCTRL ); mainFlexGridSizer->Add( m_directoriesListCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5 ); wxFlexGridSizer *directoryFlexGridSizer = new wxFlexGridSizer( 1, 0, 0 ); directoryFlexGridSizer->AddGrowableCol( 0 ); m_directoriesAddButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_ADD_BUTTON, _( "Add output directory..." ), wxDefaultPosition, wxDefaultSize, 0 ); directoryFlexGridSizer->Add( m_directoriesAddButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_directoriesRemoveButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_REMOVE_BUTTON, _( "Remove selected directories" ), wxDefaultPosition, wxDefaultSize, 0 ); directoryFlexGridSizer->Add( m_directoriesRemoveButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); mainFlexGridSizer->Add( directoryFlexGridSizer, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); SetAutoLayout( TRUE ); SetSizer( mainFlexGridSizer ); mainFlexGridSizer->Fit( this ); mainFlexGridSizer->SetSizeHints( this ); // TODO: Don't know whether this Layout() is needed Layout(); }
GridFrame::GridFrame() : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxWidgets grid class demo"), wxDefaultPosition, wxDefaultSize ) { wxMenu *fileMenu = new wxMenu; fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V")); fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B")); fileMenu->Append( ID_SMALL_GRID, _T("&Small Grid test\tCtrl-S")); fileMenu->AppendSeparator(); fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") ); wxMenu *viewMenu = new wxMenu; viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLECOLMOVING, _T("Col drag-&move"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLEGRIDDRAGCELL, _T("&Grid drag-cell"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") ); viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") ); viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") ); viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK ); viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK ); wxMenu *rowLabelMenu = new wxMenu; viewMenu->Append( ID_ROWLABELALIGN, _T("R&ow label alignment"), rowLabelMenu, _T("Change alignment of row labels") ); rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, _T("&Horizontal") ); rowLabelMenu->Append( ID_ROWLABELVERTALIGN, _T("&Vertical") ); wxMenu *colLabelMenu = new wxMenu; viewMenu->Append( ID_COLLABELALIGN, _T("Col l&abel alignment"), colLabelMenu, _T("Change alignment of col labels") ); colLabelMenu->Append( ID_COLLABELHORIZALIGN, _T("&Horizontal") ); colLabelMenu->Append( ID_COLLABELVERTALIGN, _T("&Vertical") ); wxMenu *colMenu = new wxMenu; colMenu->Append( ID_SETLABELCOLOUR, _T("Set &label colour...") ); colMenu->Append( ID_SETLABELTEXTCOLOUR, _T("Set label &text colour...") ); colMenu->Append( ID_SETLABEL_FONT, _T("Set label fo&nt...") ); colMenu->Append( ID_GRIDLINECOLOUR, _T("&Grid line colour...") ); colMenu->Append( ID_SET_CELL_FG_COLOUR, _T("Set cell &foreground colour...") ); colMenu->Append( ID_SET_CELL_BG_COLOUR, _T("Set cell &background colour...") ); wxMenu *editMenu = new wxMenu; editMenu->Append( ID_INSERTROW, _T("Insert &row") ); editMenu->Append( ID_INSERTCOL, _T("Insert &column") ); editMenu->Append( ID_DELETEROW, _T("Delete selected ro&ws") ); editMenu->Append( ID_DELETECOL, _T("Delete selected co&ls") ); editMenu->Append( ID_CLEARGRID, _T("Cl&ear grid cell contents") ); wxMenu *selectMenu = new wxMenu; selectMenu->Append( ID_SELECT_UNSELECT, _T("Add new cells to the selection"), _T("When off, old selection is deselected before ") _T("selecting the new cells"), wxITEM_CHECK ); selectMenu->Append( ID_SHOW_SELECTION, _T("&Show current selection\tCtrl-Alt-S")); selectMenu->AppendSeparator(); selectMenu->Append( ID_SELECT_ALL, _T("Select all")); selectMenu->Append( ID_SELECT_ROW, _T("Select row 2")); selectMenu->Append( ID_SELECT_COL, _T("Select col 2")); selectMenu->Append( ID_SELECT_CELL, _T("Select cell (3, 1)")); selectMenu->AppendSeparator(); selectMenu->Append( ID_DESELECT_ALL, _T("Deselect all")); selectMenu->Append( ID_DESELECT_ROW, _T("Deselect row 2")); selectMenu->Append( ID_DESELECT_COL, _T("Deselect col 2")); selectMenu->Append( ID_DESELECT_CELL, _T("Deselect cell (3, 1)")); wxMenu *selectionMenu = new wxMenu; selectMenu->Append( ID_CHANGESEL, _T("Change &selection mode"), selectionMenu, _T("Change selection mode") ); selectionMenu->Append( ID_SELCELLS, _T("Select &Cells") ); selectionMenu->Append( ID_SELROWS, _T("Select &Rows") ); selectionMenu->Append( ID_SELCOLS, _T("Select C&ols") ); wxMenu *helpMenu = new wxMenu; helpMenu->Append( wxID_ABOUT, _T("&About wxGrid demo") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( fileMenu, _T("&File") ); menuBar->Append( viewMenu, _T("&View") ); menuBar->Append( colMenu, _T("&Colours") ); menuBar->Append( editMenu, _T("&Edit") ); menuBar->Append( selectMenu, _T("&Select") ); menuBar->Append( helpMenu, _T("&Help") ); SetMenuBar( menuBar ); m_addToSel = false; grid = new wxGrid( this, wxID_ANY, wxPoint( 0, 0 ), wxSize( 400, 300 ) ); #if wxUSE_LOG int gridW = 600, gridH = 300; int logW = gridW, logH = 100; logWin = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxPoint( 0, gridH + 20 ), wxSize( logW, logH ), wxTE_MULTILINE ); logger = new wxLogTextCtrl( logWin ); m_logOld = wxLog::SetActiveTarget( logger ); wxLog::SetTimestamp( NULL ); #endif // wxUSE_LOG // this will create a grid and, by default, an associated grid // table for strings grid->CreateGrid( 0, 0 ); grid->AppendRows(100); grid->AppendCols(100); int ir = grid->GetNumberRows(); grid->DeleteRows(0, ir); grid->AppendRows(ir); grid->SetRowSize( 0, 60 ); grid->SetCellValue( 0, 0, _T("Ctrl+Home\nwill go to\nthis cell") ); grid->SetCellValue( 0, 1, _T("A long piece of text to demonstrate wrapping.") ); grid->SetCellRenderer(0 , 1, new wxGridCellAutoWrapStringRenderer); grid->SetCellEditor( 0, 1 , new wxGridCellAutoWrapStringEditor); grid->SetCellValue( 0, 2, _T("Blah") ); grid->SetCellValue( 0, 3, _T("Read only") ); grid->SetReadOnly( 0, 3 ); grid->SetCellValue( 0, 4, _T("Can veto edit this cell") ); grid->SetCellValue( 0, 5, _T("Press\nCtrl+arrow\nto skip over\ncells") ); grid->SetRowSize( 99, 60 ); grid->SetCellValue( 99, 99, _T("Ctrl+End\nwill go to\nthis cell") ); grid->SetCellValue( 1, 0, _T("This default cell will overflow into neighboring cells, but not if you turn overflow off.")); grid->SetCellTextColour(1, 2, *wxRED); grid->SetCellBackgroundColour(1, 2, *wxGREEN); grid->SetCellValue( 1, 4, _T("I'm in the middle")); grid->SetCellValue(2, 2, _T("red")); grid->SetCellTextColour(2, 2, *wxRED); grid->SetCellValue(3, 3, _T("green on grey")); grid->SetCellTextColour(3, 3, *wxGREEN); grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY); grid->SetCellValue(4, 4, _T("a weird looking cell")); grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE); grid->SetCellRenderer(4, 4, new MyGridCellRenderer); grid->SetCellValue(3, 0, _T("0")); grid->SetCellRenderer(3, 0, new wxGridCellBoolRenderer); grid->SetCellEditor(3, 0, new wxGridCellBoolEditor); wxGridCellAttr *attr; attr = new wxGridCellAttr; attr->SetTextColour(*wxBLUE); grid->SetColAttr(5, attr); attr = new wxGridCellAttr; attr->SetBackgroundColour(*wxRED); grid->SetRowAttr(5, attr); grid->SetCellValue(2, 4, _T("a wider column")); grid->SetColSize(4, 120); grid->SetColMinimalWidth(4, 120); grid->SetCellTextColour(5, 8, *wxGREEN); grid->SetCellValue(5, 8, _T("Bg from row attr\nText col from cell attr")); grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't")); grid->SetColFormatFloat(6); grid->SetCellValue(0, 6, _T("3.1415")); grid->SetCellValue(1, 6, _T("1415")); grid->SetCellValue(2, 6, _T("12345.67890")); grid->SetColFormatFloat(7, 6, 2); grid->SetCellValue(0, 7, _T("3.1415")); grid->SetCellValue(1, 7, _T("1415")); grid->SetCellValue(2, 7, _T("12345.67890")); const wxString choices[] = { _T("Please select a choice"), _T("This takes two cells"), _T("Another choice"), }; grid->SetCellEditor(4, 0, new wxGridCellChoiceEditor(WXSIZEOF(choices), choices)); grid->SetCellSize(4, 0, 1, 2); grid->SetCellValue(4, 0, choices[0]); grid->SetCellOverflow(4, 0, false); grid->SetCellSize(7, 1, 3, 4); grid->SetCellAlignment(7, 1, wxALIGN_CENTRE, wxALIGN_CENTRE); grid->SetCellValue(7, 1, _T("Big box!")); wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add( grid, 1, wxEXPAND ); #if wxUSE_LOG topSizer->Add( logWin, 0, wxEXPAND ); #endif // wxUSE_LOG SetAutoLayout(true); SetSizer( topSizer ); topSizer->Fit( this ); Centre(); SetDefaults(); }
wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title, const wxString& defaultPath, long style, const wxPoint& pos, const wxSize& sz, const wxString& name): wxDialog(parent, ID_DIRCTRL, title, pos, sz, style, name) { wxBusyCursor cursor; m_path = defaultPath; if (m_path == wxT("~")) wxGetHomeDir(&m_path); if (m_path == wxT(".")) m_path = wxGetCwd(); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); // smart phones does not support or do not waste space for wxButtons #if defined(__SMARTPHONE__) wxMenu *dirMenu = new wxMenu; dirMenu->Append(ID_GO_HOME, _("Home")); if (style & wxDD_NEW_DIR_BUTTON) { dirMenu->Append(ID_NEW, _("New directory")); } dirMenu->AppendCheckItem(ID_SHOW_HIDDEN, _("Show hidden directories")); dirMenu->AppendSeparator(); dirMenu->Append(wxID_CANCEL, _("Cancel")); SetRightMenu(wxID_ANY, _("Options"), dirMenu); #else // 0) 'New' and 'Home' Buttons wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL ); // VS: 'Home directory' concept is unknown to MS-DOS #if !defined(__DOS__) wxBitmapButton* homeButton = new wxBitmapButton(this, ID_GO_HOME, wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON)); buttonsizer->Add( homeButton, 0, wxLEFT|wxRIGHT, 10 ); #endif // I'm not convinced we need a New button, and we tend to get annoying // accidental-editing with label editing enabled. if (style & wxDD_NEW_DIR_BUTTON) { wxBitmapButton* newButton = new wxBitmapButton(this, ID_NEW, wxArtProvider::GetBitmap(wxART_NEW_DIR, wxART_BUTTON)); buttonsizer->Add( newButton, 0, wxRIGHT, 10 ); #if wxUSE_TOOLTIPS newButton->SetToolTip(_("Create new directory")); #endif } #if wxUSE_TOOLTIPS homeButton->SetToolTip(_("Go to home directory")); #endif topsizer->Add( buttonsizer, 0, wxTOP | wxALIGN_RIGHT, 10 ); #endif // __SMARTPHONE__/!__SMARTPHONE__ // 1) dir ctrl m_dirCtrl = NULL; // this is necessary, event handler called from // wxGenericDirCtrl would crash otherwise! long dirStyle = wxDIRCTRL_DIR_ONLY | wxDEFAULT_CONTROL_BORDER; #ifdef __WXMSW__ if (style & wxDD_NEW_DIR_BUTTON) { // Only under Windows do we need the wxTR_EDIT_LABEL tree control style // before we can call EditLabel (required for "New directory") dirStyle |= wxDIRCTRL_EDIT_LABELS; } #endif m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL, m_path, wxDefaultPosition, wxSize(300, 200), dirStyle); topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, wxLARGESMALL(10,0) ); #ifndef __SMARTPHONE__ // Make the an option depending on a flag? wxCheckBox* check = new wxCheckBox( this, ID_SHOW_HIDDEN, _("Show hidden directories") ); topsizer->Add( check, 0, wxLEFT|wxRIGHT|wxTOP | wxALIGN_RIGHT, 10 ); #endif // !__SMARTPHONE__ // 2) text ctrl m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); topsizer->Add( m_input, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, wxLARGESMALL(10,0) ); #ifndef __SMARTPHONE__ #if wxUSE_STATLINE // 3) Static line topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif // 4) Buttons topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxEXPAND | wxALL, 10 ); #endif // !__SMARTPHONE__ m_input->SetFocus(); SetAutoLayout( true ); SetSizer( topsizer ); #if !defined(__SMARTPHONE__) && !defined(__POCKETPC__) topsizer->SetSizeHints( this ); topsizer->Fit( this ); Centre( wxBOTH ); #endif }
//------------------------------------------------------------------------------ MdiChildTsFrame::MdiChildTsFrame(wxMDIParentFrame *parent, bool isMainFrame, const wxString &plotName, const wxString& plotTitle, const wxString& xAxisTitle, const wxString& yAxisTitle, const wxPoint& pos, const wxSize& size, const long style) : GmatMdiChildFrame(parent, plotName, plotTitle, GmatTree::OUTPUT_XY_PLOT, -1, pos, size, style | wxNO_FULL_REPAINT_ON_RESIZE) { mXyPlot = (TsPlotCanvas *) NULL; mIsMainFrame = isMainFrame; mPlotTitle = plotTitle; mXAxisTitle = xAxisTitle; mYAxisTitle = yAxisTitle; for (int i=0; i<MAX_NUM_CURVE; i++) mHasFirstXSet[i] = false; #ifdef DEBUG_MDI_TS_FRAME MessageInterface::ShowMessage ("MdiChildTsFrame::MdiChildTsFrame()\n X Axis Title = '%s'\n" " Y Axis Title = '%s'\n isMainFrame = %d\n", xAxisTitle.c_str(), yAxisTitle.c_str(), isMainFrame); #endif MdiTsPlot::mdiChildren.Append(this); // Give it an icon #ifdef __WXMSW__ SetIcon(wxIcon(_T("chrt_icn"))); #else SetIcon(wxIcon( mondrian_xpm )); #endif // Create XyPlotFrame int width, height; GetClientSize(&width, &height); #ifdef DEBUG_MDI_TS_FRAME MessageInterface::ShowMessage(" Creating TsPlotCanvas\n"); #endif TsPlotCanvas *frame = new TsPlotXYCanvas(this, -1, wxPoint(0, 0), wxSize(width, height), wxTAB_TRAVERSAL,//wxPLOT_DEFAULT, plotTitle); frame->SetLabel(xAxisTitle.c_str(), TsPlotCanvas::X_LABEL); frame->SetLabel(yAxisTitle.c_str(), TsPlotCanvas::Y_LABEL); mXyPlot = frame; wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add(mXyPlot, 1, wxALIGN_CENTER |wxEXPAND); SetAutoLayout( TRUE ); //loj: this is called implicitly by SetSizer() SetSizer( topSizer ); // this should work for MDI frames as well as for normal ones SetSizeHints(100, 100); GmatAppData::Instance()->GetMainFrame()->theMdiChildren->Append(this); isActive = true; #ifdef DEBUG_MDI_TS_FRAME MessageInterface::ShowMessage("MdiChildTsFrame::MdiChildTsFrame() " "leaving\n"); #endif }
QualityPrefs::QualityPrefs(wxWindow * parent): PrefsPanel(parent) { int i; int rate = gPrefs->Read("/SamplingRate/DefaultProjectSampleRate", 44100); int format = gPrefs->Read("/SamplingRate/DefaultProjectSampleFormat", floatSample); int pos = NUM_RATES; // Fall back to other for (i = 0; i < NUM_RATES; i++) if (rate == rates[i]) { pos = i; break; } int fmtpos = NUM_FORMATS-1; for (i = 0; i < NUM_FORMATS; i++) if (format == formats[i]) { fmtpos = i; break; } topSizer = new wxBoxSizer( wxHORIZONTAL ); { topSizer->Add( new wxStaticText(this, -1, _("Default Sample Rate:")), 0, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, GENERIC_CONTROL_BORDER); mSampleRates = new wxChoice(this, ID_SAMPLE_RATE_CHOICE, wxDefaultPosition, wxDefaultSize, NUM_RATES+1, stringRates); mSampleRates->SetSelection(pos); topSizer->Add( mSampleRates, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER ); mOtherSampleRate = NULL; mOtherSampleRate = new wxTextCtrl( this, -1, wxString::Format("%i", rate), wxDefaultPosition, wxSize(50, -1), 0 ); mOtherSampleRate->Enable(pos == NUM_RATES); topSizer->Add( mOtherSampleRate, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER ); } wxBoxSizer *top2Sizer = new wxBoxSizer( wxHORIZONTAL ); { top2Sizer->Add( new wxStaticText(this, -1, _("Default Sample Format:")), 0, wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, GENERIC_CONTROL_BORDER); mSampleFormats = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, NUM_FORMATS, stringFormats); mSampleFormats->SetSelection(fmtpos); top2Sizer->Add( mSampleFormats, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER ); } outSizer = new wxBoxSizer( wxVERTICAL ); outSizer->Add(topSizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER); outSizer->Add(top2Sizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER); SetAutoLayout(true); outSizer->Fit(this); outSizer->SetSizeHints(this); SetSizer(outSizer); }
wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, const wxString& message, const wxString& prompt, const wxString& caption, long value, long min, long max, const wxPoint& pos) : wxDialog(parent, wxID_ANY, caption, pos, wxDefaultSize) { m_value = value; m_max = max; m_min = min; wxBeginBusyCursor(); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); #if wxUSE_STATTEXT // 1) text message topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 ); #endif // 2) prompt and text ctrl wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL ); #if wxUSE_STATTEXT // prompt if any if (!prompt.IsEmpty()) inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 ); #endif // spin ctrl wxString valStr; valStr.Printf(wxT("%ld"), m_value); m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultCoord ) ); #if wxUSE_SPINCTRL m_spinctrl->SetRange((int)m_min, (int)m_max); #endif inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 ); // add both topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 ); // smart phones does not support or do not waste space for wxButtons #ifdef __SMARTPHONE__ SetRightMenu(wxID_CANCEL, _("Cancel")); #else // __SMARTPHONE__/!__SMARTPHONE__ #if wxUSE_STATLINE // 3) static line topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); #endif // 4) buttons topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxEXPAND | wxALL, 10 ); #endif // !__SMARTPHONE__ SetSizer( topsizer ); SetAutoLayout( true ); #if !defined(__SMARTPHONE__) && !defined(__POCKETPC__) topsizer->SetSizeHints( this ); topsizer->Fit( this ); Centre( wxBOTH ); #endif m_spinctrl->SetSelection(-1, -1); m_spinctrl->SetFocus(); wxEndBusyCursor(); }
LadspaEffectDialog::LadspaEffectDialog(wxWindow * parent, const LADSPA_Descriptor *data, float *inputControls, int sampleRate) :wxDialog(parent, -1, data->Name, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) { numParams = 0; this->mData = data; this->inputControls = inputControls; this->sampleRate = sampleRate; inSlider = false; inText = false; targetSlider = NULL; sliders = new wxSlider*[mData->PortCount]; fields = new wxTextCtrl*[mData->PortCount]; labels = new wxStaticText*[mData->PortCount]; ports = new unsigned long [mData->PortCount]; unsigned long p; for(p=0; p<mData->PortCount; p++) { LADSPA_PortDescriptor d = mData->PortDescriptors[p]; if (LADSPA_IS_PORT_CONTROL(d) && LADSPA_IS_PORT_INPUT(d)) { ports[numParams] = p; numParams++; } } wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxControl *item; item = new wxStaticText(this, 0, wxString(_("Author: "))+mData->Maker); mainSizer->Add(item, 0, wxALL, 5); if (mData->Copyright && mData->Copyright[0] && mData->Copyright != wxString(_("None"))) { item = new wxStaticText(this, 0, mData->Copyright); mainSizer->Add(item, 0, wxALL, 5); } wxSizer *paramSizer = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Ladspa Effect Settings")), wxVERTICAL ); wxFlexGridSizer *gridSizer = new wxFlexGridSizer(3, 0, 0); for (p = 0; p < numParams; p++) { item = new wxStaticText(this, 0, mData->PortNames[ports[p]]); gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxString fieldText; LADSPA_PortRangeHint hint = mData->PortRangeHints[ports[p]]; if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor)) fieldText.Printf("%d", (int)(inputControls[ports[p]] + 0.5)); else fieldText.Printf("%f", inputControls[ports[p]]); fields[p] = new wxTextCtrl(this, LADSPA_TEXTCTRL_ID, fieldText); gridSizer->Add(fields[p], 0, wxALL, 5); sliders[p] = new wxSlider(this, LADSPA_SLIDER_ID, 0, 0, 1000, wxDefaultPosition, wxSize(200, -1)); gridSizer->Add(sliders[p], 0, wxALL, 5); } // Set all of the sliders based on the value in the // text fields HandleText(); paramSizer->Add(gridSizer, 1, wxALL, 5); mainSizer->Add(paramSizer, 1, wxALL, 5); wxBoxSizer *okSizer = new wxBoxSizer(wxHORIZONTAL); wxButton *button; button = new wxButton(this, wxID_OK, _("OK")); button->SetDefault(); button->SetFocus(); okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5); button = new wxButton(this, wxID_CANCEL, _("Cancel")); okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5); mainSizer->Add(okSizer, 0, wxALIGN_CENTRE | wxALL, 5); SetAutoLayout(TRUE); SetSizer(mainSizer); mainSizer->Fit(this); mainSizer->SetSizeHints(this); }
COptionsDialog::COptionsDialog(wxWindow * parent) :CResizableDlg( parent, "Edit options", SZ_SECT_WND_OPTIONS_DLG)//, wxDEFAULT_DIALOG_STYLE) { wxBoxSizer * topsizer; wxBoxSizer * rowsizer; wxBoxSizer * colsizer; wxBoxSizer * layoutsizer; wxButton * btnFont ; wxButton * btnColor ; wxButton * btnOk ; wxButton * btnCancel; wxStaticText * stPwd; wxStaticText * stFaction; wxStaticText * stLayout; wxStaticText * stIcons; m_IsValid = false; m_pComboFonts = new wxComboBox(this, ID_D1_CB_FONT ); m_pComboColors = new wxComboBox(this, ID_D1_CB_COLOR); m_pComboFactions = new wxComboBox(this, ID_D1_CB_FACTION); m_pChkLoadOrd = new wxCheckBox(this, ID_D1_CHK_LOAD_ORD , wxT("Load Orders")); m_pChkLoadRep = new wxCheckBox(this, ID_D1_CHK_LOAD_REP , wxT("Load Report")); m_pChkUnixStyle = new wxCheckBox(this, ID_D1_CHK_UNIX_FILES , wxT("Unix file format")); m_pChkHatchUnvisited = new wxCheckBox(this, ID_D1_CHK_HATCH_UNVISITED , wxT("Hatch unvisited")); m_pChkRClickCenters = new wxCheckBox(this, ID_D1_CHK_RIGHT_CLCK_CENTER, wxT("Right Click Centers")); // m_pChk3WinLayout = new wxCheckBox(this, ID_D1_CHK_3WIN_LAYOUT , wxT("3 windows layout")); m_pChkTeach = new wxCheckBox(this, ID_D1_CHK_TEACH_LVL , wxT("Check TEACH level")); m_pChkReadPwd = new wxCheckBox(this, ID_D1_CHK_READ_PWD , wxT("Import Passwords")); m_pChkCheckProdReq = new wxCheckBox(this, ID_D1_CHK_CHK_PROD_REQ , wxT("Immediate production check")); m_pChkMoveMode = new wxCheckBox(this, ID_D1_CHK_CHK_MOVE_MODE , wxT("Check movement modes")); m_pTxtPassword = new wxTextCtrl(this, ID_D1_TXT_PASSWORD); m_pRadio1Win = new wxRadioButton(this, ID_D1_RADIO_1_WIN, wxT("1 window"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_pRadio2Win = new wxRadioButton(this, ID_D1_RADIO_2_WIN, wxT("2 windows")); m_pRadio3Win = new wxRadioButton(this, ID_D1_RADIO_3_WIN, wxT("3 windows")); m_pRadioIconsSimple = new wxRadioButton(this, ID_D1_RADIO_ICONS_SIMPLE , wxT("Simple"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_pRadioIconsAdvanced = new wxRadioButton(this, ID_D1_RADIO_ICONS_ADVANCED, wxT("Advanced")); btnFont = new wxButton (this, ID_D1_BTN_FONT , wxT("Font") ); btnColor = new wxButton (this, ID_D1_BTN_COLOR , wxT("Color") ); btnOk = new wxButton (this, wxID_OK , wxT("Ok") ); btnCancel = new wxButton (this, wxID_CANCEL , wxT("Cancel") ); stPwd = new wxStaticText (this, -1 , wxT("Password")); stFaction = new wxStaticText (this, -1 , wxT("Faction")); stLayout = new wxStaticText (this, -1 , wxT("Layout")); stIcons = new wxStaticText (this, -1 , wxT("Icons")); #define space 2 topsizer = new wxBoxSizer( wxVERTICAL ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); rowsizer->Add(m_pComboFonts , 1, wxALIGN_CENTER | wxALL , space); rowsizer->Add(btnFont , 0, wxALIGN_CENTER | wxALL , space); topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); rowsizer->Add(m_pComboColors , 1, wxALIGN_CENTER | wxALL , space); rowsizer->Add(btnColor , 0, wxALIGN_CENTER | wxALL , space); topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); rowsizer->Add(stFaction , 0, wxALIGN_CENTER | wxALL , space); rowsizer->Add(m_pComboFactions , 1, wxALIGN_CENTER | wxALL , space); rowsizer->Add(stPwd , 0, wxALIGN_CENTER | wxALL , space); rowsizer->Add(m_pTxtPassword , 1, wxALIGN_CENTER | wxALL , space); topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); colsizer = new wxBoxSizer( wxVERTICAL ); colsizer->Add(m_pChkLoadOrd , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkLoadRep , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkUnixStyle , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkHatchUnvisited , 0, wxALIGN_LEFT | wxALL, space); rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); colsizer = new wxBoxSizer( wxVERTICAL ); colsizer->Add(m_pChkRClickCenters , 0, wxALIGN_LEFT | wxALL, space); //colsizer->Add(m_pChk3WinLayout , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkTeach , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkReadPwd , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkCheckProdReq , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(m_pChkMoveMode , 0, wxALIGN_LEFT | wxALL, space); rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); colsizer = new wxBoxSizer( wxVERTICAL ); colsizer->Add(stLayout , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); layoutsizer = new wxBoxSizer( wxVERTICAL ); layoutsizer->Add(m_pRadio1Win , 0, wxALIGN_LEFT | wxALL, space); layoutsizer->Add(m_pRadio2Win , 0, wxALIGN_LEFT | wxALL, space); layoutsizer->Add(m_pRadio3Win , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(layoutsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); colsizer->Add(stIcons , 0, wxALIGN_CENTER | wxTOP | wxGROW, space+space ); layoutsizer = new wxBoxSizer( wxVERTICAL ); layoutsizer->Add(m_pRadioIconsSimple , 0, wxALIGN_LEFT | wxALL, space); layoutsizer->Add(m_pRadioIconsAdvanced , 0, wxALIGN_LEFT | wxALL, space); colsizer->Add(layoutsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space ); topsizer->Add(rowsizer , 1, wxALIGN_CENTER | wxALL | wxGROW, space ); rowsizer = new wxBoxSizer( wxHORIZONTAL ); rowsizer->Add(btnOk , 0, wxALIGN_CENTER | wxALL, space); rowsizer->Add(btnCancel , 0, wxALIGN_CENTER | wxALL, space); topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL, space ); SetAutoLayout( TRUE ); // tell dialog to use sizer SetSizer( topsizer ); // actually set the sizer topsizer->Fit( this ); // set size to minimum size as calculated by the sizer topsizer->SetSizeHints( this ); // set size hints to honour mininum size} CResizableDlg::SetSize(); }
EffectPanel::EffectPanel(wxScrolledWindow* scrollMe, Effect* effect, bool isConstant, TimelinePanel *parent, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize) { timelineParent = parent; this->isConstant = isConstant; this->effect = effect; this->scrollMe = scrollMe; depthChange = 0; PushEventHandler(new WheelCatcher(scrollMe)); wxBoxSizer *vBox; wxStaticText *text; vBox = new wxBoxSizer(wxVERTICAL); SetSizer( vBox ); SetAutoLayout( true ); effectTypeChoice = new wxChoice(this, EFFECT_TYPE_CHOICE, wxDefaultPosition, wxDefaultSize, NUM_EFFECT_TYPES + 1, effectChoices); effectTypeChoice->PushEventHandler(new WheelCatcher(scrollMe)); vBox->Add(effectTypeChoice, wxSizerFlags(0).Center().Expand()); effectTypeChoice->Select(effect->type); sliderBox = new wxBoxSizer(wxHORIZONTAL); vBox->Add(sliderBox, wxSizerFlags(0).Expand().Border(wxBOTTOM, 2)); if (isConstant) { if (isFinite()) { text = new wxStaticText( this, wxID_ANY, _T("Offset: "), wxDefaultPosition, wxDefaultSize); } else { text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize); } } else { text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize); } text->PushEventHandler(new WheelCatcher(scrollMe)); sliderBox->Add(text, wxSizerFlags(0)); depthSlider = new wxSlider( this, DEPTH_SLIDER, 0, 0, 254, wxDefaultPosition, wxSize(125,wxDefaultCoord), wxSL_AUTOTICKS); sliderBox->Add(depthSlider, wxSizerFlags(1)); depthSlider->PushEventHandler(new WheelCatcher(scrollMe)); depthSlider->SetValue(effect->inst->getDepth(effect->type, effect->timeline)); if (isConstant == false) { if (!isFinite()) { sliderBox->Show(false); } effectCanvas = new EffectCanvas(effect, this, EFFECT_CANVAS, wxDefaultPosition, wxSize(192,80)); vBox->Add(effectCanvas, wxSizerFlags(0).Border(wxBOTTOM, 10)); effectCanvas->PushEventHandler(new WheelCatcher(scrollMe)); } else { effectCanvas = 0; } vBox->Layout(); Monitor::addCallback( &effect->type, new Callback<char, EffectPanel> (this, &EffectPanel::typeChangedCallback) ); oldType = effect->type; Monitor::addCallback( &effect->inst->original->depths[effect->timeline][effect->type], new Callback<unsigned char, EffectPanel> (this, &EffectPanel::depthChangedCallback) ); }
/// Constructor AlcFrame::AlcFrame (const wxString & title): wxFrame ((wxFrame *) NULL, -1, title) { // Give it an icon #ifdef __WXMSW__ wxIcon icon(wxT("alc")); #else wxIcon icon; icon.CopyFromBitmap(AlcPix::getPixmap(wxT("alc"))); #endif SetIcon (icon); // Status Bar CreateStatusBar (); SetStatusText (_("Welcome!")); // Unused dialog for now m_progressBar = NULL; // Frame Vertical sizer m_frameVBox = new wxBoxSizer (wxVERTICAL); // Add Main panel to frame (needed by win32 for padding sub panels) m_mainPanel = new wxPanel (this, -1); // Main Panel Vertical Sizer m_mainPanelVBox = new wxBoxSizer (wxVERTICAL); // Main Panel static line m_staticLine = new wxStaticLine (m_mainPanel, -1); m_mainPanelVBox->Add (m_staticLine, 0, wxALL | wxGROW); // Input Parameters m_inputSBox = new wxStaticBox (m_mainPanel, -1, _("Input parameters")); m_inputSBoxSizer = new wxStaticBoxSizer (m_inputSBox, wxHORIZONTAL); // Input Grid m_inputFlexSizer = new wxFlexGridSizer (6, 2, 5, 10); // Left col is growable m_inputFlexSizer->AddGrowableCol (0); // Static texts m_inputFileStaticText=new wxStaticText(m_mainPanel, -1, _("File to Hash"), wxDefaultPosition,wxDefaultSize,wxALIGN_CENTRE); m_inputAddStaticText=new wxStaticText(m_mainPanel, -1, _("Add Optional URLs for this file"), wxDefaultPosition,wxDefaultSize,wxALIGN_CENTRE); // Text ctrls m_inputFileTextCtrl = new wxTextCtrl (m_mainPanel,-1,wxEmptyString, wxDefaultPosition, wxSize(300,-1)); m_inputFileTextCtrl-> SetToolTip (_ ("Enter here the file you want to compute the eD2k link")); m_inputAddTextCtrl = new wxTextCtrl (m_mainPanel,-1,wxEmptyString, wxDefaultPosition, wxSize(300,-1)); m_inputAddTextCtrl-> SetToolTip (_ ("Enter here the URL you want to add to the eD2k link: Add / at the end to let aLinkCreator append the current file name")); // List box m_inputUrlListBox = new wxListBox(m_mainPanel, -1, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_NEEDED_SB | wxLB_HSCROLL); // Buttons m_inputFileBrowseButton = new wxButton (m_mainPanel, ID_BROWSE_BUTTON, wxString (_("Browse"))); m_inputAddButton = new wxButton (m_mainPanel, ID_ADD_BUTTON, wxString (_("Add"))); // Button bar m_buttonUrlVBox = new wxBoxSizer (wxVERTICAL); m_removeButton = new wxButton (m_mainPanel, ID_REMOVE_BUTTON, wxString (_("Remove"))); m_clearButton = new wxButton (m_mainPanel, ID_CLEAR_BUTTON, wxString (_("Clear"))); m_buttonUrlVBox->Add (m_removeButton, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, 5); m_buttonUrlVBox->Add (m_clearButton, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, 5); // Check button m_parthashesCheck = new wxCheckBox (m_mainPanel, ID_PARTHASHES_CHECK, _ ("Create link with part-hashes")); m_parthashesCheck->SetValue(false); m_parthashesCheck-> SetToolTip (_ ("Help to spread new and rare files faster, at the cost of an increased link size")); // Add to sizers m_inputFlexSizer->Add (m_inputFileStaticText, 1, wxGROW | wxALIGN_BOTTOM | wxTOP, 10); m_inputFlexSizer->Add (1,1); m_inputFlexSizer->Add (m_inputFileTextCtrl, 1, wxGROW | wxALIGN_TOP , 0); m_inputFlexSizer->Add (m_inputFileBrowseButton, 0, wxGROW | wxALIGN_TOP , 0); m_inputFlexSizer->Add (m_inputAddStaticText, 1, wxGROW | wxALIGN_BOTTOM | wxTOP, 10); m_inputFlexSizer->Add (1,1); m_inputFlexSizer->Add (m_inputAddTextCtrl, 1, wxGROW | wxALIGN_TOP , 0); m_inputFlexSizer->Add (m_inputAddButton, 0, wxGROW | wxALIGN_TOP , 0); m_inputFlexSizer->Add (m_inputUrlListBox, 0, wxGROW | wxALIGN_CENTER , 0); m_inputFlexSizer->Add (m_buttonUrlVBox, 0, wxGROW | wxALIGN_CENTER , 0); m_inputFlexSizer->Add (m_parthashesCheck, 0, wxGROW | wxALIGN_CENTER | wxTOP, 10); m_inputFlexSizer->Add (1,1); m_inputSBoxSizer->Add (m_inputFlexSizer, 1, wxGROW | wxALIGN_CENTER | wxALL, 10); m_mainPanelVBox->Add (m_inputSBoxSizer, 0, wxGROW | wxALIGN_CENTER | wxALL, 10); #ifdef WANT_MD4SUM // MD4 Hash Vertical Box Sizer m_md4HashSBox = new wxStaticBox (m_mainPanel, -1, _("MD4 File Hash")); m_md4HashSBoxSizer = new wxStaticBoxSizer (m_md4HashSBox, wxHORIZONTAL); // MD4 Hash results m_md4HashTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_md4HashSBoxSizer->Add (m_md4HashTextCtrl, 1, wxALL | wxALIGN_CENTER, 5); m_mainPanelVBox->Add( m_md4HashSBoxSizer, 0, wxALL | wxGROW, 10 ); #endif // Hash Vertical Box Sizer m_e2kHashSBox = new wxStaticBox (m_mainPanel, -1, _("eD2k File Hash")); m_e2kHashSBoxSizer = new wxStaticBoxSizer (m_e2kHashSBox, wxHORIZONTAL); // Hash results m_e2kHashTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_e2kHashSBoxSizer->Add (m_e2kHashTextCtrl, 1, wxALL | wxALIGN_CENTER, 5); m_mainPanelVBox->Add( m_e2kHashSBoxSizer, 0, wxALL | wxGROW, 10 ); // Ed2k Vertical Box Sizer m_ed2kSBox = new wxStaticBox (m_mainPanel, -1, _("eD2k link")); m_ed2kSBoxSizer = new wxStaticBoxSizer (m_ed2kSBox, wxVERTICAL); // Ed2k results m_ed2kTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition, wxSize(-1,60), wxTE_MULTILINE|wxTE_READONLY|wxVSCROLL ); m_ed2kSBoxSizer->Add (m_ed2kTextCtrl, 1, wxALL | wxGROW, 5); m_mainPanelVBox->Add( m_ed2kSBoxSizer, 1, wxALL | wxGROW, 10 ); // Button bar m_buttonHBox = new wxBoxSizer (wxHORIZONTAL); m_startButton = new wxButton (m_mainPanel, ID_START_BUTTON, wxString (_("Start"))); m_saveButton = new wxButton (m_mainPanel, ID_SAVEAS_BUTTON, wxString (_("Save"))); m_copyButton = new wxButton (m_mainPanel, ID_COPY_BUTTON, wxString (_("Copy to clipboard"))); m_closeButton = new wxButton (m_mainPanel, ID_EXIT_BUTTON, wxString (_("Exit"))); m_buttonHBox->Add (m_copyButton, 0, wxALIGN_LEFT | wxALL, 5); m_buttonHBox->Add(1,1,1); m_buttonHBox->Add (m_startButton, 0, wxALIGN_RIGHT | wxALL, 5); m_buttonHBox->Add (m_saveButton, 0, wxALIGN_RIGHT | wxALL, 5); m_buttonHBox->Add (m_closeButton, 0, wxALIGN_RIGHT | wxALL, 5); m_mainPanelVBox->Add (m_buttonHBox, 0, wxALL | wxGROW, 5); // Toolbar Pixmaps m_toolBarBitmaps[0] = AlcPix::getPixmap(wxT("open")); m_toolBarBitmaps[1] = AlcPix::getPixmap(wxT("copy")); m_toolBarBitmaps[2] = AlcPix::getPixmap(wxT("saveas")); m_toolBarBitmaps[3] = AlcPix::getPixmap(wxT("about")); // Constructing toolbar m_toolbar = new wxToolBar (this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_FLAT); m_toolbar->SetToolBitmapSize (wxSize (32, 32)); m_toolbar->SetMargins (2, 2); m_toolbar->AddTool (ID_BAR_OPEN, _("Open"), m_toolBarBitmaps[0], _("Open a file to compute its eD2k link")); m_toolbar->AddTool (ID_BAR_COPY, _("Copy"), m_toolBarBitmaps[1], _("Copy computed eD2k link to clipboard")); m_toolbar->AddTool (ID_BAR_SAVEAS, _("Save as"), m_toolBarBitmaps[2], _("Save computed eD2k link to file")); m_toolbar->AddSeparator (); m_toolbar->AddTool (ID_BAR_ABOUT, _("About"), m_toolBarBitmaps[3], _("About aLinkCreator")); m_toolbar->Realize (); SetToolBar (m_toolbar); // Main panel Layout m_mainPanel->SetAutoLayout(true); m_mainPanel->SetSizerAndFit (m_mainPanelVBox); // Frame Layout m_frameVBox->Add (m_mainPanel, 1, wxALL | wxGROW, 0); SetAutoLayout (true); SetSizerAndFit (m_frameVBox); m_startButton->SetFocus(); }
CHexExportDlg::CHexExportDlg(wxWindow *parent) :CResizableDlg( parent, wxT("Hex export options"), SZ_SECT_WND_EXP_HEXES, wxDEFAULT_DIALOG_STYLE) { wxBoxSizer * topsizer; wxBoxSizer * sizer ; wxBoxSizer * colsizer; wxStaticBox* box; CStr ConfigKey; CStr S; m_btnOk = new wxButton (this, wxID_OK , wxT("Ok") ); m_btnCancel = new wxButton (this, wxID_CANCEL, wxT("Cancel") ); m_btnBrowse = new wxButton (this, -1, wxT("Browse") ); m_tcFName = new wxTextCtrl (this, -1, wxT(""), wxDefaultPosition, wxSize(150, -1)); m_rbHexNew = new wxRadioButton(this, -1, wxT("New") , wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_rbHexCurrent = new wxRadioButton(this, -1, wxT("Current") , wxDefaultPosition, wxDefaultSize, 0); m_rbHexSelected = new wxRadioButton(this, -1, wxT("Selected"), wxDefaultPosition, wxDefaultSize, 0); m_rbHexAll = new wxRadioButton(this, -1, wxT("All") , wxDefaultPosition, wxDefaultSize, 0); m_rbFileOverwrite = new wxRadioButton(this, -1, wxT("Overwrite it") ,wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_rbFileAppend = new wxRadioButton(this, -1, wxT("Append to it") , wxDefaultPosition, wxDefaultSize, 0); m_chbInclStructs = new wxCheckBox (this, -1, wxT("Structures")); m_chbInclUnits = new wxCheckBox (this, -1, wxT("Units")); m_chbInclResources= new wxCheckBox (this, -1, wxT("Resources")); m_chbInclTurnNoAcl= new wxCheckBox (this, -1, wxT("Turn No a la Atlaclient")); topsizer = new wxBoxSizer( wxVERTICAL ); sizer = new wxBoxSizer( wxHORIZONTAL ); sizer->Add(new wxStaticText(this, -1, wxT("Export to file")), 0, wxALIGN_LEFT | wxALL, 5); sizer->Add(m_tcFName , 0, wxALIGN_CENTER | wxALL, 5); sizer->Add(m_btnBrowse, 0, wxALIGN_CENTER | wxALL, 5); topsizer->Add(sizer, 0, wxALIGN_CENTER | wxALL, 10); sizer = new wxBoxSizer( wxHORIZONTAL ); box = new wxStaticBox(this, -1, wxT("If file exists:")); colsizer = new wxStaticBoxSizer(box, wxVERTICAL ); colsizer->Add(m_rbFileOverwrite , 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_rbFileAppend , 0, wxALIGN_LEFT | wxALL, 2); sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 ); box = new wxStaticBox(this, -1, wxT("Hex(es):")); colsizer = new wxStaticBoxSizer(box, wxVERTICAL ); colsizer->Add(m_rbHexNew , 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_rbHexCurrent , 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_rbHexSelected, 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_rbHexAll , 0, wxALIGN_LEFT | wxALL, 2); sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 ); box = new wxStaticBox(this, -1, wxT("Include:")); colsizer = new wxStaticBoxSizer(box, wxVERTICAL ); colsizer->Add(m_chbInclStructs , 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_chbInclUnits , 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_chbInclResources, 0, wxALIGN_LEFT | wxALL, 2); colsizer->Add(m_chbInclTurnNoAcl, 0, wxALIGN_LEFT | wxALL, 2); sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 ); topsizer->Add(sizer, 0, wxALIGN_CENTER ); sizer = new wxBoxSizer( wxHORIZONTAL ); sizer->Add(m_btnOk , 0, wxALIGN_CENTER | wxALL, 5); sizer->Add(m_btnCancel , 0, wxALIGN_CENTER | wxALL, 5); topsizer->Add(sizer, 0, wxALIGN_CENTER | wxALL, 10 ); SetAutoLayout( TRUE ); // tell dialog to use sizer SetSizer( topsizer ); // actually set the sizer topsizer->Fit( this ); // set size to minimum size as calculated by the sizer topsizer->SetSizeHints( this ); // set size hints to honour mininum size} m_tcFName->SetFocus(); m_btnOk->SetDefault(); CResizableDlg::SetSize(); }
CExportMagesCSVDlg::CExportMagesCSVDlg(wxWindow * parent, const char * fname) :CResizableDlg( parent, wxT("Export mages"), SZ_SECT_WND_EXP_MAGES_CSV) { wxButton * pBtn; wxStaticText* pStatic; const char * p; wxString FName = wxString::FromAscii(fname); wxBoxSizer * topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer * horsizer; wxBoxSizer * colsizer; wxBoxSizer * layoutsizer; m_pSeparator = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN); m_pSeparator->Append(wxT(",")); m_pSeparator->Append(wxT(";")); p = SkipSpaces(gpApp->GetConfig(m_sConfigSection.GetData(), SZ_KEY_SEPARATOR)); if (p && *p) m_pSeparator->SetValue(wxString::FromAscii(p)); else m_pSeparator->SetSelection(0); m_pOrientation = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN ); m_pOrientation->Append(wxT(SZ_VERTICAL)); m_pOrientation->Append(wxT(SZ_HORIZONTAL)); p = SkipSpaces(gpApp->GetConfig(m_sConfigSection.GetData(), SZ_KEY_ORIENTATION)); if (p && *p) m_pOrientation->SetValue(wxString::FromAscii(p)); else m_pOrientation->SetSelection(0); m_pRadio1 = new wxRadioButton(this, MCSV_RADIO_1, wxT("Decorated"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); m_pRadio2 = new wxRadioButton(this, MCSV_RADIO_2, wxT("days")); m_pRadio3 = new wxRadioButton(this, MCSV_RADIO_3, wxT("level(days)")); m_nFormat = atol(gpApp->GetConfig(m_sConfigSection.GetData(), SZ_KEY_FORMAT)); switch (m_nFormat) { case 0: m_pRadio1->SetValue(TRUE); break; case 1: m_pRadio2->SetValue(TRUE); break; case 2: m_pRadio3->SetValue(TRUE); break; } m_pFileName = new wxTextCtrl(this, -1, FName); // ------------- horsizer = new wxBoxSizer( wxHORIZONTAL ); colsizer = new wxBoxSizer( wxVERTICAL ); pStatic = new wxStaticText(this, -1, wxT("Format :"), wxDefaultPosition, wxDefaultSize); colsizer->Add(pStatic, 0, wxALL, borderwidth ); colsizer->Add(m_pRadio1, 0, wxALIGN_LEFT | wxALL, 1); colsizer->Add(m_pRadio2, 0, wxALIGN_LEFT | wxALL, 1); colsizer->Add(m_pRadio3, 0, wxALIGN_LEFT | wxALL, 1); horsizer->Add(colsizer, 0, wxALIGN_CENTER | wxALL | wxGROW, borderwidth*4 ); colsizer = new wxBoxSizer( wxVERTICAL ); layoutsizer = new wxBoxSizer( wxHORIZONTAL ); pStatic = new wxStaticText(this, -1, wxT("Separator :"), wxDefaultPosition, wxDefaultSize); layoutsizer->Add(pStatic , 1, wxALIGN_RIGHT | wxALL, borderwidth ); layoutsizer->Add(m_pSeparator, 2, wxALIGN_RIGHT | wxALL, borderwidth ); colsizer->Add(layoutsizer, 0, wxALL, borderwidth ); layoutsizer = new wxBoxSizer( wxHORIZONTAL ); pStatic = new wxStaticText(this, -1, wxT("Orientation :"), wxDefaultPosition, wxDefaultSize); layoutsizer->Add(pStatic , 1, wxALIGN_RIGHT | wxALL, borderwidth ); layoutsizer->Add(m_pOrientation, 2, wxALIGN_RIGHT | wxALL, borderwidth ); colsizer->Add(layoutsizer, 0, wxALL, borderwidth ); horsizer->Add(colsizer, 0, wxALIGN_CENTER | wxALL | wxGROW, borderwidth ); topsizer->Add( horsizer, 0, wxALIGN_CENTER | wxALL | wxGROW ); // ------------- horsizer = new wxBoxSizer( wxHORIZONTAL ); pStatic = new wxStaticText(this, -1, wxT("Export to file :"), wxDefaultPosition, wxDefaultSize); horsizer->Add(pStatic, 0, wxALL, borderwidth ); horsizer->Add(m_pFileName, 1, wxALL, borderwidth ); pBtn = new wxButton (this, wxID_SETUP , wxT("Browse") ); horsizer->Add(pBtn, 0, wxALL, borderwidth ); topsizer->Add( horsizer, 0, wxALIGN_CENTER | wxALL | wxGROW ); // ------------- horsizer = new wxBoxSizer( wxHORIZONTAL ); pBtn = new wxButton (this, wxID_OK , wxT("Ok") ); horsizer->Add(pBtn, 0, wxALL, borderwidth ); pBtn = new wxButton (this, wxID_CANCEL , wxT("Cancel") ); horsizer->Add(pBtn, 0, wxALL, borderwidth ); topsizer->Add( horsizer, 0, wxALIGN_CENTER | wxALL | wxGROW ); // ------------- SetAutoLayout( TRUE ); // tell dialog to use sizer SetSizer( topsizer ); // actually set the sizer topsizer->Fit( this ); // set size to minimum size as calculated by the sizer topsizer->SetSizeHints( this ); // set size hints to honour mininum size} CResizableDlg::SetSize(); }
CShowDescriptionListDlg::CShowDescriptionListDlg(wxWindow * parent, const char * title, CCollection * items) :CResizableDlg( parent, wxString::FromUTF8(title), SZ_SECT_WND_DESCR_LIST) { long i; CBaseObject * pObj; wxButton * pBtnView; wxButton * pBtnStoreSize; wxButton * pBtnSave; m_pItems = items; m_pList = new wxListBox(this, -1, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE | wxLB_NEEDED_SB ); for (i=0; i<items->Count(); i++) { pObj = (CBaseObject * )items->At(i); m_pList->Append(wxString::FromAscii(pObj->Name.GetData()), (void *)i); } wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); pBtnView = new wxButton (this, wxID_OK , wxT("View") ); pBtnStoreSize = new wxButton (this, wxID_CANCEL, wxT("Done") ); pBtnSave = new wxButton (this, wxID_SAVE , wxT("Save as") ); topsizer->Add( m_pList , 1, // make vertically stretchable wxEXPAND | wxALL, // make horizontally stretchable // and make border all around 4 ); // set border width to 10 wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); button_sizer->Add( pBtnView, 0, // make horizontally unstretchable wxALL, // make border all around (implicit top alignment) 10 ); // set border width to 10 button_sizer->Add( pBtnSave, 0, // make horizontally unstretchable wxALL, // make border all around (implicit top alignment) 10 ); // set border width to 10 button_sizer->Add( pBtnStoreSize, 0, // make horizontally unstretchable wxALL, // make border all around (implicit top alignment) 10 ); // set border width to 10 topsizer->Add( button_sizer, 0, // make vertically unstretchable wxALIGN_CENTER ); // no border and centre horizontally SetAutoLayout( TRUE ); // tell dialog to use sizer SetSizer( topsizer ); // actually set the sizer topsizer->Fit( this ); // set size to minimum size as calculated by the sizer topsizer->SetSizeHints( this ); // set size hints to honour mininum size} m_pList->SetSelection(0); m_pList->SetFocus(); pBtnView->SetDefault(); CResizableDlg::SetSize(); }
void wxFbPalette::Create() { wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL ); #ifdef USE_FLATNOTEBOOK long nbStyle; wxConfigBase* config = wxConfigBase::Get(); config->Read( wxT( "/palette/notebook_style" ), &nbStyle, wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | DRAG_OPTION | wxFNB_DROPDOWN_TABS_LIST | wxFNB_VC8 | wxFNB_CUSTOM_DLG ); m_notebook = new wxFlatNotebook( this, -1, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) ); m_notebook->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG ); #else m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_SCROLL_BUTTONS ); m_notebook->SetArtProvider( new AuiTabArt() ); #endif unsigned int pkg_count = AppData()->GetPackageCount(); LogDebug( wxT( "[Palette] Pages %d" ), pkg_count ); #ifdef USE_FLATNOTEBOOK // Populate icon vector for ( unsigned int j = 0; j < pkg_count;j++ ) { PObjectPackage pkg = AppData()->GetPackage( j ); m_icons.Add( pkg->GetPackageIcon() ); } // Add icons to notebook m_notebook->SetImageList( &m_icons ); #else wxSize minsize; #endif for ( unsigned int i = 0; i < pkg_count;i++ ) { PObjectPackage pkg = AppData()->GetPackage( i ); wxString pkg_name = pkg->GetPackageName(); wxPanel *panel = new wxPanel( m_notebook, -1 ); //panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL ); #if wxVERSION_NUMBER >= 2900 wxAuiToolBar *toolbar = new wxAuiToolBar( panel, -1, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxNO_BORDER ); toolbar->SetToolBitmapSize( wxSize( 22, 22 ) ); PopulateToolbar( pkg, toolbar ); m_tv.push_back( toolbar ); sizer->Add( toolbar, 1, wxEXPAND, 0 ); #else wxPanel *tbPanel = new wxPanel( panel, -1 ); //tbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *tbSizer = new wxBoxSizer( wxHORIZONTAL ); wxPanel *sbPanel = new wxPanel( panel, -1 ); //sbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); wxBoxSizer *sbSizer = new wxBoxSizer( wxHORIZONTAL ); wxToolBar *toolbar = new wxToolBar( tbPanel, -1, wxDefaultPosition, wxDefaultSize, wxTB_NODIVIDER | wxTB_FLAT ); toolbar->SetToolBitmapSize( wxSize( 22, 22 ) ); //toolbar->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ); PopulateToolbar( pkg, toolbar ); m_tv.push_back( toolbar ); tbSizer->Add( toolbar, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL ); tbPanel->SetSizer( tbSizer ); wxSpinButton *sb = new wxSpinButton( sbPanel, -1, wxDefaultPosition, wxDefaultSize, wxSP_HORIZONTAL ); sb->SetRange( 0, ( int )pkg->GetObjectCount() - 1 ); sb->SetValue( 0 ); m_posVector.push_back( 0 ); sbSizer->Add( sb, 0, wxEXPAND );//wxALL | wxALIGN_TOP, 0); sbPanel->SetSizer( sbSizer ); sizer->Add( tbPanel, 1, wxEXPAND, 0 ); sizer->Add( sbPanel, 0, wxEXPAND, 0 ); #endif panel->SetAutoLayout( true ); panel->SetSizer( sizer ); sizer->Fit( panel ); sizer->SetSizeHints( panel ); #ifndef USE_FLATNOTEBOOK wxSize cursize = panel->GetSize(); if( cursize.x > minsize.x ) minsize.x = cursize.x; if( cursize.y > minsize.y ) minsize.y = cursize.y + 30; #endif m_notebook->AddPage( panel, pkg_name, false, i ); #ifndef USE_FLATNOTEBOOK m_notebook->SetPageBitmap( i, pkg->GetPackageIcon() ); #endif } //Title *title = new Title( this, wxT("Component Palette") ); //top_sizer->Add(title,0,wxEXPAND,0); #ifdef USE_FLATNOTEBOOK top_sizer->Add( m_notebook, 1, wxEXPAND, 0 ); SetAutoLayout( true ); SetSizer( top_sizer ); top_sizer->Fit( this ); top_sizer->SetSizeHints( this ); #else top_sizer->Add( m_notebook, 1, wxEXPAND, 0 ); SetSizer( top_sizer ); SetSize( minsize ); SetMinSize( minsize ); Layout(); Fit(); #endif }
CSoundCardRepeaterCallsignSet::CSoundCardRepeaterCallsignSet(wxWindow* parent, int id, const wxString& title, const wxString& callsign, const wxString& gateway, DSTAR_MODE mode, ACK_TYPE ack, bool restriction, bool rpt1Validation) : wxPanel(parent, id), m_title(title), m_callsign(NULL), m_gateway(NULL), m_suffix(NULL), m_mode(NULL), m_ack(NULL), m_restriction(NULL), m_rpt1Validation(NULL) { wxFlexGridSizer* sizer = new wxFlexGridSizer(3); wxStaticText* callsignLabel = new wxStaticText(this, -1, _("Callsign")); sizer->Add(callsignLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxString call = callsign; call.Append(wxT(" ")); call.Truncate(LONG_CALLSIGN_LENGTH); m_callsign = new CCallsignTextCtrl(this, -1, call.Left(LONG_CALLSIGN_LENGTH - 1U).Trim(), wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_callsign->SetMaxLength(LONG_CALLSIGN_LENGTH - 1U); sizer->Add(m_callsign, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_suffix = new wxChoice(this, -1, wxDefaultPosition, wxSize(SUFFIX_WIDTH, -1)); #if defined(__WXDEBUG__) m_suffix->Append(wxT(" ")); #endif m_suffix->Append(wxT("A")); m_suffix->Append(wxT("B")); m_suffix->Append(wxT("C")); m_suffix->Append(wxT("D")); m_suffix->Append(wxT("E")); sizer->Add(m_suffix, 0, wxALL, BORDER_SIZE); wxString suffix = callsign.Right(1U); bool res = m_suffix->SetStringSelection(suffix); if (!res) m_suffix->SetStringSelection(wxT("B")); wxStaticText* gatewayLabel = new wxStaticText(this, -1, _("Gateway")); sizer->Add(gatewayLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); call = gateway; call.Append(wxT(" ")); call.Truncate(LONG_CALLSIGN_LENGTH); m_gateway = new CCallsignTextCtrl(this, -1, call.Left(LONG_CALLSIGN_LENGTH - 1U).Trim(), wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_gateway->SetMaxLength(LONG_CALLSIGN_LENGTH - 1U); sizer->Add(m_gateway, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* gLabel = new wxStaticText(this, -1, wxT("G")); sizer->Add(gLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* modeLabel = new wxStaticText(this, -1, _("Mode")); sizer->Add(modeLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_mode = new wxChoice(this, CHOICE_MODE, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_mode->Append(_("Duplex")); m_mode->Append(_("Simplex")); m_mode->Append(_("Gateway")); m_mode->Append(_("TX Only")); m_mode->Append(_("RX Only")); m_mode->Append(_("TX and RX")); sizer->Add(m_mode, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_mode->SetSelection(int(mode)); wxStaticText* dummy1 = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy1, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* ackLabel = new wxStaticText(this, -1, _("Ack")); sizer->Add(ackLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_ack = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_ack->Append(_("Off")); m_ack->Append(wxT("BER")); m_ack->Append(_("Status")); sizer->Add(m_ack, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_ack->SetSelection(int(ack)); wxStaticText* dummy2 = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy2, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* restrictionLabel = new wxStaticText(this, -1, _("Restrict")); sizer->Add(restrictionLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_restriction = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_restriction->Append(_("Off")); m_restriction->Append(_("On")); sizer->Add(m_restriction, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_restriction->SetSelection(restriction ? 1 : 0); wxStaticText* dummy3 = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy3, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* rpt1ValidationLabel = new wxStaticText(this, -1, _("RPT1 Validation")); sizer->Add(rpt1ValidationLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_rpt1Validation = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_rpt1Validation->Append(_("Off")); m_rpt1Validation->Append(_("On")); sizer->Add(m_rpt1Validation, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_rpt1Validation->SetSelection(rpt1Validation ? 1 : 0); SetAutoLayout(true); sizer->Fit(this); sizer->SetSizeHints(this); SetSizer(sizer); }
void wxGenericMessageDialog::DoCreateMsgdialog() { wxDialog::Create(m_parent, wxID_ANY, m_caption, m_pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); #if wxUSE_STATBMP // 1) icon if (m_dialogStyle & wxICON_MASK) { wxStaticBitmap *icon = new wxStaticBitmap ( this, wxID_ANY, wxArtProvider::GetMessageBoxIcon(m_dialogStyle) ); if (is_pda) topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 ); else icon_text->Add(icon, wxSizerFlags().Top().Border(wxRIGHT, 20)); } #endif // wxUSE_STATBMP #if wxUSE_STATTEXT // 2) text wxBoxSizer * const textsizer = new wxBoxSizer(wxVERTICAL); // We want to show the main message in a different font to make it stand // out if the extended message is used as well. This looks better and is // more consistent with the native dialogs under MSW and GTK. wxString lowerMessage; if ( !m_extendedMessage.empty() ) { wxTitleTextWrapper titleWrapper(this); textsizer->Add(CreateTextSizer(GetMessage(), titleWrapper), wxSizerFlags().Border(wxBOTTOM, 20)); lowerMessage = GetExtendedMessage(); } else // no extended message { lowerMessage = GetMessage(); } textsizer->Add(CreateTextSizer(lowerMessage)); icon_text->Add(textsizer, 0, wxALIGN_CENTER, 10); topsizer->Add( icon_text, 1, wxLEFT|wxRIGHT|wxTOP, 10 ); #endif // wxUSE_STATTEXT // 3) optional checkbox and detailed text AddMessageDialogCheckBox( topsizer ); AddMessageDialogDetails( topsizer ); // 4) buttons wxSizer *sizerBtn = CreateMsgDlgButtonSizer(); if ( sizerBtn ) topsizer->Add(sizerBtn, 0, wxEXPAND | wxALL, 10 ); SetAutoLayout( true ); SetSizer( topsizer ); topsizer->SetSizeHints( this ); topsizer->Fit( this ); wxSize size( GetSize() ); if (size.x < size.y*3/2) { size.x = size.y*3/2; SetSize( size ); } Centre( wxBOTH | wxCENTER_FRAME); }
handheld_dest_dialog::handheld_dest_dialog( wxWindow* parent, const wxString& title, wxArrayString& user_name_array ) : wxDialog( parent, -1, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ) { wxFlexGridSizer *root_flexgridsizer = new wxFlexGridSizer( 1, 0, 0 ); root_flexgridsizer->AddGrowableCol( 0 ); root_flexgridsizer->AddGrowableRow( 1 ); wxStaticBox *user_name_staticbox = new wxStaticBox( this, -1, _( "Handheld" ) ); wxStaticBoxSizer *user_name_staticboxsizer = new wxStaticBoxSizer( user_name_staticbox, wxVERTICAL ); wxFlexGridSizer *user_name_flexgridsizer = new wxFlexGridSizer( 2, 0, 0 ); user_name_flexgridsizer->AddGrowableCol( 1 ); user_name_flexgridsizer->AddGrowableRow( 0 ); wxStaticText *user_name_statictext = new wxStaticText( this, -1, _( "Handheld user:"******"This is a USB-connected device" ) ); user_name_staticboxsizer->Add( m_is_usb_pause_checkbox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); root_flexgridsizer->Add( user_name_staticboxsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxStaticBox *location_on_handheld_staticbox = new wxStaticBox( this, -1, _( "Location on handheld" ) ); wxStaticBoxSizer *location_on_handheld_staticboxsizer = new wxStaticBoxSizer( location_on_handheld_staticbox, wxVERTICAL ); wxStaticText *install_to_statictext = new wxStaticText( this, -1, _( "On the handheld, send the files to:" ), wxDefaultPosition, wxDefaultSize, 0 ); location_on_handheld_staticboxsizer->Add( install_to_statictext, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxFlexGridSizer *ram_or_card_flexgridsizer = new wxFlexGridSizer( 2, 0, 5 ); ram_or_card_flexgridsizer->AddGrowableCol( 2 ); ram_or_card_flexgridsizer->AddGrowableRow( 0 ); ram_or_card_flexgridsizer->AddGrowableRow( 1 ); ram_or_card_flexgridsizer->AddGrowableRow( 2 ); ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 ); m_install_to_ram_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_RAM_RADIOBUTTON, _( "The handheld's RAM memory" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); ram_or_card_flexgridsizer->Add( m_install_to_ram_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 ); ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 ); m_install_to_sd_card_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_SD_CARD_RADIOBUTTON, _( "The removable SD/MMC card" ), wxDefaultPosition, wxDefaultSize, 0 ); ram_or_card_flexgridsizer->Add( m_install_to_sd_card_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 ); ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 ); m_install_to_memory_stick_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_MEMORY_STICK_RADIOBUTTON, _( "The removable Memory Stick"), wxDefaultPosition, wxDefaultSize, 0 ); ram_or_card_flexgridsizer->Add( m_install_to_memory_stick_radiobutton , 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 ); ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 ); m_install_to_compact_flash_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_COMPACT_FLASH_RADIOBUTTON, _( "The removable CompactFlash card"), wxDefaultPosition, wxDefaultSize, 0 ); ram_or_card_flexgridsizer->Add( m_install_to_compact_flash_radiobutton , 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 ); location_on_handheld_staticboxsizer->Add( ram_or_card_flexgridsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); wxFlexGridSizer *card_directory_flexgridsizer = new wxFlexGridSizer( 3, 0, 5 ); card_directory_flexgridsizer->AddGrowableCol( 1 ); card_directory_flexgridsizer->AddGrowableRow( 0 ); card_directory_flexgridsizer->Add( 30, 10, 0, wxALIGN_CENTRE|wxALL, 5 ); m_default_card_directory_radiobutton = new wxRadioButton( this, ID_DEFAULT_CARD_DIRECTORY_RADIOBUTTON, _("Send to the default directory on the card"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); card_directory_flexgridsizer->Add( m_default_card_directory_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); card_directory_flexgridsizer->Add( 1, 1, 0, wxALIGN_CENTRE|wxALL, 5 ); card_directory_flexgridsizer->Add( 30, 10, 0, wxALIGN_CENTRE|wxALL, 5 ); m_specified_card_directory_radiobutton = new wxRadioButton( this, ID_SPECIFIED_CARD_DIRECTORY_RADIOBUTTON, _("Send to this specified directory on the card:"), wxDefaultPosition, wxDefaultSize, 0 ); card_directory_flexgridsizer->Add( m_specified_card_directory_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); m_directory_on_card_textctrl = new wxTextCtrl( this, ID_DIRECTORY_ON_CARD_TEXTCTRL, wxT( "" ), wxDefaultPosition, wxSize(140,-1), 0 ); card_directory_flexgridsizer->Add( m_directory_on_card_textctrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); location_on_handheld_staticboxsizer->Add( card_directory_flexgridsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); root_flexgridsizer->Add( location_on_handheld_staticboxsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); wxBoxSizer *bottom_button_boxsizer = new wxBoxSizer( wxHORIZONTAL ); wxButton *ok_button = new wxButton( this, wxID_OK, _( "OK" ) ); bottom_button_boxsizer->Add( ok_button, 0, wxALIGN_CENTRE|wxALL, 5 ); wxButton *cancel_button= new wxButton( this, wxID_CANCEL, _( "Cancel" ) ); bottom_button_boxsizer->Add( cancel_button, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxButton *help_button = new wxButton( this, wxID_HELP_CONTEXT, _( "Help" ) ); bottom_button_boxsizer->Add( help_button, 0, wxALIGN_CENTRE|wxALL, 5 ); root_flexgridsizer->Add( bottom_button_boxsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0 ); // Do the standard sizer fitting stuff. SetAutoLayout( TRUE ); SetSizer( root_flexgridsizer ); root_flexgridsizer->SetSizeHints( this ); root_flexgridsizer->Fit( this ); // Center the html tip dialog on its parent. Centre( wxBOTH | wxCENTER_FRAME ); // Finally, load the array of possible user names into the choice for ( size_t n = 0; n < user_name_array.GetCount(); n++ ) { m_user_name_choice->Append( user_name_array.Item( n ) ); } // And set the selection to the first one if ( 0 < user_name_array.GetCount() ) { m_user_name_choice->SetSelection( 0 ); } // A radiobutton should alway have one value selected. Set RAM radiobutton to TRUE. m_install_to_ram_radiobutton->SetValue( TRUE ); // Make the directory controls invisible, since not using yet. // Disabled doesn't really matter m_default_card_directory_radiobutton->Show( FALSE ); m_specified_card_directory_radiobutton->Show( FALSE ); m_directory_on_card_textctrl->Show( FALSE ); }
CDStarRepeaterConfigDVRPTR1Set::CDStarRepeaterConfigDVRPTR1Set(wxWindow* parent, int id, const wxString& port, bool rxInvert, bool txInvert, bool channel, unsigned int modLevel, unsigned int txDelay) : wxDialog(parent, id, wxString(_("DV-RPTR V1 Settings"))), m_port(NULL), m_txInvert(NULL), m_rxInvert(NULL), m_channel(NULL), m_modLevel(NULL), m_txDelay(NULL) { wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); wxFlexGridSizer* sizer = new wxFlexGridSizer(2); wxStaticText* portLabel = new wxStaticText(this, -1, _("Port")); sizer->Add(portLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_port = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); sizer->Add(m_port, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxArrayString ports = CSerialPortSelector::getDevices(); for (unsigned int i = 0U; i < ports.GetCount(); i++) m_port->Append(ports.Item(i)); bool found = m_port->SetStringSelection(port); if (!found) m_port->SetSelection(0); wxStaticText* txInvertLabel = new wxStaticText(this, -1, _("TX Inversion")); sizer->Add(txInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_txInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_txInvert->Append(_("Off")); m_txInvert->Append(_("On")); sizer->Add(m_txInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_txInvert->SetSelection(txInvert ? 1 : 0); wxStaticText* rxInvertLabel = new wxStaticText(this, -1, _("RX Inversion")); sizer->Add(rxInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_rxInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_rxInvert->Append(_("Off")); m_rxInvert->Append(_("On")); sizer->Add(m_rxInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_rxInvert->SetSelection(rxInvert ? 1 : 0); wxStaticText* channelLabel = new wxStaticText(this, -1, _("Channel")); sizer->Add(channelLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_channel->Append(_("A / FSK Pin")); m_channel->Append(_("B / AFSK Pin")); sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_channel->SetSelection(channel ? 1 : 0); wxStaticText* modLevelLabel = new wxStaticText(this, -1, _("TX Level (%)")); sizer->Add(modLevelLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_modLevel = new wxSlider(this, -1, modLevel, 0, 100, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS); sizer->Add(m_modLevel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* txDelayLabel = new wxStaticText(this, -1, _("TX Delay (ms)")); sizer->Add(txDelayLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_txDelay = new wxSlider(this, -1, txDelay, 0, 500, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS); sizer->Add(m_txDelay, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); topSizer->Add(sizer); topSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); SetAutoLayout(true); topSizer->Fit(this); topSizer->SetSizeHints(this); SetSizer(topSizer); }
LadspaEffectDialog::LadspaEffectDialog(LadspaEffect *eff, wxWindow * parent, const LADSPA_Descriptor *data, float *inputControls, int sampleRate) :wxDialog(parent, -1, data->Name, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE), effect(eff) { numParams = 0; this->mData = data; this->inputControls = inputControls; this->sampleRate = sampleRate; #ifdef __WXMSW__ // On Windows, for some reason, wxWindows calls OnTextCtrl during creation // of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText, // which assumes all the fields have been initialized. // This can give us a bad pointer crash, so manipulate inSlider to // no-op HandleText during creation. inSlider = true; #else inSlider = false; #endif inText = false; targetSlider = NULL; sliders = new wxSlider*[mData->PortCount]; fields = new wxTextCtrl*[mData->PortCount]; labels = new wxStaticText*[mData->PortCount]; ports = new unsigned long [mData->PortCount]; unsigned long p; for(p=0; p<mData->PortCount; p++) { LADSPA_PortDescriptor d = mData->PortDescriptors[p]; if (LADSPA_IS_PORT_CONTROL(d) && LADSPA_IS_PORT_INPUT(d)) { ports[numParams] = p; numParams++; } } wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxControl *item; if (mData->Maker && mData->Maker[0] && mData->Maker != wxString(_("None"))) { item = new wxStaticText(this, 0, wxString(_("Author: "))+mData->Maker); mainSizer->Add(item, 0, wxALL, 5); } if (mData->Copyright && mData->Copyright[0] && mData->Copyright != wxString(_("None"))) { item = new wxStaticText(this, 0, mData->Copyright); mainSizer->Add(item, 0, wxALL, 5); } wxSizer *paramSizer = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Effect Settings")), wxVERTICAL ); wxFlexGridSizer *gridSizer = new wxFlexGridSizer(3, 0, 0); for (p = 0; p < numParams; p++) { item = new wxStaticText(this, 0, mData->PortNames[ports[p]]); gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxString fieldText; LADSPA_PortRangeHint hint = mData->PortRangeHints[ports[p]]; if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor)) fieldText.Printf("%d", (int)(inputControls[ports[p]] + 0.5)); else fieldText.Printf("%f", inputControls[ports[p]]); fields[p] = new wxTextCtrl(this, LADSPA_TEXTCTRL_ID, fieldText); gridSizer->Add(fields[p], 0, wxALL, 5); sliders[p] = new wxSlider(this, LADSPA_SLIDER_ID, 0, 0, 1000, wxDefaultPosition, wxSize(200, -1)); gridSizer->Add(sliders[p], 0, wxALL, 5); } // Set all of the sliders based on the value in the // text fields inSlider = false; // Now we're ready for HandleText to actually do something. HandleText(); paramSizer->Add(gridSizer, 1, wxALL, 5); mainSizer->Add(paramSizer, 1, wxALL, 5); wxBoxSizer *okSizer = new wxBoxSizer(wxHORIZONTAL); wxButton *button; button = new wxButton(this, LADSPA_PREVIEW_ID, effect->GetPreviewName()); okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5); button = new wxButton(this, wxID_CANCEL, _("Cancel")); okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5); button = new wxButton(this, wxID_OK, _("OK")); button->SetDefault(); button->SetFocus(); okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5); mainSizer->Add(okSizer, 0, wxALIGN_CENTRE | wxALL, 5); SetAutoLayout(TRUE); SetSizer(mainSizer); mainSizer->Fit(this); mainSizer->SetSizeHints(this); }
LevellerDialog::LevellerDialog(wxWindow *parent, wxWindowID id, const wxString &title ) : wxDialog( parent, id, title) { wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxControl *item; wxStaticText *statText = new wxStaticText(this, -1, _("Leveller by Lynn Allan")); mainSizer->Add(statText, 0, wxALIGN_CENTRE | wxALL, 5); statText = new wxStaticText(this, -1, _("Equalize soft and loud sections ... a key to better listening")); mainSizer->Add(statText, 0, wxALIGN_CENTRE | wxALL, 5); wxStaticBoxSizer *group = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Degree of Leveling")), wxVERTICAL);; item = new wxStaticText(this, -1, _("You want to preclude the listener feeling the need to increase\nthe volume during soft sections and decreasing during loud parts.\nSome distortion can result from excessive leveling, so try to minimize\nthis with good equipment, recording technique, the speaker not\nusing too much dynamic range, and perhaps 'working the mic'."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); group->Add(item, 0, wxALIGN_CENTRE|wxALL, 5 ); wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL); // wxString numPasses[] = { "None-Skip", "Light", "Moderate", "Heavy", "Heavier", "Heaviest" }; statText = new wxStaticText(this, -1, _("Degree of Leveling: ")); hSizer->Add(statText, 0, wxALIGN_CENTRE | wxALL, 5); mLevellerNumPassesChoice = new wxChoice(this, ID_DB_NUM_PASSES_CHOICE, wxDefaultPosition, wxDefaultSize, NUM_PASSES_CHOICES, numPasses); hSizer->Add(mLevellerNumPassesChoice, 0, wxALIGN_LEFT|wxALL, 5); group->Add(hSizer, 0, wxALIGN_CENTRE|wxALL, 5 ); mainSizer->Add(group, 0, wxALIGN_CENTRE | wxALL, 5); group = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Noise Threshold (Hiss/Hum/Ambient Noise)")), wxVERTICAL); item = new wxStaticText(this, -1, _("Below the Noise Threshold, the Signal Strength is reduced.\nAbove this Threshold, the Signal Strength is equalized so that\nsoft parts are made louder and loud parts are made softer.\n\nGenerally, recordings with low noise can use lower settings. so\ngood equipment, technique, and NoiseRemoval help out a LOT."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT ); group->Add(item, 0, wxALIGN_CENTRE|wxALL, 5 ); hSizer = new wxBoxSizer(wxHORIZONTAL); statText = new wxStaticText(this, -1, _("Threshold for Noise: ")); hSizer->Add(statText, 0, wxALIGN_CENTRE | wxALL, 5); mLevellerDbSilenceThresholdChoice = new wxChoice(this, ID_DB_SILENCE_THRESHOLD_CHOICE, wxDefaultPosition, wxDefaultSize, Enums::NumDbChoices, Enums::GetDbChoices()); hSizer->Add(mLevellerDbSilenceThresholdChoice, 0, wxALIGN_CENTER | wxALL, 4); group->Add(hSizer, 0, wxALIGN_CENTRE|wxALL, 5 ); mainSizer->Add(group, 0, wxALIGN_CENTRE | wxALL, 5); hSizer = new wxBoxSizer(wxHORIZONTAL); wxButton *cancel = new wxButton(this, wxID_CANCEL, _("&Cancel")); hSizer->Add(cancel, 0, wxALIGN_CENTRE|wxALL, 5); wxButton *ok = new wxButton(this, wxID_OK, _("&OK")); ok->SetDefault(); hSizer->Add(ok, 0, wxALIGN_CENTRE|wxALL, 5); mainSizer->Add(hSizer, 0, wxALIGN_CENTRE|wxALIGN_CENTER_VERTICAL|wxALL, 5); SetAutoLayout(true); SetSizer(mainSizer); mainSizer->Fit(this); mainSizer->SetSizeHints(this); }
//---------------------------------------------------------------------------------------- DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : wxDialog(parent, ID_DIALOG_DSN, title) { int chSize; // Height of Font * 1.4 = Height of wxTextCtrl float ratio = (float)1.4; #ifdef __WXMOTIF__ ratio = (float)2.1; #endif SetBackgroundColour(_T("wheat")); pDoc = p_Doc; wxLayoutConstraints* layout; SetAutoLayout(true); m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:")); m_Label1->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(this, wxLeft, 10); layout->top.SameAs(this, wxTop, 10); layout->height.AsIs(); layout->width.Absolute(75); m_Label1->SetConstraints(layout); int w; m_Label1->GetSize(&w, &chSize); m_UserName = new wxTextCtrl(this, wxID_ANY, wxEmptyString); m_UserName->SetFont(* pDoc->ft_Doc); chSize = (int) (m_UserName->GetCharHeight()*ratio); layout = new wxLayoutConstraints; layout->left.SameAs(m_Label1, wxRight, 10); layout->centreY.SameAs(m_Label1,wxCentreY); layout->width.Absolute(200); layout->height.Absolute(chSize); // layout->height.AsIs(); m_UserName->SetConstraints(layout); m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:")); m_Label2->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(m_Label1, wxLeft); layout->top.SameAs(m_Label1, wxBottom, 10); layout->height.AsIs(); layout->width.SameAs(m_Label1, wxWidth); m_Label2->SetConstraints(layout); m_Password = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); m_Password->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(m_UserName, wxLeft); layout->width.SameAs(m_UserName, wxWidth); layout->centreY.SameAs(m_Label2,wxCentreY); layout->height.Absolute(chSize); //layout->height.AsIs(); m_Password->SetConstraints(layout); m_OK = new wxButton(this, wxID_OK); m_OK->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(this, wxLeft, 10); layout->top.SameAs(m_Label2, wxBottom,10); layout->height.AsIs(); layout->width.Absolute(75); m_OK->SetConstraints(layout); m_Cancel = new wxButton(this, wxID_CANCEL); m_Cancel->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; layout->left.SameAs(m_OK, wxRight, 10); layout->top.SameAs(m_OK, wxTop); layout->height.AsIs(); layout->width.SameAs(m_OK, wxWidth); m_Cancel->SetConstraints(layout); m_OK->SetDefault(); m_UserName->SetFocus(); s_User = wxEmptyString; s_Password = wxEmptyString; Layout(); }
/*---------------------------------------------------------------------- DocInfoDlgWX create the Document Info dialog params: + parent : parent window + doc : the document ----------------------------------------------------------------------*/ DocInfoDlgWX::DocInfoDlgWX( int ref, wxWindow* parent, int doc ) : AmayaDialog( parent, ref ) { const char *content; My_ref = ref; wxXmlResource::Get()->LoadDialog(this, parent, wxT("DocInfoDlgWX")); wxString wx_title = TtaConvMessageToWX(TtaGetMessage(AMAYA, AM_DOCINFO_TITLE)); SetTitle( wx_title ); /* Document URL */ XRCCTRL(*this, "wxID_URL_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_HREF_VALUE))); if (DocumentURLs[doc] != NULL) content = DocumentURLs[doc]; else content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_URL_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); /* Document type */ XRCCTRL(*this, "wxID_DOCUMENT_TYPE_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_DOCINFO_TYPE))); content = DocumentTypeString (doc); if (!content) content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_DOCUMENT_TYPE_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); /* Mime Type */ XRCCTRL(*this, "wxID_MIME_TYPE_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_DOCINFO_TYPEMIME))); if (DocumentMeta[doc] && DocumentMeta[doc]->content_type) content = DocumentMeta[doc]->content_type; else content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_MIME_TYPE_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); /* Charset */ XRCCTRL(*this, "wxID_CHARSET_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_DOCINFO_CHARSET))); if (DocumentMeta[doc] && DocumentMeta[doc]->charset != NULL) content = DocumentMeta[doc]->charset; else content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_CHARSET_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); /* Content Length */ XRCCTRL(*this, "wxID_LENGTH_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_DOCINFO_CLENGTH))); if (DocumentMeta[doc] && DocumentMeta[doc]->content_length) content = DocumentMeta[doc]->content_length; else content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_LENGTH_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); /* Content Location */ XRCCTRL(*this, "wxID_LOCATION_LABEL", wxStaticText)->SetLabel(TtaConvMessageToWX(TtaGetMessage(AMAYA,AM_DOCINFO_CLOCATION))); if (DocumentMeta[doc] && DocumentMeta[doc]->full_content_location != NULL) content = DocumentMeta[doc]->full_content_location; else content = TtaGetMessage (AMAYA, AM_UNKNOWN); XRCCTRL(*this, "wxID_LOCATION_CONTENT", wxTextCtrl)->SetValue(TtaConvMessageToWX(content)); // Reason if (DocumentMeta[doc] && DocumentMeta[doc]->reason != NULL) { char msg[512]; sprintf (msg, TtaGetMessage (AMAYA, AM_UNKNOWN_XXX_STATUS), DocumentMeta[doc]->reason); XRCCTRL(*this, "wxID_REASON", wxStaticText)->SetLabel(TtaConvMessageToWX(msg)); } else XRCCTRL(*this, "wxID_REASON", wxStaticText)->SetLabel(TtaConvMessageToWX("")); // update dialog labels XRCCTRL(*this, "wxID_CANCEL", wxButton)->SetLabel(TtaConvMessageToWX(TtaGetMessage(LIB,TMSG_DONE))); Layout(); SetAutoLayout( TRUE ); }
SpectrumPrefs::SpectrumPrefs(wxWindow * parent): PrefsPanel(parent) { int fftSize = gPrefs->Read("/Spectrum/FFTSize", 256L); bool isGrayscale = false; gPrefs->Read("/Spectrum/Grayscale", &isGrayscale, false); int i; int maxFreq = gPrefs->Read("/Spectrum/MaxFreq", 8000L); wxString maxFreqStr; maxFreqStr.Printf("%d", maxFreq); int pos = 3; // Fall back to 256 if it doesn't match anything else for (i = 0; i < numFFTSizes; i++) if (fftSize == FFTSizes[i]) { pos = i; break; } topSizer = new wxStaticBoxSizer( new wxStaticBox(this, -1, "Spectrogram Options"), wxVERTICAL); { wxStaticBoxSizer *fftSizeSizer = new wxStaticBoxSizer( new wxStaticBox(this, -1, "FFT Size"), wxVERTICAL); mFFTSize[0] = new wxRadioButton( this, -1, stringFFTSizes[0], wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); mFFTSize[0]->SetValue(false); fftSizeSizer->Add(mFFTSize[0], 0, wxGROW|wxLEFT|wxRIGHT, RADIO_BUTTON_BORDER ); for(i = 1; i < numFFTSizes; i++) { mFFTSize[i] = new wxRadioButton(this, -1, stringFFTSizes[i]); mFFTSize[i]->SetValue(false); fftSizeSizer->Add(mFFTSize[i], 0, wxGROW|wxLEFT|wxRIGHT, RADIO_BUTTON_BORDER ); } mFFTSize[pos]->SetValue(true); topSizer->Add( fftSizeSizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER ); } { mGrayscale = new wxCheckBox(this, -1, "Grayscale"); topSizer->Add(mGrayscale, 0, wxGROW|wxALL, RADIO_BUTTON_BORDER ); if(isGrayscale) mGrayscale->SetValue(true); wxBoxSizer *freqSizer = new wxBoxSizer( wxHORIZONTAL ); freqSizer->Add( new wxStaticText(this, -1, "Maximum Frequency (Hz):"), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, GENERIC_CONTROL_BORDER ); mMaxFreqCtrl = new wxTextCtrl( this, -1, maxFreqStr, wxDefaultPosition, wxSize(80,-1)); freqSizer->Add(mMaxFreqCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, GENERIC_CONTROL_BORDER ); topSizer->Add(freqSizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER ); } SetAutoLayout(true); topSizer->Fit(this); topSizer->SetSizeHints(this); SetSizer(topSizer); }
ProfileWizard::ProfileWizard(wxWindow *parent, bool firstLight) : wxDialog(parent, wxID_ANY, _("New Profile Wizard"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX), m_launchDarks(true) { TitlePrefix = _("New Profile Wizard - "); // Create overall vertical sizer m_pvSizer = new wxBoxSizer(wxVERTICAL); # include "icons/phd2_48.png.h" wxBitmap phd2(wxBITMAP_PNG_FROM_DATA(phd2_48)); m_bitmaps[STATE_GREETINGS] = new wxBitmap(phd2); m_bitmaps[STATE_WRAPUP] = new wxBitmap(phd2); # include "icons/cam2.xpm" m_bitmaps[STATE_CAMERA] = new wxBitmap(cam_icon); # include "icons/scope1.xpm" m_bitmaps[STATE_MOUNT] = new wxBitmap(scope_icon); m_bitmaps[STATE_AUXMOUNT] = new wxBitmap(scope_icon); # include "icons/ao.xpm" m_bitmaps[STATE_AO] = new wxBitmap(ao_xpm); #ifndef __WXGTK__ // this resizing make a later crash in UpdateState with wxGtk m_bitmaps[STATE_CAMERA]->SetWidth(55); m_bitmaps[STATE_CAMERA]->SetHeight(55); m_bitmaps[STATE_MOUNT]->SetWidth(55); m_bitmaps[STATE_MOUNT]->SetHeight(55); m_bitmaps[STATE_AUXMOUNT]->SetWidth(55); m_bitmaps[STATE_AUXMOUNT]->SetHeight(55); #endif // __WXGTK__ // Build the superset of UI controls, minus state-specific labels and data // User instructions at top wxBoxSizer *instrSizer = new wxBoxSizer(wxHORIZONTAL); m_bitmap = new wxStaticBitmap(this, wxID_ANY, *m_bitmaps[STATE_GREETINGS], wxDefaultPosition, wxSize(55, 55)); instrSizer->Add(m_bitmap, 0, wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE, 5); m_pInstructions = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(DialogWidth, 75), wxALIGN_LEFT | wxST_NO_AUTORESIZE); wxFont font = m_pInstructions->GetFont(); font.SetWeight(wxFONTWEIGHT_BOLD); m_pInstructions->SetFont(font); instrSizer->Add(m_pInstructions, wxSizerFlags().Border(wxALL, 10)); m_pvSizer->Add(instrSizer); // Verbose help block m_pHelpGroup = new wxStaticBoxSizer(wxVERTICAL, this, _("More Info")); m_pHelpText = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(DialogWidth, -1)); // Vertical sizing of help text will be handled in state machine m_pHelpGroup->Add(m_pHelpText, wxSizerFlags().Border(wxLEFT, 10).Border(wxBOTTOM, 10)); m_pvSizer->Add(m_pHelpGroup, wxSizerFlags().Border(wxALL, 5)); // Gear label and combo box m_pGearGrid = new wxFlexGridSizer(1, 2, 5, 15); m_pGearLabel = new wxStaticText(this, wxID_ANY, "Temp:", wxDefaultPosition, wxDefaultSize); m_pGearChoice = new wxChoice(this, ID_COMBO, wxDefaultPosition, wxDefaultSize, GuideCamera::List(), 0, wxDefaultValidator, _("Gear")); m_pGearGrid->Add(m_pGearLabel, 1, wxALL, 5); m_pGearGrid->Add(m_pGearChoice, 1, wxLEFT, 10); m_pvSizer->Add(m_pGearGrid, wxSizerFlags().Center().Border(wxALL, 5)); // Control for pixel-size and focal length m_pUserProperties = new wxFlexGridSizer(2, 2, 5, 15); m_pPixelSize = new wxSpinCtrlDouble(this, ID_PIXELSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0.0, 20.0, 0.0, 0.1); m_pPixelSize->SetDigits(2); m_PixelSize = m_pPixelSize->GetValue(); m_pPixelSize->SetToolTip(_("Click Detect to read the pixel size from the camera. Otherwise, you can get this value from your camera documentation or from an online source. You can use the up/down control " "or type in a value directly.")); m_detectPixelSizeBtn = new wxButton(this, ID_DETECT_PIXELSIZE, _("Detect")); m_detectPixelSizeBtn->Enable(false); m_detectPixelSizeBtn->SetToolTip(_("Connect to camera and detect pixel size")); wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(m_pPixelSize, 1); sizer->Add(m_detectPixelSizeBtn, 0, wxLEFT, 10); AddTableEntryPair(this, m_pUserProperties, _("Guide camera un-binned pixel size (microns)"), sizer); m_pFocalLength = new wxSpinCtrlDouble(this, ID_FOCALLENGTH, _T("foo2"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 50, 3000, 300, 50); m_pFocalLength->SetValue(300); m_pFocalLength->SetDigits(0); m_pFocalLength->SetToolTip(_("This is the focal length of the guide scope - or the imaging scope if you are using an off-axis-guider or " "an adaptive optics device. You can use the up/down control or type in a value directly.")); m_FocalLength = (int) m_pFocalLength->GetValue(); AddTableEntryPair(this, m_pUserProperties, _("Guide scope focal length (mm)"), m_pFocalLength); // controls for the mount pane wxBoxSizer *mtSizer = new wxBoxSizer(wxHORIZONTAL); m_pMountProperties = new wxFlexGridSizer(1, 2, 5, 15); m_pGuideSpeed = new wxSpinCtrlDouble(this, ID_GUIDESPEED, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0.2, 1.0, 0.5, 0.1); m_pGuideSpeed->SetValue(0.5); m_GuideSpeed = 0.5; m_pGuideSpeed->SetDigits(2); m_pGuideSpeed->SetToolTip(_("The mount guide speed you will use for calibration and guiding, expressed as a multiple of the sidereal rate. If you " "don't know, leave the setting at the default value (0.5X)")); m_detectGuideSpeedBtn = new wxButton(this, ID_DETECT_GUIDESPEED, _("Detect")); m_detectGuideSpeedBtn->Enable(false); m_detectGuideSpeedBtn->SetToolTip(_("Connect to mount and detect guide speed")); mtSizer->Add(m_pGuideSpeed, 1); mtSizer->Add(10, 0); mtSizer->Add(m_detectGuideSpeedBtn); AddTableEntryPair(this, m_pMountProperties, _("Mount guide speed (n.n x sidereal)"), mtSizer); m_pvSizer->Add(m_pUserProperties, wxSizerFlags().Center().Border(wxALL, 5)); m_pvSizer->Add(m_pMountProperties, wxSizerFlags().Center().Border(wxALL, 5)); // Wrapup panel m_pWrapUp = new wxFlexGridSizer(2, 2, 5, 15); m_pProfileName = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250,-1)); m_pLaunchDarks = new wxCheckBox(this, wxID_ANY, _("Build dark library")); m_pLaunchDarks->SetValue(m_launchDarks); m_pLaunchDarks->SetToolTip(_("Check this to automatically start the process of building a dark library for this profile.")); AddTableEntryPair(this, m_pWrapUp, _("Profile Name"), m_pProfileName); m_pWrapUp->Add(m_pLaunchDarks, wxSizerFlags().Border(wxTOP, 5).Border(wxLEFT, 10)); m_pvSizer->Add(m_pWrapUp, wxSizerFlags().Border(wxALL, 10).Expand().Center()); // Row of buttons for prev, help, next wxBoxSizer *pButtonSizer = new wxBoxSizer(wxHORIZONTAL); m_pPrevBtn = new wxButton(this, ID_PREV, _("< Back")); m_pPrevBtn->SetToolTip(_("Back up to the previous screen")); wxButton* helpBtn = new wxButton(this, ID_HELP, _("Help")); m_pNextBtn = new wxButton(this, ID_NEXT, _("Next >")); m_pNextBtn->SetToolTip(_("Move forward to next screen")); pButtonSizer->AddStretchSpacer(); pButtonSizer->Add( m_pPrevBtn, wxSizerFlags(0).Align(0).Border(wxALL, 5)); pButtonSizer->Add( helpBtn, wxSizerFlags(0).Align(0).Border(wxALL, 5)); pButtonSizer->Add( m_pNextBtn, wxSizerFlags(0).Align(0).Border(wxALL, 5)); m_pvSizer->Add(pButtonSizer, wxSizerFlags().Expand().Border(wxALL, 10)); // Status bar for error messages m_pStatusBar = new wxStatusBar(this, -1); m_pStatusBar->SetFieldsCount(1); m_pvSizer->Add(m_pStatusBar, 0, wxGROW); SetAutoLayout(true); SetSizerAndFit(m_pvSizer); // Special cases - neither AuxMount nor AO requires an explicit user choice m_SelectedAuxMount = _("None"); m_SelectedAO = _("None"); if (firstLight) m_State = STATE_GREETINGS; else m_State = STATE_CAMERA; UpdateState(0); }
CStarNetSet::CStarNetSet(wxWindow* parent, int id, const wxString& title, const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector) : #else CStarNetSet::CStarNetSet(wxWindow* parent, int id, const wxString& title, const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch) : #endif wxPanel(parent, id), m_title(title), m_band(NULL), m_callsign(NULL), m_logoff(NULL), m_info(NULL), m_permanent(NULL), m_userTimeout(NULL), m_groupTimeout(NULL), m_callsignSwitch(NULL), m_txMsgSwitch(NULL) #if defined(DEXTRA_LINK) || defined(DCS_LINK) ,m_reflector(NULL) #endif { wxFlexGridSizer* sizer = new wxFlexGridSizer(3); wxStaticText* bandLabel = new wxStaticText(this, -1, _("Band")); sizer->Add(bandLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_band = new wxChoice(this, -1, wxDefaultPosition, wxSize(BAND_WIDTH, -1)); m_band->Append(wxT("A")); m_band->Append(wxT("B")); m_band->Append(wxT("C")); m_band->Append(wxT("D")); sizer->Add(m_band, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); bool res = m_band->SetStringSelection(band); if (!res) m_band->SetSelection(0); wxStaticText* dummy1Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy1Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* callsignLabel = new wxStaticText(this, -1, _("Group Call")); sizer->Add(callsignLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxString call = callsign; call.Truncate(LONG_CALLSIGN_LENGTH); m_callsign = new CCallsignTextCtrl(this, -1, call, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_callsign->SetMaxLength(LONG_CALLSIGN_LENGTH); sizer->Add(m_callsign, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* dummy2Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy2Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* logoffLabel = new wxStaticText(this, -1, _("Logoff Call")); sizer->Add(logoffLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); call = logoff; call.Truncate(LONG_CALLSIGN_LENGTH); m_logoff = new CCallsignTextCtrl(this, -1, call, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_logoff->SetMaxLength(LONG_CALLSIGN_LENGTH); sizer->Add(m_logoff, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* dummy3Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy3Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* infoLabel = new wxStaticText(this, -1, _("Information")); sizer->Add(infoLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_info = new wxTextCtrl(this, -1, info, wxDefaultPosition, wxSize(INFO_WIDTH, -1)); m_info->SetMaxLength(INFO_LENGTH); sizer->Add(m_info, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* dummy4Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy4Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* permanentLabel = new wxStaticText(this, -1, _("Permanent Call")); sizer->Add(permanentLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); call = permanent; call.Truncate(LONG_CALLSIGN_LENGTH); m_permanent = new CCallsignTextCtrl(this, -1, call, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_permanent->SetMaxLength(LONG_CALLSIGN_LENGTH); sizer->Add(m_permanent, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* dummy4ALabel = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy4ALabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* userTimeoutLabel = new wxStaticText(this, -1, _("User Timeout")); sizer->Add(userTimeoutLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_userTimeout = new wxChoice(this, -1, wxDefaultPosition, wxSize(TIMEOUT_WIDTH, -1)); m_userTimeout->Append(_("Never")); m_userTimeout->Append(_("30 mins")); m_userTimeout->Append(_("60 mins")); m_userTimeout->Append(_("120 mins")); m_userTimeout->Append(_("180 mins")); m_userTimeout->Append(_("240 mins")); m_userTimeout->Append(_("300 mins")); sizer->Add(m_userTimeout, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); switch (userTimeout) { case 0U: m_userTimeout->SetSelection(0); break; case 30U: m_userTimeout->SetSelection(1); break; case 60U: m_userTimeout->SetSelection(2); break; case 120U: m_userTimeout->SetSelection(3); break; case 180U: m_userTimeout->SetSelection(4); break; case 240U: m_userTimeout->SetSelection(5); break; default: m_userTimeout->SetSelection(6); break; } wxStaticText* dummy5Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy5Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* groupTimeoutLabel = new wxStaticText(this, -1, _("Group Timeout")); sizer->Add(groupTimeoutLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_groupTimeout = new wxChoice(this, -1, wxDefaultPosition, wxSize(TIMEOUT_WIDTH, -1)); m_groupTimeout->Append(_("Never")); m_groupTimeout->Append(_("30 mins")); m_groupTimeout->Append(_("60 mins")); m_groupTimeout->Append(_("120 mins")); m_groupTimeout->Append(_("180 mins")); m_groupTimeout->Append(_("240 mins")); m_groupTimeout->Append(_("300 mins")); sizer->Add(m_groupTimeout, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); switch (groupTimeout) { case 0U: m_groupTimeout->SetSelection(0); break; case 30U: m_groupTimeout->SetSelection(1); break; case 60U: m_groupTimeout->SetSelection(2); break; case 120U: m_groupTimeout->SetSelection(3); break; case 180U: m_groupTimeout->SetSelection(4); break; case 240U: m_groupTimeout->SetSelection(5); break; default: m_groupTimeout->SetSelection(6); break; } wxStaticText* dummy6Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy6Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* callsignSwitchLabel = new wxStaticText(this, -1, _("MYCALL Setting")); sizer->Add(callsignSwitchLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_callsignSwitch = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_callsignSwitch->Append(_("Group")); m_callsignSwitch->Append(_("User")); sizer->Add(m_callsignSwitch, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); switch (callsignSwitch) { case SCS_GROUP_CALLSIGN: m_callsignSwitch->SetSelection(0); break; case SCS_USER_CALLSIGN: m_callsignSwitch->SetSelection(1); break; default: m_callsignSwitch->SetSelection(0); break; } wxStaticText* dummy7Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy7Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); wxStaticText* txMsgSwitchLabel = new wxStaticText(this, -1, _("TX Message")); sizer->Add(txMsgSwitchLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); m_txMsgSwitch = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1)); m_txMsgSwitch->Append(_("Off")); m_txMsgSwitch->Append(_("On")); sizer->Add(m_txMsgSwitch, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_txMsgSwitch->SetSelection(txMsgSwitch ? 1 : 0); wxStaticText* dummy8Label = new wxStaticText(this, -1, wxEmptyString); sizer->Add(dummy8Label, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); #if defined(DEXTRA_LINK) wxStaticText* reflectorLabel = new wxStaticText(this, -1, _("Reflector")); sizer->Add(reflectorLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_reflector = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_reflector->Append(_("None")); wxFileName fileName(wxFileName::GetHomeDir(), DEXTRA_HOSTS_FILE_NAME); if (!fileName.IsFileReadable()) { wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); #if defined(__WINDOWS__) fileName.Assign(::wxGetCwd(), DEXTRA_HOSTS_FILE_NAME); #else fileName.Assign(wxT(DATA_DIR), DEXTRA_HOSTS_FILE_NAME); #endif if (!fileName.IsFileReadable()) wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); } CHostFile file(fileName.GetFullPath(), false); for (unsigned int i = 0U; i < file.getCount(); i++) m_reflector->Append(file.getName(i)); sizer->Add(m_reflector, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); if (reflector.IsEmpty()) { m_reflector->SetSelection(0); } else { wxString name = reflector; name.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); bool res = m_reflector->SetStringSelection(name); if (!res) m_reflector->SetSelection(0); } m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1)); m_channel->Append(wxT("A")); m_channel->Append(wxT("B")); m_channel->Append(wxT("C")); m_channel->Append(wxT("D")); m_channel->Append(wxT("E")); sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); res = m_channel->SetStringSelection(reflector.Right(1U)); if (!res) m_channel->SetSelection(0); #endif #if defined(DCS_LINK) wxStaticText* reflectorLabel = new wxStaticText(this, -1, _("Reflector")); sizer->Add(reflectorLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_reflector = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); m_reflector->Append(_("None")); wxFileName fileName(wxFileName::GetHomeDir(), DCS_HOSTS_FILE_NAME); if (!fileName.IsFileReadable()) { wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); #if defined(__WINDOWS__) fileName.Assign(::wxGetCwd(), DCS_HOSTS_FILE_NAME); #else fileName.Assign(wxT(DATA_DIR), DCS_HOSTS_FILE_NAME); #endif if (!fileName.IsFileReadable()) wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str()); } CHostFile file(fileName.GetFullPath(), false); for (unsigned int i = 0U; i < file.getCount(); i++) m_reflector->Append(file.getName(i)); sizer->Add(m_reflector, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); if (reflector.IsEmpty()) { m_reflector->SetSelection(0); } else { wxString name = reflector; name.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); bool res = m_reflector->SetStringSelection(name); if (!res) m_reflector->SetSelection(0); } m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1)); m_channel->Append(wxT("A")); m_channel->Append(wxT("B")); m_channel->Append(wxT("C")); m_channel->Append(wxT("D")); m_channel->Append(wxT("E")); m_channel->Append(wxT("F")); m_channel->Append(wxT("G")); m_channel->Append(wxT("H")); m_channel->Append(wxT("I")); m_channel->Append(wxT("J")); m_channel->Append(wxT("K")); m_channel->Append(wxT("L")); m_channel->Append(wxT("M")); m_channel->Append(wxT("N")); m_channel->Append(wxT("O")); m_channel->Append(wxT("P")); m_channel->Append(wxT("Q")); m_channel->Append(wxT("R")); m_channel->Append(wxT("S")); m_channel->Append(wxT("T")); m_channel->Append(wxT("U")); m_channel->Append(wxT("V")); m_channel->Append(wxT("W")); m_channel->Append(wxT("X")); m_channel->Append(wxT("Y")); m_channel->Append(wxT("Z")); sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); res = m_channel->SetStringSelection(reflector.Right(1U)); if (!res) m_channel->SetSelection(0); #endif SetAutoLayout(true); SetSizer(sizer); } CStarNetSet::~CStarNetSet() { } bool CStarNetSet::Validate() { int n = m_band->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The StarNet Band is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } n = m_userTimeout->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The StarNet user timeout is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } n = m_groupTimeout->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The StarNet group timeout is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } n = m_callsignSwitch->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The MYCALL Setting is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } n = m_txMsgSwitch->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The TX Message switch is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } #if defined(DEXTRA_LINK) || defined(DCS_LINK) n = m_reflector->GetCurrentSelection(); if (n == wxNOT_FOUND) { wxMessageDialog dialog(this, _("The StarNet reflector link is not set"), m_title + _(" Error"), wxICON_ERROR); dialog.ShowModal(); return false; } #endif return true; }
//------------------------------------------------------------------------------ ViewTextDialog::ViewTextDialog(wxWindow *parent, const wxString& title, bool isEditable, const wxPoint &pos, const wxSize &size, long style) : wxDialog(parent, -1, title, pos, size, style, title) { isTextEditable = isEditable; // create bottom buttons theOkButton = new wxButton(this, ID_BUTTON, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0); if (isTextEditable) theCancelButton = new wxButton(this, ID_BUTTON, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0); // adds the buttons to button sizer theButtonSizer = new wxBoxSizer(wxHORIZONTAL); theButtonSizer->Add(theOkButton, 0, wxALIGN_CENTER | wxALL, 2); if (isTextEditable) theButtonSizer->Add(theCancelButton, 0, wxALIGN_CENTER | wxALL, 2); theBottomSizer = new wxBoxSizer(wxVERTICAL); theBottomSizer->Add(theButtonSizer, 0, wxALIGN_CENTER | wxALL, 2); // Set additional style wxTE_RICH to Ctrl + mouse scroll wheel to decrease or // increase text size(loj: 2009.02.05) if (isTextEditable) theText = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, size, wxTE_PROCESS_ENTER); else theText = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, size, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH); if (!isTextEditable) theText->SetMaxLength(320000); //theText->SetFont( GmatAppData::GetFont()); // add items to middle sizer theMiddleSizer = new wxBoxSizer(wxVERTICAL); if (isTextEditable) theMiddleSizer->Add(theText, 0, wxGROW|wxALL, 2); else theMiddleSizer->Add(theText, 1, wxGROW|wxALL, 2); // add items to dialog sizer wxBoxSizer *dialogSizer = new wxBoxSizer(wxVERTICAL); if (isTextEditable) { dialogSizer->Add(theMiddleSizer, 0, wxGROW | wxALL, 1); dialogSizer->Add(theBottomSizer, 0, wxGROW | wxALL, 1); } else { dialogSizer->Add(theMiddleSizer, 1, wxGROW | wxALL, 1); dialogSizer->Add(theBottomSizer, 0, wxGROW | wxALL, 1); } // tells the enclosing window to adjust to the size of the sizer SetAutoLayout(TRUE); SetSizer(dialogSizer); dialogSizer->Fit(this); dialogSizer->SetSizeHints(this); // Set icon if icon file is in the start up file FileManager *fm = FileManager::Instance(); try { wxString iconfile = fm->GetFullPathname(wxT("MAIN_ICON_FILE")).c_str(); #if defined __WXMSW__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_ICO)); #elif defined __WXGTK__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_XPM)); #elif defined __WXMAC__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_PICT_RESOURCE)); #endif } catch (GmatBaseException &) { //MessageInterface::ShowMessage(e.GetMessage()); } if (!isTextEditable) CenterOnScreen(wxBOTH); }
wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, const wxString& message, const wxString& prompt, const wxString& caption, long value, long min, long max, const wxPoint& pos) : wxDialog(parent, wxID_ANY, caption, pos, wxDefaultSize) { m_value = value; m_max = max; m_min = min; wxBeginBusyCursor(); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); #if wxUSE_STATTEXT // 1) text message topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 ); #endif // 2) prompt and text ctrl wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL ); #if wxUSE_STATTEXT // prompt if any if (!prompt.empty()) inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 ); #endif // spin ctrl wxString valStr; valStr.Printf(wxT("%ld"), m_value); m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultCoord ) ); #if wxUSE_SPINCTRL m_spinctrl->SetRange((int)m_min, (int)m_max); #endif inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 ); // add both topsizer->Add( inputsizer, 0, wxEXPAND | wxLEFT|wxRIGHT, 5 ); // 3) buttons if any wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL); if ( buttonSizer ) { topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder()); } SetSizer( topsizer ); SetAutoLayout( true ); topsizer->SetSizeHints( this ); topsizer->Fit( this ); Centre( wxBOTH ); m_spinctrl->SetSelection(-1, -1); m_spinctrl->SetFocus(); wxEndBusyCursor(); }
// Constructor WxCasFrame::WxCasFrame ( const wxString & title ) : wxFrame ( ( wxFrame * ) NULL, -1, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE ) { // Give it an icon #ifdef __WXMSW__ wxIcon icon(wxT("wxcas")); #else wxIcon icon; icon.CopyFromBitmap( WxCasPix::getPixmap( wxT( "wxcas" ) ) ); #endif SetIcon ( icon ); // Prefs wxConfigBase * prefs = wxConfigBase::Get(); m_maxLineCount = 0; // Check if we have a previous DL max hit double absoluteMaxDL = ( double ) ( prefs->Read ( WxCasCte::ABSOLUTE_MAX_DL_KEY, 0L ) ) / 1024.0; // Stored in bytes wxDateTime absoluteMaxDlDate( ( time_t ) ( prefs->Read ( WxCasCte::ABSOLUTE_MAX_DL_DATE_KEY, ( long ) ( wxDateTime::Now().GetTicks() ) ) ) ); // Stored in Ticks // Add Online Sig file m_aMuleSig = new OnLineSig ( wxFileName( prefs-> Read ( WxCasCte::AMULESIG_PATH_KEY, WxCasCte::DEFAULT_AMULESIG_PATH ), WxCasCte::AMULESIG_FILENAME ), absoluteMaxDL, absoluteMaxDlDate ); //Save absolute hit if we reach it during constructing if ( m_aMuleSig->IsSessionMaxDlChanged() ) { SaveAbsoluteHits(); } #ifdef __LINUX__ // System monitoring on Linux m_sysMonitor = new LinuxMon (); #endif // Status Bar CreateStatusBar (); SetStatusText ( _( "Welcome!" ) ); // Frame Vertical sizer m_frameVBox = new wxBoxSizer ( wxVERTICAL ); // Add Main panel to frame (needed by win32 for padding sub panels) m_mainPanel = new wxPanel ( this, -1 ); // Main Panel Vertical Sizer m_mainPanelVBox = new wxBoxSizer ( wxVERTICAL ); // Main Panel static line m_staticLine = new wxStaticLine ( m_mainPanel, -1 ); #ifdef __WXMSW__ m_BottomStaticLine = new wxStaticLine ( m_mainPanel, -1 ); #endif // Statistics Static Vertical Box Sizer m_sigPanelSBox = new wxStaticBox ( m_mainPanel, -1, _( "aMule" ) ); m_sigPanelSBoxSizer = new wxStaticBoxSizer ( m_sigPanelSBox, wxVERTICAL ); // Hit Static Horizontal Box Sizer m_hitPanelSBox = new wxStaticBox ( m_mainPanel, -1, _( "Maximum DL rate since wxCas is running" ) ); m_hitPanelSBoxSizer = new wxStaticBoxSizer ( m_hitPanelSBox, wxHORIZONTAL ); // Hit Static Horizontal Box Sizer m_absHitPanelSBox = new wxStaticBox ( m_mainPanel, -1, _( "Absolute Maximum DL rate during wxCas previous runs" ) ); m_absHitPanelSBoxSizer = new wxStaticBoxSizer ( m_absHitPanelSBox, wxHORIZONTAL ); // Statistic labels m_statLine_1 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_1() ); m_statLine_2 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_2() ); m_statLine_3 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_3() ); m_statLine_4 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_4() ); m_statLine_5 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_5() ); m_statLine_6 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_6() ); m_statLine_7 = new wxStaticText ( m_mainPanel, -1, MakeStatLine_7() ); m_hitLine = new wxStaticText ( m_mainPanel, -1, MakeHitsLine_1() ); m_hitButton = new wxButton ( m_mainPanel, ID_HIT_BUTTON, wxString ( _( "Reset" ) ) ); m_absHitLine = new wxStaticText ( m_mainPanel, -1, MakeHitsLine_2() ); m_absHitButton = new wxButton ( m_mainPanel, ID_ABS_HIT_BUTTON, wxString ( _( "Reset" ) ) ); #ifdef __LINUX__ // System monitoring on Linux // Monitoring Static Vertical Box Sizer m_monPanelSBox = new wxStaticBox ( m_mainPanel, -1, _( "System" ) ); m_monPanelSBoxSizer = new wxStaticBoxSizer ( m_monPanelSBox, wxVERTICAL ); m_sysLine_1 = new wxStaticText ( m_mainPanel, -1, MakeSysLine_1() ); m_sysLine_2 = new wxStaticText ( m_mainPanel, -1, MakeSysLine_2() ); #endif // Statistic Panel Layout m_sigPanelSBoxSizer->Add ( m_statLine_1, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_2, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_3, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_4, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_5, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_6, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_sigPanelSBoxSizer->Add ( m_statLine_7, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_hitPanelSBoxSizer->Add ( m_hitLine, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxGROW, 5 ); m_hitPanelSBoxSizer->Add ( m_hitButton, 0, wxALL | wxALIGN_RIGHT, 5 ); m_absHitPanelSBoxSizer->Add ( m_absHitLine, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxGROW, 5 ); m_absHitPanelSBoxSizer->Add ( m_absHitButton, 0, wxALL | wxALIGN_RIGHT, 5 ); #ifdef __LINUX__ // System monitoring on Linux m_monPanelSBoxSizer->Add ( m_sysLine_1, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); m_monPanelSBoxSizer->Add ( m_sysLine_2, 0, wxALL | wxALIGN_CENTER | wxGROW, 5 ); #endif // Main panel Layout m_mainPanelVBox->Add ( m_staticLine, 0, wxALL | wxALIGN_CENTER | wxGROW ); m_mainPanelVBox->Add ( m_sigPanelSBoxSizer, 0, wxALL | wxALIGN_CENTER | wxGROW, 10 ); #ifdef __LINUX__ // System monitoring on Linux m_mainPanelVBox->Add ( m_monPanelSBoxSizer, 0, wxALL | wxALIGN_CENTER | wxGROW, 10 ); #endif m_mainPanelVBox->Add ( m_hitPanelSBoxSizer, 0, wxALL | wxALIGN_CENTER | wxGROW, 10 ); m_mainPanelVBox->Add ( m_absHitPanelSBoxSizer, 0, wxALL | wxALIGN_CENTER | wxGROW, 10 ); #ifdef __WXMSW__ m_mainPanelVBox->Add ( m_BottomStaticLine, 0, wxALL | wxALIGN_CENTER | wxGROW ); #endif // Toolbar Pixmaps m_toolBarBitmaps[ 0 ] = WxCasPix::getPixmap( wxT( "refresh" ) ); m_toolBarBitmaps[ 1 ] = WxCasPix::getPixmap( wxT( "save" ) ); m_toolBarBitmaps[ 2 ] = WxCasPix::getPixmap( wxT( "print" ) ); m_toolBarBitmaps[ 3 ] = WxCasPix::getPixmap( wxT( "about" ) ); m_toolBarBitmaps[ 4 ] = WxCasPix::getPixmap( wxT( "stop" ) ); m_toolBarBitmaps[ 5 ] = WxCasPix::getPixmap( wxT( "prefs" ) ); // Constructing toolbar m_toolbar = new wxToolBar ( this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_FLAT ); m_toolbar->SetToolBitmapSize ( wxSize ( 32, 32 ) ); m_toolbar->SetMargins ( 2, 2 ); m_toolbar->AddTool ( ID_BAR_REFRESH, wxT( "Refresh" ), m_toolBarBitmaps[ 0 ], _( "Stop Auto Refresh" ) ); m_toolbar->AddSeparator (); m_toolbar->AddTool ( ID_BAR_SAVE, wxT( "Save" ), m_toolBarBitmaps[ 1 ], _( "Save Online Statistics image" ) ); m_toolbar->AddTool ( ID_BAR_PRINT, wxT( "Print" ), m_toolBarBitmaps[ 2 ], _( "Print Online Statistics image" ) ); m_toolbar->AddTool ( ID_BAR_PREFS, wxT( "Prefs" ), m_toolBarBitmaps[ 5 ], _( "Preferences setting" ) ); m_toolbar->AddSeparator (); m_toolbar->AddTool ( ID_BAR_ABOUT, wxT( "About" ), m_toolBarBitmaps[ 3 ], _( "About wxCas" ) ); m_toolbar->Realize (); SetToolBar ( m_toolbar ); // Panel Layout m_mainPanel->SetAutoLayout( true ); m_mainPanel->SetSizer ( m_mainPanelVBox ); // Frame Layout m_frameVBox->Add ( m_mainPanel, 1, wxALL | wxGROW ); SetAutoLayout ( TRUE ); SetSizerAndFit ( m_frameVBox ); // Add refresh timer m_refresh_timer = new wxTimer ( this, ID_REFRESH_TIMER ); m_refresh_timer->Start ( 1000 * prefs->Read ( WxCasCte::REFRESH_RATE_KEY, WxCasCte::DEFAULT_REFRESH_RATE ) ); // s to ms // Add FTP update timer m_ftp_update_timer = new wxTimer ( this, ID_FTP_UPDATE_TIMER ); m_ftp_update_timer->Start ( 60000 * prefs->Read ( WxCasCte::FTP_UPDATE_RATE_KEY, WxCasCte::DEFAULT_FTP_UPDATE_RATE ) ); // min to ms }
void LuminaryPanel::doLayout() { wxBoxSizer* m_panelSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* m_timeStepSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_resSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_omegaDiffSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_omegaProjSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_epsilonSizer = new wxBoxSizer(wxHORIZONTAL); if(m_luminary){ wxBoxSizer* m_posSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_wickSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_skeletonsNumberSizer = new wxBoxSizer(wxHORIZONTAL); /* Luminaire */ m_posSizer->Add(m_posLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_posSizer->Add(m_posXTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_posSizer->Add(m_posYTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_posSizer->Add(m_posZTextCtrl, 0, wxLEFT|wxADJUST_MINSIZE, 10); m_panelSizer->Add(m_posSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); m_wickSizer->Add(m_wickLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_wickSizer->Add(m_wickTextCtrl, 0, wxLEFT|wxADJUST_MINSIZE, 8); m_wickSizer->Add(m_wickBrowseButton, 0, wxADJUST_MINSIZE, 0); m_panelSizer->Add(m_wickSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); /* Flame */ m_panelSizer->Add(m_luminaryTypeRadioBox, 0, wxADJUST_MINSIZE, 0); m_skeletonsNumberSizer->Add(m_skeletonsNumberLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_skeletonsNumberSizer->Add(m_skeletonsNumberCtrl, 0, wxLEFT|wxADJUST_MINSIZE, 8); m_panelSizer->Add(m_skeletonsNumberSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); } /* Field */ m_panelSizer->Add(m_solverTypeRadioBox, 0, wxADJUST_MINSIZE, 0); m_resSizer->Add(m_resLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_resSizer->Add(m_resXTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); if(m_luminary){ m_resSizer->Add(m_resYTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_resSizer->Add(m_resZTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); } m_panelSizer->Add(m_resSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); if(m_luminary){ wxBoxSizer* m_dimSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* m_scaleSizer = new wxBoxSizer(wxHORIZONTAL); m_dimSizer->Add(m_dimLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_dimSizer->Add(m_dimTextCtrl, 0, wxLEFT|wxADJUST_MINSIZE, 8); m_panelSizer->Add(m_dimSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); m_scaleSizer->Add(m_scaleLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_scaleSizer->Add(m_scaleXTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_scaleSizer->Add(m_scaleYTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_scaleSizer->Add(m_scaleZTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_panelSizer->Add(m_scaleSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); } m_timeStepSizer->Add(m_timeStepLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_timeStepSizer->Add(m_timeStepTextCtrl, 0, wxLEFT|wxADJUST_MINSIZE, 12); m_panelSizer->Add(m_timeStepSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); m_omegaDiffSizer->Add(m_omegaDiffLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_omegaDiffSizer->Add(m_omegaDiffTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_panelSizer->Add(m_omegaDiffSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); m_omegaProjSizer->Add(m_omegaProjLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_omegaProjSizer->Add(m_omegaProjTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_panelSizer->Add(m_omegaProjSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); m_epsilonSizer->Add(m_epsilonLabel, 0, wxLEFT|wxTOP|wxADJUST_MINSIZE, 3); m_epsilonSizer->Add(m_epsilonTextCtrl, 0, wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); m_panelSizer->Add(m_epsilonSizer, 0, wxTOP|wxBOTTOM|wxEXPAND, 5); SetAutoLayout(true); SetSizer(m_panelSizer); m_panelSizer->Fit(this); m_panelSizer->SetSizeHints(this); }