void CMainFrame::CreateMyToolBar() { m_toolbar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_TEXT, TOOLBAR_TOOLS); wxBitmap toolBarBitmaps[4]; toolBarBitmaps[0] = wxBitmap(wxT("img/new.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[1] = wxBitmap(wxT("img/open.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[2] = wxBitmap(wxT("img/save.bmp"),wxBITMAP_TYPE_BMP); toolBarBitmaps[3] = wxBitmap(wxT("img/draw.bmp"),wxBITMAP_TYPE_BMP); m_toolbar->SetToolBitmapSize(wxSize(toolBarBitmaps[0].GetWidth(), toolBarBitmaps[0].GetHeight())); m_toolbar->AddTool(M_NOUVEAU_FICHIER, wxT("Nouveau"), toolBarBitmaps[0]); m_toolbar->AddTool(M_OUVRIR, wxT("Ouvrir"), toolBarBitmaps[1]); m_toolbar->AddTool(M_SAUVEGARDER, wxT("Sauvegarder"), toolBarBitmaps[2]); m_toolbar->AddSeparator(); m_toolbar->AddTool(M_GESTION_TRIANGLES, wxT("Gestion des triangles"), toolBarBitmaps[3], wxT("Gestion des triangles")); m_toolbar->EnableTool(M_GESTION_TRIANGLES, false); m_toolbar->Realize(); SetToolBar(m_toolbar); }
// Constructor MyFrame::MyFrame(wxWindow* parent) { // Load up this frame from XRC. [Note, instead of making a class's // constructor take a wxWindow* parent with a default value of NULL, // we could have just had designed MyFrame class with an empty // constructor and then written here: // wxXmlResource::Get()->LoadFrame(this, (wxWindow* )NULL, "main_frame"); // since this frame will always be the top window, and thus parentless. // However, the current approach has source code that can be recycled // for other frames that aren't the top level window.] wxXmlResource::Get()->LoadFrame(this, parent, wxT("main_frame")); // Set the icon for the frame. SetIcon(wxICON(sample)); // Load the menubar from XRC and set this frame's menubar to it. SetMenuBar(wxXmlResource::Get()->LoadMenuBar(wxT("main_menu"))); // Load the toolbar from XRC and set this frame's toolbar to it. // NOTE: For toolbars you currently should do it exactly like this. // With toolbars, you currently can't create one, and set it later. It // needs to be all in one step. wxSystemOptions::SetOption ( wxT("msw.remap"), 0 ); SetToolBar(wxXmlResource::Get()->LoadToolBar(this, wxT("main_toolbar"))); #if wxUSE_STATUSBAR // Give the frame an optional statusbar. The '1' just means one field. // A gripsizer will automatically get put on into the corner, if that // is the normal OS behaviour for frames on that platform. Helptext // for menu items and toolbar tools will automatically get displayed // here. CreateStatusBar( 1 ); #endif // wxUSE_STATUSBAR // As we have created the toolbar and status bar after loading the main // frame from resources, we need to readjust its minimal size to fit both // its client area contains and the bars. GetSizer()->SetSizeHints(this); }
wxGDCMFrameBase::wxGDCMFrameBase(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) { // begin wxGlade: wxGDCMFrameBase::wxGDCMFrameBase Notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, 0); TopFrameMenubar = new wxMenuBar(); SetMenuBar(TopFrameMenubar); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(wxID_OPEN, wxT("&Open...\tCtrl+o"), wxT("Open DICOM file"), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxNewId(), wxT("&Rewrite...\tCtrl+r"), wxT("Rewrite DICOM file"), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxNewId(), wxT("&Save...\tCtrl+s"), wxT("Save DICOM File"), wxITEM_NORMAL); wxglade_tmp_menu_1->AppendSeparator(); wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("E&xit...\tCtrl+x"), wxT("Exit app"), wxITEM_NORMAL); TopFrameMenubar->Append(wxglade_tmp_menu_1, wxT("File")); wxMenu* wxglade_tmp_menu_2 = new wxMenu(); TopFrameMenubar->Append(wxglade_tmp_menu_2, wxT("Tools")); wxMenu* wxglade_tmp_menu_3 = new wxMenu(); wxglade_tmp_menu_3->Append(wxID_HELP, wxT("&About...\tCtrl+a"), wxT("About Dialog"), wxITEM_NORMAL); TopFrameMenubar->Append(wxglade_tmp_menu_3, wxT("Help")); TopFrameStatusbar = CreateStatusBar(1, 0); TopFrameToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_TEXT); SetToolBar(TopFrameToolbar); TopFrameToolbar->AddTool(wxNewId(), wxT("tool"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); TopFrameToolbar->AddSeparator(); TopFrameToolbar->AddTool(wxNewId(), wxT("tool"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); TopFrameToolbar->AddSeparator(); TopFrameToolbar->AddTool(wxNewId(), wxT("tool"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); TopFrameToolbar->Realize(); TreeCtrl = new wxTreeCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); ListCtrl = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); VTKWindow = new wxVTKRenderWindowInteractor(Notebook, -1); Grid = new wxGrid(Notebook, -1); set_properties(); do_layout(); // end wxGlade }
wxWebBrowserShell::wxWebBrowserShell(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)), m_checkBeforeLoad(false) { // create a menu bar wxMenu *fileMenu = new wxMenu; fileMenu->Append(ID_NEW_WINDOW, _T("New Window\tCTRL+N")); fileMenu->Append(ID_LOADFILE, _T("Open File...\tCTRL+O")); fileMenu->Append(ID_LOADURL, _("Open Location...\tCTRL+L")); fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit this program")); wxMenu *editMenu = new wxMenu; editMenu->Append(wxID_CUT, _T("Cut\tCTRL+X")); editMenu->Append(wxID_COPY, _T("Copy\tCTRL+C")); editMenu->Append(wxID_PASTE, _T("Paste\tCTRL+V")); wxMenu* viewMenu = new wxMenu; viewMenu->AppendRadioItem(ID_BROWSE, _("Browse")); viewMenu->AppendRadioItem(ID_EDIT, _("Edit")); viewMenu->AppendSeparator(); viewMenu->Append(ID_STOP, _("Stop")); viewMenu->Append(ID_RELOAD, _("Reload Page")); viewMenu->Append(ID_MAKE_TEXT_SMALLER, _("Make Text Smaller\tCTRL+-")); viewMenu->Append(ID_MAKE_TEXT_LARGER, _("Make Text Bigger\tCTRL++")); viewMenu->AppendSeparator(); viewMenu->Append(ID_GET_SOURCE, _("View Page Source")); viewMenu->AppendSeparator(); m_debugMenu = new wxMenu; m_debugMenu->Append(ID_SET_SOURCE, _("Test SetPageSource")); m_debugMenu->Append(ID_RUN_SCRIPT, _("Test RunScript")); // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); menuBar->Append(editMenu, _T("&Edit")); menuBar->Append(viewMenu, _T("&View")); menuBar->Append(helpMenu, _T("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); wxToolBar* toolbar = CreateToolBar(); toolbar->SetToolBitmapSize(wxSize(32, 32)); wxBitmap back = wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_TOOLBAR, wxSize(32,32)); toolbar->AddTool(ID_BACK, back, wxT("Back")); wxBitmap forward = wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_TOOLBAR, wxSize(32,32)); toolbar->AddTool(ID_FORWARD, forward, wxT("Next")); addressBar = new wxTextCtrl(toolbar, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(400, -1), wxTE_PROCESS_ENTER); toolbar->AddControl(addressBar); searchCtrl = new wxSearchCtrl(toolbar, ID_SEARCHCTRL, _("Search"), wxDefaultPosition, wxSize(200, -1), wxTE_PROCESS_ENTER); toolbar->AddControl(searchCtrl); toolbar->Realize(); SetToolBar(toolbar); // Create the wxWebView Window webview = new wxWebView((wxWindow*)this, ID_WEBVIEW, wxDefaultPosition, wxSize(200, 200)); webview->SetBackgroundColour(*wxWHITE); // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); }
void WinEDA3D_DrawFrame::ReCreateHToolbar(void) /*********************************************/ { if ( m_HToolBar != NULL ) { // simple mise a jour de la liste des fichiers anciens SetToolbars(); return; } m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); SetToolBar(m_HToolBar); // Set up toolbar m_HToolBar->AddTool(ID_RELOAD3D_BOARD, "", BITMAP(import3d_xpm), _("Reload board")); #ifdef __WINDOWS__ // do not work properly under linux m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_TOOL_SCREENCOPY_TOCLIBBOARD, "", BITMAP(copy_button), _("Copy 3D Image to Clipboard")); #endif m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, "", BITMAP(zoom_in_xpm), _("zoom + (F1)")); m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, "", BITMAP(zoom_out_xpm), _("zoom - (F2)")); m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, "", BITMAP(repaint_xpm), _("redraw (F3)")); m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, "", BITMAP(zoom_optimal_xpm), _("auto zoom")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ROTATE3D_X_POS, "", BITMAP(rotate_pos_X_xpm), _("Rotate X ->") ); m_HToolBar->AddTool(ID_ROTATE3D_X_NEG, "", BITMAP(rotate_neg_X_xpm), _("Rotate X <-") ); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ROTATE3D_Y_POS, "", BITMAP(rotate_pos_Y_xpm), _("Rotate Y ->") ); m_HToolBar->AddTool(ID_ROTATE3D_Y_NEG, "", BITMAP(rotate_neg_Y_xpm), _("Rotate Y <-") ); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ROTATE3D_Z_POS, "", BITMAP(rotate_pos_Z_xpm), _("Rotate Z ->") ); m_HToolBar->AddTool(ID_ROTATE3D_Z_NEG, "", BITMAP(rotate_neg_Z_xpm), _("Rotate Z <-") ); m_HToolBar->Realize(); // SetToolbars(); }
void WinEDA_GerberFrame::ReCreateHToolbar(void) /***********************************************/ { int layer = 0; GERBER_Descr * gerber_layer = NULL; int ii; // delete and recreate the toolbar if ( m_HToolBar != NULL ) return; if ( GetScreen() ) { layer = GetScreen()->m_Active_Layer; gerber_layer = g_GERBER_Descr_List[layer]; } m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); SetToolBar(m_HToolBar); // Set up toolbar m_HToolBar->AddTool(ID_NEW_BOARD, BITMAP(new_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("New World") ); m_HToolBar->AddTool(ID_LOAD_FILE, BITMAP(open_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Open existing Layer")); #if 0 m_HToolBar->AddTool(ID_SAVE_PROJECT, BITMAP(save_button), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Save World")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_SHEET_SET, BITMAP(sheetset_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("page settings (size, texts)")); #endif m_HToolBar->AddSeparator(); #if 0 m_HToolBar->AddTool(wxID_CUT, BITMAP(cut_button), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Cut selected item")); m_HToolBar->AddTool(wxID_COPY, BITMAP(copy_button), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Copy selected item")); m_HToolBar->AddTool(wxID_PASTE, BITMAP(paste_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Paste")); #endif m_HToolBar->AddTool(ID_UNDO_BUTT, BITMAP(undelete_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Undelete")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_GEN_PRINT, BITMAP(print_button), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Print World")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, BITMAP(zoom_in_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("zoom + (F1)")); m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, BITMAP(zoom_out_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("zoom - (F2)")); m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, BITMAP(repaint_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("redraw (F3)")); m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, BITMAP(zoom_optimal_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("auto zoom")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_FIND_ITEMS, BITMAP(find_xpm), wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Find D Codes")); wxArrayString choices; m_HToolBar->AddSeparator(); for ( ii = 0; ii < 32 ; ii ++ ) { wxString msg; msg = _("Layer "); msg << ii+1; choices.Add(msg); } m_SelLayerBox = new wxComboBox(m_HToolBar, ID_TOOLBARH_PCB_SELECT_LAYER,"", wxDefaultPosition, wxSize(150, -1), choices, wxCB_READONLY); m_SelLayerBox->SetSelection( GetScreen()->m_Active_Layer ); m_HToolBar->AddControl(m_SelLayerBox); m_HToolBar->AddSeparator(); choices.Clear(); choices.Add( _("No tool")); for ( ii = 0; ii < MAX_TOOLS ; ii ++ ) { wxString msg; msg = _("Tool "); msg << ii + FIRST_DCODE; choices.Add(msg); } m_SelLayerTool = new wxComboBox(m_HToolBar, ID_TOOLBARH_GERBER_SELECT_TOOL,"", wxDefaultPosition, wxSize(150, -1), choices, wxCB_READONLY); m_HToolBar->AddControl(m_SelLayerTool); // after adding the buttons to the toolbar, must call Realize() to reflect // the changes m_HToolBar->Realize(); SetToolbars(); }
V4StudioFrame::V4StudioFrame(): wxFrame((wxFrame *) NULL, -1, "V4Studio", wxPoint(50, 50), wxSize(800, 700)) { m_pV4sm = NULL; m_selection = NULL; m_parentSelection = NULL; m_clipboardNode = NULL; m_frame = 0; // we start at frame=0 editDict = false; // Creates components and places them on the form fieldView = new V4FieldList(this, wxSize(100,250)); treeView = new V4StudioTree(this, wxSize(100,250), fieldView); timeLine = new V4TimeLine(this); timeLine->SetSize(500, 100); cmdPanel = new V4CommandPanel(this); cmdPanel->SetSize(100, 100); /*new m_pFileMenu bar*/ wxMenuBar *b = new wxMenuBar(); /*file*/ m_pFileMenu = new wxMenu(); m_pFileMenu->Append(MENU_FILE_NEW, "&New\tCtrl+N", "Create a new document"); m_pFileMenu->Append(MENU_FILE_OPEN, "&Open...\tCtrl+O", "Open an existing document"); m_pFileMenu->Append(MENU_FILE_SAVE, "&Save\tCtrl+S", "Save the active document"); m_pFileMenu->Append(MENU_FILE_CLOSE, "&Close\tCtrl+X", "Close the active document"); m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(CHANGE_SIZE_DIALOG, "&Size\tCtrl+Z", "Change scene size"); m_pFileMenu->Append(CHANGE_FRAMERATE, "&FrameRate\tCtrl+F", "Change FrameRate"); m_pFileMenu->Append(CHANGE_LENGTH, "&Length\tCtrl+L", "Change Length"); m_pFileMenu->AppendSeparator(); m_pFileMenu->Append(MENU_FILE_QUIT, "E&xit", "Quit the application; prompts to save documents"); b->Append(m_pFileMenu, "&File"); SetMenuBar(b); /*file*/ m_pToolsMenu = new wxMenu(); m_pToolsMenu->Append(MENU_TOOL_SHOW_LOWLEVEL, "&Low-Level\tCtrl+L", "Shows the low-level toolbar"); m_pToolsMenu->Append(MENU_TOOL_SHOW_HIGHLEVEL, "&High-Level\tCtrl+H", "Shows the high-level toolbar"); b->Append(m_pToolsMenu, "&Tools"); SetMenuBar(b); m_pStatusbar = CreateStatusBar(); // Main Toolbar m_pMainToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_FLAT); m_pMainToolbar->AddTool(TOOL_FILE_NEW, _("New"), wxBitmap (wxT("rc\\new.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open a new file"), wxT("")); m_pMainToolbar->AddTool(TOOL_FILE_OPEN, _("Open"), wxBitmap (wxT("rc\\open.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open an existing file (BT/XMT/MP4)"), wxT("")); m_pMainToolbar->AddTool(TOOL_FILE_SAVE, _("Save"), wxBitmap (wxT("rc\\save.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Save to a file"), wxT("")); m_pMainToolbar->AddTool(TOOL_FILE_CLOSE, _("Close"), wxBitmap (wxT("rc\\close.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Close the file"), wxT("")); m_pMainToolbar->AddSeparator(); m_pMainToolbar->AddTool(TOOL_FILE_PREVIEW, _("Preview"), wxBitmap (wxT("rc\\preview.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Preview in player"), wxT("")); m_pMainToolbar->AddSeparator(); m_pMainToolbar->AddTool(TOOL_EDIT_CUT, _("Cut"), wxBitmap (wxT("rc\\cut.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Cut"), wxT("")); m_pMainToolbar->AddTool(TOOL_EDIT_COPY, _("Copy"), wxBitmap (wxT("rc\\copy.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Copy"), wxT("")); m_pMainToolbar->AddTool(TOOL_EDIT_PASTE, _("Paste"), wxBitmap (wxT("rc\\paste.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Paste"), wxT("")); m_pMainToolbar->AddTool(TOOL_EDIT_PASTE_USE, _("PastePlus"), wxBitmap (wxT("rc\\paste_use.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Paste a USE"), wxT("")); m_pMainToolbar->AddTool(TOOL_EDIT_DELETE, _("Delete"), wxBitmap (wxT("rc\\delete.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Delete"), wxT("")); m_pMainToolbar->AddSeparator(); m_pMainToolbar->AddTool(TOOL_EDIT_UNDO, _("Undo"), wxBitmap (wxT("rc\\undo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Undo"), wxT("")); m_pMainToolbar->AddTool(TOOL_EDIT_REDO, _("Redo"), wxBitmap (wxT("rc\\redo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Redo"), wxT("")); m_pMainToolbar->AddSeparator(); m_pMainToolbar->AddSeparator(); m_pMainToolbar->AddTool(TOOL_ADD_TO_TL, _("AddToTL"), wxBitmap( wxT("rc\\paste.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add to timeLine"), wxT("")); m_pMainToolbar->AddTool(TOOL_NEXT_FRAME, _("NextFrame"), wxBitmap( wxT("rc\\redo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Next frame"), wxT("")); m_pMainToolbar->AddTool(TOOL_VIEW_DICT, _("ViewDict"), wxBitmap( wxT("rc\\open.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("View Dictionnary"), wxT("")); /* Not Implemented yet */ m_pMainToolbar->EnableTool(TOOL_FILE_PREVIEW, false); m_pMainToolbar->EnableTool(TOOL_EDIT_UNDO, false); m_pMainToolbar->EnableTool(TOOL_EDIT_REDO, false); m_pMainToolbar->EnableTool(TOOL_NEXT_FRAME, false); /* Not available when starting V4Studio */ /* Nothing to save */ m_pFileMenu->Enable(MENU_FILE_SAVE, false); m_pFileMenu->Enable(MENU_FILE_CLOSE, false); m_pFileMenu->Enable(CHANGE_SIZE_DIALOG, false); m_pFileMenu->Enable(CHANGE_LENGTH, false); m_pFileMenu->Enable(CHANGE_FRAMERATE, false); m_pMainToolbar->EnableTool(TOOL_FILE_SAVE, false); m_pMainToolbar->EnableTool(TOOL_FILE_CLOSE, false); /* Nothing to edit */ m_pMainToolbar->EnableTool(TOOL_EDIT_CUT, false); m_pMainToolbar->EnableTool(TOOL_EDIT_COPY, false); m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE, false); m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE_USE, false); m_pMainToolbar->EnableTool(TOOL_EDIT_DELETE, false); m_pMainToolbar->EnableTool(TOOL_ADD_TO_TL, false); m_pMainToolbar->EnableTool(TOOL_VIEW_DICT, false); m_pMainToolbar->Realize(); SetToolBar(m_pMainToolbar); m_uSelectedNodeToolBar = 0; // Node Creation Toolbar m_pLowLevelNodeToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL|wxTB_FLAT); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_ORDEREDGROUP, _("OrderedGroup"), wxBitmap (wxT("rc\\orderedgroup.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an OrderedGroup"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LAYER2D, _("Layer2D"), wxBitmap (wxT("rc\\layer2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Layer2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TRANSFORM2D, _("Transform2D"), wxBitmap (wxT("rc\\t2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Tranform2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TRANSFORMMATRIX2D, _("TransformMatrix2D"), wxBitmap (wxT("rc\\tm2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a TranformMatrix2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_COLOR_TRANSFORM, _("ColorTransform"), wxBitmap (wxT("rc\\colortransform.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a ColorTransform"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_SHAPE, _("Shape"), wxBitmap (wxT("rc\\shape.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Shape"), wxT("")); m_pLowLevelNodeToolbar->AddSeparator(); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_APPEARANCE, _("Appearance"), wxBitmap (wxT("rc\\appearance.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an Appearance"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_MATERIAL2D, _("Material2D"), wxBitmap (wxT("rc\\material2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Material2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LINEPROPS, _("LineProps"), wxBitmap (wxT("rc\\lineproperties.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a LineProperties"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LINEAR_GRADIENT, _("LinearGradient"), wxBitmap (wxT("rc\\lg.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Linear Gradient"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_RADIAL_GRADIENT, _("RadialGradient"), wxBitmap (wxT("rc\\rg.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Radial Gradient"), wxT("")); m_pLowLevelNodeToolbar->AddSeparator(); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_RECT, _("Rectangle"), wxBitmap (wxT("rc\\rect.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Rectangle"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_CIRCLE, _("Circle"), wxBitmap (wxT("rc\\circle.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Rectangle"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_IFS2D, _("IndexedFaceSet2D"), wxBitmap (wxT("rc\\ifs2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an IndexedFaceSet2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_ILS2D, _("IndexedLineSet2D"), wxBitmap (wxT("rc\\ils2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an IndexedLineSet2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_XLINEPROPS, _("XLineProps"), wxBitmap (wxT("rc\\xlineproperties.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an XLineProperties"), wxT("")); m_pLowLevelNodeToolbar->AddSeparator(); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TEXT, _("Text"), wxBitmap (wxT("rc\\text.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Text"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_FONTSTYLE, _("FontStyle"), wxBitmap (wxT("rc\\fs.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a FontStyle"), wxT("")); m_pLowLevelNodeToolbar->AddSeparator(); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_BACKGROUND2D, _("Background2D"), wxBitmap (wxT("rc\\image.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Background2D"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_MOVIE, _("Movie"), wxBitmap (wxT("rc\\movie.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Movie"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_IMAGE, _("Image"), wxBitmap (wxT("rc\\image.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add an Image"), wxT("")); m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_SOUND, _("Sound"), wxBitmap (wxT("rc\\sound.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Sound"), wxT("")); m_pLowLevelNodeToolbar->Realize(); /* m_pHighLevelNodeToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL|wxTB_FLAT); m_pHighLevelNodeToolbar->AddTool(TOOL_NEW_2DSCENE, _("OrderedGroup"), wxBitmap (wxT("rc\\orderedgroup.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Creates a 2D scene"), wxT("")); m_pHighLevelNodeToolbar->Realize(); */ set_properties(); do_layout(); UpdateToolBar(); }
void wxMFrame::OnMenuCommand(int id) { // is it a module generated entry? if(id >= WXMENU_MODULES_BEGIN && id < WXMENU_MODULES_END) { ProcessModulesMenu(id); return; } switch(id) { case WXMENU_FILE_CLOSE: Close(); break; case WXMENU_FILE_COMPOSE_WITH_TEMPLATE: case WXMENU_FILE_COMPOSE: { wxString templ; if ( id == WXMENU_FILE_COMPOSE_WITH_TEMPLATE ) { templ = ChooseTemplateFor(MessageTemplate_NewMessage, this); if ( templ.empty() ) { // cancelled by user break; } } Profile_obj profile(GetFolderProfile()); Composer *composeView = Composer::CreateNewMessage(templ, profile); composeView->InitText(); } break; case WXMENU_FILE_SEND_OUTBOX: mApplication->SendOutbox(); break; case WXMENU_FILE_POST: { Profile_obj profile(GetFolderProfile()); Composer *composeView = Composer::CreateNewArticle(profile); composeView->InitText(); } case WXMENU_FILE_COLLECT: { FolderMonitor *mailCollector = mApplication->GetFolderMonitor(); if ( mailCollector ) { // when the user explicitly checks for the new mail, also update // the currently opened folder(s) and give the verbose messages mailCollector->CheckNewMail(FolderMonitor::Interactive | FolderMonitor::Opened); } } break; #ifdef USE_PYTHON case WXMENU_FILE_RUN_PYSCRIPT: { wxString path = mApplication->GetDataDir(); if ( !path.empty() ) path += DIR_SEPARATOR; path += _T("scripts"); wxString filename = MDialog_FileRequester ( _("Please select a Python script to run."), this, path, "", "py", "*.py", false, NULL /* profile */ ); if ( !filename.empty() ) { PythonRunScript(filename); } //else: cancelled by user } break; #endif // USE_PYTHON case WXMENU_FILE_AWAY_MODE: mApplication->SetAwayMode(GetMenuBar()->IsChecked(id)); break; case WXMENU_FILE_EXIT: // flush MEvent queues for safety MEventManager::DispatchPending(); if ( CanClose() ) { // this frame has been already asked whether it wants to exit, so // don't ask it again mApplication->AddToFramesOkToClose(this); // exit the application if other frames don't object mApplication->Exit(); } break; case WXMENU_FILE_IMPORT: ShowImportDialog(this); break; case WXMENU_EDIT_ADB: ShowAdbFrame(this); break; case WXMENU_EDIT_PREF: ShowOptionsDialog(this); break; case WXMENU_EDIT_FILTERS: (void) ConfigureAllFilters(this); break; case WXMENU_EDIT_MODULES: ShowModulesDialog(this); break; case WXMENU_EDIT_TEMPLATES: EditTemplates(this); break; case WXMENU_EDIT_RESTORE_PREF: (void)ShowRestoreDefaultsDialog(mApplication->GetProfile(), this); break; case WXMENU_EDIT_SAVE_PREF: if ( Profile::FlushAll() ) { wxLogStatus(this, _("Program preferences successfully saved.")); } else { ERRORMESSAGE((_("Couldn't save preferences."))); } break; case WXMENU_EDIT_CONFIG_SOURCES: ShowConfigSourcesDialog(this); break; case WXMENU_EDIT_EXPORT_PREF: case WXMENU_EDIT_IMPORT_PREF: { const bool doExport = id == WXMENU_EDIT_EXPORT_PREF; String path = MDialog_FileRequester ( doExport ? _("Choose file to export settings to") : _("Choose file to import settings from"), this, wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString, doExport // true => save, false => load ); if ( path.empty() ) break; ConfigSource_obj configSrc(ConfigSourceLocal::CreateDefault()), configDst(ConfigSourceLocal::CreateFile(path)); if ( !doExport ) { configSrc.Swap(configDst); } bool ok = ConfigSource::Copy(*configDst, *configSrc); if ( doExport ) { if ( ok ) { wxLogStatus(this, _("Settings successfully exported to file \"%s\""), path.c_str()); } else { wxLogError(_("Failed to export settings to the file \"%s\"."), path.c_str()); } } else // import { if ( ok ) { wxLogStatus(this, _("Settings successfully imported from \"%s\""), path.c_str()); } else { wxLogError(_("Failed to import settings from the file \"%s\"."), path.c_str()); } } } break; case WXMENU_HELP_ABOUT: MDialog_AboutDialog(this, false /* don't timeout */); break; case WXMENU_HELP_TIP: MDialog_ShowTip(this); break; case WXMENU_HELP_CONTEXT: MDialog_Message(_("Help not implemented for current context, yet."),this,_("Sorry")); break; case WXMENU_HELP_CONTENTS: mApplication->Help(MH_CONTENTS,this); break; case WXMENU_HELP_RELEASE_NOTES: mApplication->Help(MH_RELEASE_NOTES,this); break; case WXMENU_HELP_FAQ: mApplication->Help(MH_FAQ,this); break; case WXMENU_HELP_SEARCH: mApplication->Help(MH_SEARCH,this); break; case WXMENU_HELP_COPYRIGHT: mApplication->Help(MH_COPYRIGHT,this); break; // printing: case WXMENU_FILE_PRINT_SETUP: OnPrintSetup(); break; case WXMENU_FILE_PAGE_SETUP: OnPageSetup(); break; #ifdef USE_PS_PRINTING case WXMENU_FILE_PRINT_SETUP_PS: OnPrintSetup(); break; case WXMENU_FILE_PAGE_SETUP_PS: OnPageSetup(); break; #endif // USE_PS_PRINTING #ifdef USE_DIALUP case WXMENU_FILE_NET_ON: mApplication->GoOnline(); break; case WXMENU_FILE_NET_OFF: if(mApplication->CheckOutbox()) { if ( MDialog_YesNoDialog ( _("You have outgoing messages queued.\n" "Do you want to send them before going offline?"), this, MDIALOG_YESNOTITLE, M_DLG_YES_DEFAULT, M_MSGBOX_GO_OFFLINE_SEND_FIRST ) ) { mApplication->SendOutbox(); } } mApplication->GoOffline(); break; #endif // USE_DIALUP // create a new identity and edit it case WXMENU_FILE_IDENT_ADD: { wxString ident; if ( MInputBox(&ident, _("Mahogany: Create new identity"), _("Enter the identity name:"), this, "NewIdentity") ) { ShowIdentityDialog(ident, this); // update the identity combo in the toolbar of the main frame if // any (note that this will update all the other existing // identity combo boxes as they keep themselves in sync // internally) // // TODO: we really should have a virtual wxMFrame::GetIdentCombo // as we might not always create the main frame in the // future but other frames (e.g. composer) may have the // ident combo as well wxMFrame *frameTop = mApplication->TopLevelFrame(); if ( frameTop ) { wxToolBar *tbar = frameTop->GetToolBar(); if ( tbar ) { wxWindow *win = tbar->FindWindow(IDC_IDENT_COMBO); if ( win ) { wxChoice *combo = wxDynamicCast(win, wxChoice); combo->Append(ident); } } else { FAIL_MSG(_T("where is the main frames toolbar?")); } } wxLogStatus(this, _("Created new identity '%s'."), ident.c_str()); } } break; // change the current identity case WXMENU_FILE_IDENT_CHANGE: { wxArrayString identities = Profile::GetAllIdentities(); if ( identities.IsEmpty() ) { wxLogError(_("There are no existing identities to choose from.\n" "Please create an identity first.")); } else { identities.Insert(_("Default"), 0); int rc = MDialog_GetSelection ( _("Select the new identity"), MDIALOG_YESNOTITLE, identities, this ); if ( rc != -1 ) { Profile *profile = mApplication->GetProfile(); if ( rc == 0 ) { // restore the default identity profile->DeleteEntry(GetOptionName(MP_CURRENT_IDENTITY)); } else { wxString ident = identities[(size_t)rc]; profile->writeEntry(MP_CURRENT_IDENTITY, ident); } // update the identity combo in the toolbar if any wxWindow *win = GetToolBar()->FindWindow(IDC_IDENT_COMBO); if ( win ) { wxChoice *combo = wxDynamicCast(win, wxChoice); combo->SetSelection(rc); } // TODO: should update everything (all options might have // changed) } //else: dialog cancelled, nothing to do } } break; // edit an identity's parameters case WXMENU_FILE_IDENT_EDIT: { String ident; wxArrayString identities = Profile::GetAllIdentities(); if ( identities.IsEmpty() ) { wxLogError(_("There are no existing identities to edit.\n" "Please create an identity first.")); } else { if ( identities.GetCount() > 1 ) { int rc = MDialog_GetSelection ( _("Which identity would you like to edit?"), MDIALOG_YESNOTITLE, identities, this ); if ( rc != -1 ) { ident = identities[(size_t)rc]; } //else: dialog was cancelled } else // only one identity { // use the current one ident = READ_APPCONFIG_TEXT(MP_CURRENT_IDENTITY); } } if ( !ident.empty() ) { ShowIdentityDialog(ident, this); } } break; case WXMENU_FILE_IDENT_DELETE: { String ident; wxArrayString identities = Profile::GetAllIdentities(); if ( identities.IsEmpty() ) { wxLogError(_("There are no existing identities to delete.")); } else { int rc = MDialog_GetSelection ( _("Which identity would you like to delete?"), MDIALOG_YESNOTITLE, identities, this ); if ( rc != -1 ) { ident = identities[(size_t)rc]; } //else: cancelled } if ( !ident.empty() ) { Profile *profile = mApplication->GetProfile(); if ( ident == READ_APPCONFIG(MP_CURRENT_IDENTITY) ) { // can't keep this one profile->writeEntry(MP_CURRENT_IDENTITY, wxEmptyString); } // FIXME: will this really work? if there are objects which // use this identity the section will be recreated... String identSection; identSection << Profile::GetIdentityPath() << '/' << ident; profile->DeleteGroup(identSection); // update the identity combo in the toolbar if any wxWindow *win = GetToolBar()->FindWindow(IDC_IDENT_COMBO); if ( win ) { wxChoice *combo = wxDynamicCast(win, wxChoice); combo->Delete(combo->FindString(ident)); } wxLogStatus(this, _("Identity '%s' deleted."), ident.c_str()); } } break; case WXMENU_LANG_SET_DEFAULT: { static const wxFontEncoding encodingsSupported[] = { wxFONTENCODING_ISO8859_1, // West European (Latin1) wxFONTENCODING_ISO8859_2, // Central and East European (Latin2) wxFONTENCODING_ISO8859_3, // Esperanto (Latin3) wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4) wxFONTENCODING_ISO8859_5, // Cyrillic wxFONTENCODING_ISO8859_6, // Arabic wxFONTENCODING_ISO8859_7, // Greek wxFONTENCODING_ISO8859_8, // Hebrew wxFONTENCODING_ISO8859_9, // Turkish (Latin5) wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6) wxFONTENCODING_ISO8859_11, // Thai wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it // here anyhow to make all ISO8859 // consecutive numbers wxFONTENCODING_ISO8859_13, // Baltic (Latin7) wxFONTENCODING_ISO8859_14, // Latin8 wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro) wxFONTENCODING_CP1250, // WinLatin2 wxFONTENCODING_CP1251, // WinCyrillic wxFONTENCODING_CP1252, // WinLatin1 wxFONTENCODING_CP1253, // WinGreek (8859-7) wxFONTENCODING_CP1254, // WinTurkish wxFONTENCODING_CP1255, // WinHebrew wxFONTENCODING_CP1256, // WinArabic wxFONTENCODING_CP1257, // WinBaltic (almost the same as Latin 7) wxFONTENCODING_KOI8, // == KOI8-R wxFONTENCODING_UTF7, // == UTF-7 wxFONTENCODING_UTF8, // == UTF-8 }; wxArrayString encDescs; encDescs.Add(_("Default 7 bit (US ASCII)")); for ( size_t n = 0; n < WXSIZEOF(encodingsSupported); n++ ) { encDescs.Add( wxFontMapper::GetEncodingDescription( encodingsSupported[n] ) ); } int choice = MDialog_GetSelection ( _("Please choose the default encoding:\n" "it will be used by default in both\n" "message viewer and composer."), _("Choose default encoding"), encDescs, this ); wxFontEncoding enc; if ( choice == -1 ) { // cancelled, do nothing break; } else if ( choice == 0 ) { enc = wxFONTENCODING_DEFAULT; } else { enc = encodingsSupported[choice - 1]; } // remember the encoding as default mApplication->GetProfile()->writeEntry(MP_MSGVIEW_DEFAULT_ENCODING, enc); } break; case WXMENU_VIEW_TOOLBAR: if ( GetMenuBar()->IsChecked(id) ) { DoCreateToolBar(); } else // hide the toolbar { delete GetToolBar(); SetToolBar(NULL); } break; case WXMENU_VIEW_STATUSBAR: if ( GetMenuBar()->IsChecked(id) ) { DoCreateStatusBar(); } else // hide the status bar { delete GetStatusBar(); SetStatusBar(NULL); } break; case WXMENU_VIEW_FULLSCREEN: ShowFullScreen(GetMenuBar()->IsChecked(id)); break; } }
void frControlPanel::BuildContent(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) { wxLongLong t1 = wxGetUTCTimeMillis(); Freeze(); //(*Initialize(frControlPanel) wxFlexGridSizer* FlexGridSizer1; Create(parent, wxID_ANY, _("Control panel"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxSTATIC_BORDER, _T("wxID_ANY")); SetMinSize(wxSize(1000,600)); FlexGridSizer1 = new wxFlexGridSizer(2, 1, 0, 0); FlexGridSizer1->AddGrowableCol(0); FlexGridSizer1->AddGrowableRow(0); pcSPIS = new wxNotebook(this, ID_NOTEBOOK1, wxDefaultPosition, wxSize(900,500), wxNO_FULL_REPAINT_ON_RESIZE, _T("ID_NOTEBOOK1")); m_Customer = new pnlCustomer(pcSPIS, ID_PANEL2, wxDefaultPosition, wxSize(621,263), wxTAB_TRAVERSAL, _T("ID_PANEL2")); m_top = new pnlTop(pcSPIS, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); m_TxPLL = new pnlTxPLL(pcSPIS, ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL4")); m_RxPLL = new pnlRxPLL(pcSPIS, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL5")); m_TxLPF = new pnlTxLPF(pcSPIS, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL6")); m_TxRF = new pnlTxRF(pcSPIS, ID_PANEL7, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL7")); m_RxLPF = new pnlRxLPF(pcSPIS, ID_PANEL8, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL8")); m_RxVGA2 = new pnlRxVGA2(pcSPIS, ID_PANEL9, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL9")); m_RxFE = new pnlRxFE(pcSPIS, ID_PANEL10, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL10")); m_ADDC = new pnlADDC(pcSPIS, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL11")); m_Board = new pnlSi5351C(pcSPIS, ID_PANEL13, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL13")); m_ADF = new pnlADF(pcSPIS, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); pcSPIS->AddPage(m_Customer, _("System"), false); pcSPIS->AddPage(m_top, _("Top"), false); pcSPIS->AddPage(m_TxPLL, _("Tx PLL + DSM"), false); pcSPIS->AddPage(m_RxPLL, _("Rx PLL + DSM"), false); pcSPIS->AddPage(m_TxLPF, _("Tx LPF"), false); pcSPIS->AddPage(m_TxRF, _("Tx RF"), false); pcSPIS->AddPage(m_RxLPF, _("Rx LPF"), false); pcSPIS->AddPage(m_RxVGA2, _("Rx VGA2"), false); pcSPIS->AddPage(m_RxFE, _("Rx FE"), false); pcSPIS->AddPage(m_ADDC, _("ADC / DAC"), false); pcSPIS->AddPage(m_Board, _("Clock Gen"), false); pcSPIS->AddPage(m_ADF, _("ADF4002"), false); FlexGridSizer1->Add(pcSPIS, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); lbMsgs = new wxRichTextCtrl(this, ID_RICHTEXTCTRL1, _("Text"), wxDefaultPosition, wxDefaultSize, wxRE_MULTILINE, wxDefaultValidator, _T("ID_RICHTEXTCTRL1")); wxRichTextAttr rchtxtAttr_1; lbMsgs->SetMinSize(wxSize(-1,100)); FlexGridSizer1->Add(lbMsgs, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(FlexGridSizer1); MenuBar1 = new wxMenuBar(); Menu1 = new wxMenu(); mnuNew = new wxMenuItem(Menu1, ID_MENUITEM1, _("New project"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuNew); mnuOpen = new wxMenuItem(Menu1, ID_MENUITEM2, _("Open project"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuOpen); mnuSave = new wxMenuItem(Menu1, ID_MENUITEM3, _("Save"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuSave); mnuSaveAs = new wxMenuItem(Menu1, ID_MENUITEM4, _("Save as"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuSaveAs); Menu1->AppendSeparator(); mnuReadRVF_rfif = new wxMenuItem(Menu1, ID_MENUITEM9, _("Save to HEX"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuReadRVF_rfif); Menu1->AppendSeparator(); mnuChipToGUI = new wxMenuItem(Menu1, ID_MENUITEM10, _("Chip --> GUI"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnuChipToGUI); MenuBar1->Append(Menu1, _("File")); Menu2 = new wxMenu(); mnuAutoDwnld = new wxMenuItem(Menu2, ID_MENUITEM5, _("Auto Download"), wxEmptyString, wxITEM_CHECK); Menu2->Append(mnuAutoDwnld); mnuAutoDwnld->Check(true); mnuRefClk = new wxMenuItem(Menu2, ID_MENUITEM6, _("Reference Clock"), wxEmptyString, wxITEM_NORMAL); Menu2->Append(mnuRefClk); CommunicationSettings1 = new wxMenuItem(Menu2, ID_MENUITEM7, _("Communication Settings"), wxEmptyString, wxITEM_NORMAL); Menu2->Append(CommunicationSettings1); MenuBar1->Append(Menu2, _("Options")); Menu3 = new wxMenu(); RegisterTest1 = new wxMenuItem(Menu3, ID_MENUITEM8, _("Registers test"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(RegisterTest1); MenuBar1->Append(Menu3, _("Tools")); Menu4 = new wxMenu(); mnuAbout = new wxMenuItem(Menu4, ID_MENUITEM11, _("About..."), wxEmptyString, wxITEM_NORMAL); Menu4->Append(mnuAbout); MenuBar1->Append(Menu4, _("Help")); SetMenuBar(MenuBar1); ToolBar1 = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_HORZ_TEXT|wxNO_BORDER, _T("ID_TOOLBAR1")); ToolBarItem1 = ToolBar1->AddTool(ID_TOOLBARITEM1, _("New"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_NEW")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString); ToolBarItem2 = ToolBar1->AddTool(ID_TOOLBARITEM2, _("Open"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_OPEN")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString); ToolBarItem3 = ToolBar1->AddTool(ID_TOOLBARITEM3, _("Save"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_SAVE")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString); ToolBar1->AddSeparator(); tbtnDownload = ToolBar1->AddTool(ID_TOOLBARITEM4, _("Send configuration"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, _("Send all configuration"), wxEmptyString); ToolBar1->Realize(); SetToolBar(ToolBar1); dlgOpen = new wxFileDialog(this, _("Select file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_DEFAULT_STYLE, wxDefaultPosition, wxDefaultSize, _T("wxFileDialog")); sbMain = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1")); int __wxStatusBarWidths_1[3] = { 10, -10, -10 }; int __wxStatusBarStyles_1[3] = { wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL }; sbMain->SetFieldsCount(3,__wxStatusBarWidths_1); sbMain->SetStatusStyles(3,__wxStatusBarStyles_1); SetStatusBar(sbMain); static const char *Image1_XPM[] = { "22 22 3 1", ". c #FF0000", "X c #0000FF", "_ c None", "______________________", "______________________", "______......._________", "_______.......________", "_______..___..._______", "_______..____.._______", "_______..____.._______", "_______..____.._______", "_______..____.._______", "_______..___..._______", "_______.......________", "______......._________", "_________XXX__________", "_________XXX__________", "_________XXX__________", "_________XXX__________", "_______XXXXXXX________", "________XXXXX_________", "_________XXX__________", "__________X___________", "______________________", "______________________" }; Image1 = new wxImage(Image1_XPM); Image1_BMP = new wxBitmap(Image1_XPM); FlexGridSizer1->Fit(this); FlexGridSizer1->SetSizeHints(this); Connect(ID_MENUITEM1,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuNewSelected); Connect(ID_MENUITEM2,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuOpenSelected); Connect(ID_MENUITEM3,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveSelected); Connect(ID_MENUITEM4,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveAsSelected); Connect(ID_MENUITEM9,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuReadRVF_rfifSelected); Connect(ID_MENUITEM10,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuChipToGUISelected); Connect(ID_MENUITEM5,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuAutoDwnldSelected1); Connect(ID_MENUITEM6,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuRefClkSelected1); Connect(ID_MENUITEM7,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnCommunicationSettings1Selected1); Connect(ID_MENUITEM8,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnRegisterTest1Selected); Connect(ID_MENUITEM11,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&frControlPanel::OnmnuAboutSelected); Connect(ID_TOOLBARITEM1,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuNewSelected); Connect(ID_TOOLBARITEM2,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuOpenSelected); Connect(ID_TOOLBARITEM3,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OnmnuSaveSelected); Connect(ID_TOOLBARITEM4,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&frControlPanel::OntbtnDownloadClicked); Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&frControlPanel::OnClose); //*) //Set image for download all tool button ToolBar1->SetToolNormalBitmap(ID_TOOLBARITEM4, wxBitmap(*Image1)); SetTitle("ctr_6002dr2 - ZIPPER EDITION"); t1 = wxGetUTCTimeMillis(); // Clear Messages lbMsgs->Clear(); m_top->Initialize(); m_RxLPF->Initialize(m_ADDC); m_TxLPF->Initialize(NULL); m_TxRF->Initialize(); m_RxVGA2->Initialize(); m_RxFE->Initialize(); m_TxPLL->Initialize(); m_RxPLL->Initialize(); m_ADDC->Initialize(); m_Customer->Initialize(); t1 = wxGetUTCTimeMillis(); // m_frmBoard->Initialize(); // Project by default Thaw(); setCurrentFileName("untitled.prj"); #ifndef CUSTOMER_MODE //double Freq = ReadRefClkFromReg(); //ShowReferenceClk(Freq); #endif #ifdef CUSTOMER_MODE if (FileExists(ChangeFileExt(Application->ExeName, ".prj"))) { if (!FileIsNotEmpty(ChangeFileExt(Application->ExeName, ".prj"))) { ShowMessage("Configuration file is corrupt.\n\n\ Contact Lime Microsystems\n\ Unit 57 Surrey Tech Centre Occam Road\n\ The Surrey Research Park Guildford Surrey\n\ GU2 7YG\n\n\ Tel: +44 (0)1483 684801, +44(0)142 8653335\n\ Fax: +44(0) 1428656662\n\n\ [email protected]"); Application->Terminate(); }; setCurrentFileName(ChangeFileExt(Application->ExeName, ".prj")); LoadConfiguration(m_sFileName); tbtnDownload->Click(); }
rc_ide2Frame::rc_ide2Frame(wxWindow* parent,wxWindowID id) { rc_initKeywords(); wxFont rc_font(12,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL); rc_path = wxStandardPaths::Get().GetExecutablePath(); rc_path = rc_path.substr(0, rc_path.find_last_of(_("\\"))) +_("\\"); //(*Initialize(rc_ide2Frame) wxMenuItem* MenuItem2; wxMenuItem* MenuItem1; wxMenu* Menu1; wxBoxSizer* BoxSizer1; wxMenuBar* MenuBar1; wxMenu* Menu2; Create(parent, id, _("RC Basic"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id")); SetClientSize(wxSize(640,480)); SetMinSize(wxSize(640,480)); SetExtraStyle( GetExtraStyle() | wxFRAME_EX_METAL ); { wxIcon FrameIcon; FrameIcon.CopyFromBitmap(wxBitmap(wxImage(_T("img\\rcbasic.ico")))); SetIcon(FrameIcon); } BoxSizer1 = new wxBoxSizer(wxHORIZONTAL); AuiNotebook1 = new wxAuiNotebook(this, ID_AUINOTEBOOK1, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE); BoxSizer1->Add(AuiNotebook1, 1, wxALL|wxEXPAND, 1); SetSizer(BoxSizer1); MenuBar1 = new wxMenuBar(); Menu1 = new wxMenu(); MenuItem6 = new wxMenuItem(Menu1, newID, _("New"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(MenuItem6); MenuItem5 = new wxMenuItem(Menu1, openID, _("Open"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(MenuItem5); MenuItem4 = new wxMenuItem(Menu1, saveID, _("Save"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(MenuItem4); MenuItem3 = new wxMenuItem(Menu1, saveAsID, _("Save As"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(MenuItem3); MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL); Menu1->Append(MenuItem1); MenuBar1->Append(Menu1, _("&File")); Menu3 = new wxMenu(); MenuItem7 = new wxMenuItem(Menu3, undoID, _("Undo"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem7); MenuItem8 = new wxMenuItem(Menu3, redoID, _("Redo"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem8); Menu3->AppendSeparator(); MenuItem9 = new wxMenuItem(Menu3, cutID, _("Cut"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem9); MenuItem10 = new wxMenuItem(Menu3, copyID, _("Copy"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem10); MenuItem11 = new wxMenuItem(Menu3, pasteID, _("Paste"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem11); MenuItem12 = new wxMenuItem(Menu3, deleteID, _("Delete"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(MenuItem12); MenuBar1->Append(Menu3, _("Edit")); Menu4 = new wxMenu(); MenuItem13 = new wxMenuItem(Menu4, compileID, _("Compile"), wxEmptyString, wxITEM_NORMAL); Menu4->Append(MenuItem13); MenuItem14 = new wxMenuItem(Menu4, runID, _("Run"), wxEmptyString, wxITEM_NORMAL); Menu4->Append(MenuItem14); MenuBar1->Append(Menu4, _("Build")); Menu2 = new wxMenu(); MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL); Menu2->Append(MenuItem2); MenuItem15 = new wxMenuItem(Menu2, referenceID, _("Reference"), wxEmptyString, wxITEM_NORMAL); Menu2->Append(MenuItem15); MenuBar1->Append(Menu2, _("Help")); SetMenuBar(MenuBar1); StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1")); int __wxStatusBarWidths_1[1] = { -1 }; int __wxStatusBarStyles_1[1] = { wxSB_NORMAL }; StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1); StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1); SetStatusBar(StatusBar1); ToolBar1 = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER, _T("ID_TOOLBAR1")); ToolBarItem1 = ToolBar1->AddTool(toolNewID, _("New File"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_NEW")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, _("New File")); ToolBarItem2 = ToolBar1->AddTool(toolOpenID, _("Open File"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_OPEN")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, _("Open File")); ToolBarItem3 = ToolBar1->AddTool(toolSaveID, _("Save File"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_SAVE")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString); ToolBarItem4 = ToolBar1->AddTool(toolSaveAsID, _("Save File As"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_SAVE_AS")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, _("Save File As")); ToolBar1->AddSeparator(); ToolBarItem5 = ToolBar1->AddTool(toolRunID, _("Run Program"), wxBitmap(wxImage(_T("img\\player_play.png"))), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, _("Run Program")); ToolBarItem6 = ToolBar1->AddTool(toolStopID, _("Stop Program"), wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_ERROR")),wxART_TOOLBAR), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, _("Stops Program")); ToolBar1->Realize(); SetToolBar(ToolBar1); SetSizer(BoxSizer1); Layout(); Center(); Connect(newID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnNewPage); Connect(openID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnPageOpen); Connect(saveID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::onSavePage); Connect(saveAsID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnSavePageAs); Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnQuit); Connect(undoID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnUndo); Connect(redoID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnRedo); Connect(cutID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnCut); Connect(copyID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnCopy); Connect(pasteID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnPaste); Connect(deleteID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnDelete); Connect(compileID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnCompile); Connect(runID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnRun); Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnAbout); Connect(referenceID,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&rc_ide2Frame::OnReference); Connect(toolNewID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::OnNewPage); Connect(toolOpenID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::OnPageOpen); Connect(toolSaveID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::onSavePage); Connect(toolSaveAsID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::OnSavePageAs); Connect(toolRunID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::OnRun); Connect(toolStopID,wxEVT_COMMAND_TOOL_CLICKED,(wxObjectEventFunction)&rc_ide2Frame::OnStop); //*) }
void WinEDA_ModuleEditFrame::ReCreateHToolbar(void) /***************************************************/ { // Cecreate the toolbar if ( m_HToolBar != NULL ) return; m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); SetToolBar(m_HToolBar); // Set up toolbar m_HToolBar->AddTool(ID_LIBEDIT_SELECT_CURRENT_LIB, wxEmptyString, BITMAP(open_library_xpm), _("Select working library")); m_HToolBar->AddTool(ID_MODEDIT_SAVE_LIBMODULE, wxEmptyString, BITMAP(save_library_xpm), _("Save Module in working library")); m_HToolBar->AddTool(ID_LIBEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, wxEmptyString, BITMAP(new_library_xpm), _("Create new library and save current module")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBEDIT_DELETE_PART, wxEmptyString, BITMAP(delete_xpm), _("Delete part in current library")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_NEW_MODULE, wxEmptyString, BITMAP(new_footprint_xpm), _("New Module")); m_HToolBar->AddTool(ID_MODEDIT_LOAD_MODULE, wxEmptyString, BITMAP(module_xpm), _("Load module from lib")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_LOAD_MODULE_FROM_BOARD, wxEmptyString, BITMAP(load_module_board_xpm), _("Load module from current BOARD")); m_HToolBar->AddTool(ID_MODEDIT_SAVE_MODULE_IN_BOARD, wxEmptyString, BITMAP(repl_module_board_xpm), _("Replace module in current BOARD")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBEDIT_IMPORT_PART, wxEmptyString, BITMAP(import_module_xpm), _("import module")); m_HToolBar->AddTool(ID_LIBEDIT_EXPORT_PART, wxEmptyString, BITMAP(export_module_xpm), _("export module")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_EDIT_MODULE_PROPERTIES, wxEmptyString, BITMAP(module_options_xpm), _("Module Properties")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_GEN_PRINT, wxEmptyString, BITMAP(print_button), _("Print Module")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP(zoom_in_xpm), _("zoom + (F1)")); m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, wxEmptyString,BITMAP(zoom_out_xpm), _("zoom - (F2)")); m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, wxEmptyString,BITMAP(repaint_xpm), _("redraw (F3)")); m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, wxEmptyString,BITMAP(zoom_optimal_xpm), _("auto zoom")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_UNDO, wxEmptyString, BITMAP(undo_xpm), _("Undo last edition")); m_HToolBar->AddTool(ID_MODEDIT_REDO, wxEmptyString, BITMAP(redo_xpm), _("Redo the last undo command")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_PAD_SETTINGS, wxEmptyString, BITMAP(options_pad_xpm), _("Pad Settings")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_MODEDIT_CHECK, wxEmptyString, BITMAP(module_check_xpm), _("Module Check")); // after adding the buttons to the toolbar, must call Realize() to reflect // the changes m_HToolBar->Realize(); SetToolbars(); }
void wxMaximaFrame::SetupToolBar() { wxToolBar* frame_1_toolbar = CreateToolBar(); frame_1_toolbar->AddTool(tb_new, _("New"), wxArtProvider::GetBitmap(wxT("gtk-new"), wxART_TOOLBAR), _("New document")); frame_1_toolbar->AddTool(tb_open, _("Open"), wxArtProvider::GetBitmap(wxT("gtk-open"), wxART_TOOLBAR), _("Open document")); frame_1_toolbar->AddTool(tb_save, _("Save"), wxArtProvider::GetBitmap(wxT("gtk-save"), wxART_TOOLBAR), _("Save document")); frame_1_toolbar->AddSeparator(); #if WXM_PRINT frame_1_toolbar->AddTool(tb_print, _("Print"), wxArtProvider::GetBitmap(wxT("gtk-print"), wxART_TOOLBAR), _("Print document")); #endif frame_1_toolbar->AddTool(tb_pref, _("Options"), wxArtProvider::GetBitmap(wxT("gtk-preferences"), wxART_TOOLBAR), _("Configure wxMaxima")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_cut, _("Cut"), wxArtProvider::GetBitmap(wxT("gtk-cut"), wxART_TOOLBAR), _("Cut selection")); frame_1_toolbar->AddTool(tb_copy, _("Copy"), wxArtProvider::GetBitmap(wxT("gtk-copy"), wxART_TOOLBAR), _("Copy selection")); frame_1_toolbar->AddTool(tb_paste, _("Paste"), wxArtProvider::GetBitmap(wxT("gtk-paste"), wxART_TOOLBAR), _("Paste from clipboard")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_find, _("Find..."), wxArtProvider::GetBitmap(wxT("gtk-find"), wxART_TOOLBAR), _("Find and replace")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_interrupt, _("Interrupt"), wxArtProvider::GetBitmap(wxT("gtk-stop"), wxART_TOOLBAR), _("Interrupt current computation")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_animation_start, _("Animation"), wxArtProvider::GetBitmap(wxT("media-playback-start"), wxART_TOOLBAR)); frame_1_toolbar->AddTool(tb_animation_stop, _("Stop animation"), wxArtProvider::GetBitmap(wxT("media-playback-stop"), wxART_TOOLBAR)); m_plotSlider = new wxSlider(frame_1_toolbar, plot_slider_id, 0, 0, 10, wxDefaultPosition, wxSize(200, -1), wxSL_HORIZONTAL | !wxSL_AUTOTICKS); frame_1_toolbar->AddControl(m_plotSlider); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_help, _("Help"), wxArtProvider::GetBitmap(wxT("gtk-help"), wxART_TOOLBAR), _("Show Maxima help")); frame_1_toolbar->Realize(); SetToolBar(frame_1_toolbar); }
void wxMaximaFrame::SetupToolBar() { wxToolBar* frame_1_toolbar = CreateToolBar(); frame_1_toolbar->SetToolBitmapSize(wxSize(22, 22)); #if defined __WXMSW__ frame_1_toolbar->AddTool(tb_new, _("New"), IMAGE("new.png"), _("New document")); #endif frame_1_toolbar->AddTool(tb_open, _("Open"), IMAGE("open.png"), _("Open document")); frame_1_toolbar->AddTool(tb_save, _("Save"), IMAGE("save.png"), _("Save document")); frame_1_toolbar->AddSeparator(); #if WXM_PRINT frame_1_toolbar->AddTool(tb_print, _("Print"), IMAGE("print.png"), _("Print document")); #endif frame_1_toolbar->AddTool(tb_pref, _("Options"), IMAGE("configure.png"), _("Configure wxMaxima")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_cut, _("Cut"), IMAGE("cut.png"), _("Cut selection")); frame_1_toolbar->AddTool(tb_copy, _("Copy"), IMAGE("copy.png"), _("Copy selection")); frame_1_toolbar->AddTool(tb_paste, _("Paste"), IMAGE("paste.png"), _("Paste from clipboard")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_find, _("Find"), IMAGE("find.png"), _("Find and replace")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_interrupt, _("Interrupt"), IMAGE("stop.png"), _("Interrupt current computation")); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_animation_start, _("Start animation"), IMAGE("playback-start.png"), _("Start animation")); frame_1_toolbar->AddTool(tb_animation_stop, _("Stop animation"), IMAGE("playback-stop.png"), _("Stop animation")); m_plotSlider = new wxSlider(frame_1_toolbar, plot_slider_id, 0, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | !wxSL_AUTOTICKS); frame_1_toolbar->AddControl(m_plotSlider); frame_1_toolbar->AddSeparator(); frame_1_toolbar->AddTool(tb_help, _("Help"), IMAGE("help.png"), _("Show Maxima help")); frame_1_toolbar->Realize(); SetToolBar(frame_1_toolbar); }
void WinEDA_PcbFrame::ReCreateHToolbar(void) /******************************************/ // Create the main horizontal toolbar { int ii; if ( m_HToolBar != NULL ) { // simple mise a jour de la liste des fichiers anciens wxMenuItem * item; for ( ii = 9; ii >=0 ; ii-- ) { if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) ) { item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii); if ( item ) delete item; } } for ( ii = 0; ii < 10; ii++ ) { if ( GetLastProject(ii).IsEmpty() ) break; m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) ); } SetToolbars(); return; } m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); m_HToolBar->SetRows(1); SetToolBar(m_HToolBar); // Set up toolbar m_HToolBar->AddTool(ID_NEW_BOARD, wxEmptyString, BITMAP(new_xpm), _("New Board")); m_HToolBar->AddTool(ID_LOAD_FILE, wxEmptyString, BITMAP(open_xpm), _("Open existing Board")); m_HToolBar->AddTool(ID_SAVE_BOARD, wxEmptyString, BITMAP(save_xpm), _("Save Board")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_SHEET_SET, wxEmptyString, BITMAP(sheetset_xpm), _("page settings (size, texts)") ); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_OPEN_MODULE_EDITOR, wxEmptyString, BITMAP(modedit_xpm), _("Open Module Editor")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(wxID_CUT, wxEmptyString, BITMAP(cut_button), _("Cut selected item")); #if 0 m_HToolBar->AddTool(wxID_COPY, wxEmptyString, BITMAP(copy_button), _("Copy selected item")); m_HToolBar->AddTool(wxID_PASTE, wxEmptyString, BITMAP(paste_xpm), _("Paste")); #endif m_HToolBar->AddTool(ID_UNDO_BUTT, wxEmptyString, BITMAP(undelete_xpm), _("Undelete")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_GEN_PRINT, wxEmptyString, BITMAP(print_button), _("Print Board")); m_HToolBar->AddTool(ID_GEN_PLOT, wxEmptyString, BITMAP(plot_xpm), _("Plot (Hplg, Postscript, or Gerber format)")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP(zoom_in_xpm), _("zoom + (F1)")); m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, wxEmptyString, BITMAP(zoom_out_xpm), _("zoom - (F2)")); m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP(repaint_xpm), _("redraw (F3)")); m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP(zoom_optimal_xpm), _("auto zoom")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_FIND_ITEMS, wxEmptyString, BITMAP(find_xpm), _("Find components and texts")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_GET_NETLIST, wxEmptyString, BITMAP(netlist_xpm), _("Read Netlist")); m_HToolBar->AddTool(ID_DRC_CONTROL, wxEmptyString, BITMAP(erc_xpm), _("Pcb Design Rules Check")); m_HToolBar->AddSeparator(); ReCreateLayerBox(m_HToolBar); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOPLACE, wxEmptyString, BITMAP(mode_module_xpm), _("Mode Module: Manual and Automatic Move or Place for modules"), wxITEM_CHECK ); m_HToolBar->AddTool(ID_TOOLBARH_PCB_AUTOROUTE, wxEmptyString, BITMAP(mode_track_xpm), _("Mode Track and Autorouting"), wxITEM_CHECK); // after adding the buttons to the toolbar, must call Realize() to reflect // the changes m_HToolBar->Realize(); SetToolbars(); }
void MainFrame::InitializeMenus(){ //initialize main menu wxMenuBar* menuBar = new wxMenuBar(); wxMenu* fileMenu = new wxMenu(); fileMenu->Append(wxID_NEW, wxT("New Race Event\tCtrl+N"), wxT("Create a new Race Event")); fileMenu->Append(wxID_OPEN, wxT("Open Race Event\tCtrl+O"), wxT("Open an existing Race Event")); fileMenu->Append(ID_IMPORT_DATALOG, wxT("Import Datalog\tCtrl-I"),wxT("Import Datalog")); fileMenu->AppendSeparator(); fileMenu->Append(ID_NEW_CONFIG, wxT("New Configuration\tCtrl+N"), wxT("Create a new Race Capture Configuration")); fileMenu->Append(ID_OPEN_CONFIG, wxT("Open Configuration\tCtrl+O"), wxT("Open a saved Race Capture Configuration")); fileMenu->Append(ID_SAVE_CONFIG, wxT("Save Configuration\tCtrl+S"), wxT("Save the current Race Capture Configuration")); fileMenu->Append(ID_SAVE_CONFIG_AS, wxT("Save Configuration As\tCtrl+Shift+S"), wxT("Save the current Race Capture Configuration under a new file")); fileMenu->AppendSeparator(); fileMenu->Append(wxID_EXIT, wxT("Exit"), wxT("Exit the program")); menuBar->Append(fileMenu, wxT("File")); wxMenu* toolsMenu = new wxMenu(); toolsMenu->Append(ID_OPTIONS, wxT("Configurator Options")); menuBar->Append(toolsMenu, "Tools"); wxMenu* viewMenu = new wxMenu(); viewMenu->Append(ID_CONFIG_MODE, "Configuration\tF2"); viewMenu->Append(ID_ANALYSIS_MODE, "Analysis\tF3"); viewMenu->Append(ID_RUNTIME_MODE, "Sensor Monitor\tF4"); viewMenu->Append(ID_VIEW_LOGVIEWER, "Log Viewer\tF5"); viewMenu->AppendSeparator(); viewMenu->Append(ID_RESTORE_DEFAULT_VIEWS, "Restore Default View"); menuBar->Append(viewMenu, "View"); wxMenu *chartsMenu = new wxMenu(); chartsMenu->Append(ID_ADD_LINE_CHART,wxT("Line Chart")); chartsMenu->Append(ID_ADD_ANALOG_GAUGE, wxT("Analog Gauge")); chartsMenu->Append(ID_ADD_DIGITAL_GAUGE, wxT("Digital Gauge")); chartsMenu->Append(ID_ADD_GPS_VIEW, wxT("GPS View")); menuBar->Append(chartsMenu, "Charts"); wxMenu* helpMenu = new wxMenu(); helpMenu->Append(ID_HELP_OPERATION_GUIDE, wxT("Operation Guide")); helpMenu->Append(ID_HELP_INSTALL_GUIDE, wxT("Installation Guide")); helpMenu->Append(ID_HELP_DOWNLOADS, wxT("Software and Firmware Downloads")); helpMenu->AppendSeparator(); helpMenu->Append(ID_HELP_ABOUT, wxT("About Race Analyzer")); menuBar->Append(helpMenu, wxT("Help")); SetMenuBar(menuBar); //initialize tool bar wxToolBar* toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_FLAT | wxTB_NODIVIDER); wxBitmap bmpNew(page_lightning_xpm); wxBitmap bmpOpen(folder_database_xpm); wxBitmap bmpGetConfig(getconfig_xpm); wxBitmap bmpWriteConfig(writeconfig_xpm); wxBitmap bmpCommitFlash(commitflash_xpm); wxBitmap bmpChart(line_chart_xpm); wxBitmap bmpRuntime(runtime_7_xpm); wxBitmap bmpImport(import_xpm); toolBar->AddTool(wxID_NEW, "", bmpNew, "Create new Race Event"); toolBar->AddTool(wxID_OPEN, "", bmpOpen, "Open a Race Event"); toolBar->AddTool(ID_IMPORT_DATALOG, "", go_bottom_xpm, "ImportDatalog"); toolBar->AddSeparator(); toolBar->AddTool(ID_CONFIG_MODE, "", wrench_xpm, "Configuration Mode"); toolBar->AddTool(ID_ANALYSIS_MODE, "", analysis_runtime2_xpm, "Analysis Mode"); toolBar->AddSeparator(); toolBar->AddTool(ID_RUNTIME_MODE, "", inspect_xpm, "Sensor Monitor"); toolBar->AddSeparator(); toolBar->Realize(); SetToolBar(toolBar); }
FrameEditor::FrameEditor(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) { // begin wxGlade: FrameEditor::FrameEditor swEditor = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); pnEditorMapTree = new wxPanel(swEditor, wxID_ANY); frmEditorMenubar = new wxMenuBar(); wxMenu* MenuProject = new wxMenu(); MenuProject->Append(wxID_NEW, _("&New..."), _("Create a new project"), wxITEM_NORMAL); MenuProject->Append(wxID_OPEN, _("&Open..."), _("Open an existing project"), wxITEM_NORMAL); MenuProject->Append(wxID_CLOSE, _("&Close"), _("Close the current project"), wxITEM_NORMAL); MenuProject->AppendSeparator(); MenuProject->Append(wxID_ANY, _("&Make game disk..."), _("Compress game data and create a distributable file"), wxITEM_NORMAL); MenuProject->AppendSeparator(); MenuProject->Append(wxID_EXIT, _("&Exit"), _("Exit EasyRPG"), wxITEM_NORMAL); frmEditorMenubar->Append(MenuProject, _("&Project")); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(wxID_SAVE, _("&Save"), _("Save all changes in the project maps"), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxID_REVERT, _("&Revert"), _("Discard all changes and reload the saved project maps"), wxITEM_NORMAL); wxglade_tmp_menu_1->AppendSeparator(); wxMenu* MenuEdit = new wxMenu(); MenuEdit->Append(wxID_ANY, _("&Lower layer"), _("Switch to the lower layer map editing mode"), wxITEM_RADIO); MenuEdit->Append(wxID_ANY, _("&Upper layer"), _("Switch to the upper layer map editing mode"), wxITEM_RADIO); MenuEdit->Append(wxID_ANY, _("&Events"), _("Switch to the event layer map editing mode"), wxITEM_RADIO); wxglade_tmp_menu_1->Append(wxID_ANY, _("&Edit"), MenuEdit, wxEmptyString); wxMenu* MenuScale = new wxMenu(); MenuScale->Append(wxID_ZOOM_100, _("1:&1"), _("Display the map in 1:1 scale"), wxITEM_RADIO); MenuScale->Append(wxID_ANY, _("1:&2"), _("Display the map in 1:2 scale"), wxITEM_RADIO); MenuScale->Append(wxID_ANY, _("1:&4"), _("Display the map in 1:4 scale"), wxITEM_RADIO); MenuScale->Append(wxID_ANY, _("1:&8"), _("Display the map in 1:8 scale"), wxITEM_RADIO); wxglade_tmp_menu_1->Append(wxID_ANY, _("&Scale"), MenuScale, wxEmptyString); frmEditorMenubar->Append(wxglade_tmp_menu_1, _("&Map")); wxMenu* MenuTools = new wxMenu(); MenuTools->Append(wxID_ANY, _("&Database"), _("Open the project database editor window"), wxITEM_NORMAL); MenuTools->Append(wxID_ANY, _("&Material manager"), _("Add or remove material from the project"), wxITEM_NORMAL); MenuTools->Append(wxID_ANY, _("Music &player"), _("Play background music while editing"), wxITEM_NORMAL); frmEditorMenubar->Append(MenuTools, _("&Tools")); wxMenu* MenuGame = new wxMenu(); MenuGame->Append(wxID_ANY, _("&Play test"), _("Launch the game project for testing"), wxITEM_NORMAL); MenuGame->AppendSeparator(); MenuGame->Append(wxID_ANY, _("&Full screen"), _("Enable or disable full screen in play test"), wxITEM_CHECK); MenuGame->Append(wxID_ANY, _("&Show title"), _("Enable or disable background and music in the title in play test"), wxITEM_CHECK); frmEditorMenubar->Append(MenuGame, _("&Game")); wxMenu* MenuHelp = new wxMenu(); MenuHelp->Append(wxID_HELP, _("&Index"), _("Display the help index and contents of EasyRPG"), wxITEM_NORMAL); MenuHelp->AppendSeparator(); MenuHelp->Append(wxID_ABOUT, _("&About"), _("About EasyRPG Editor"), wxITEM_NORMAL); frmEditorMenubar->Append(MenuHelp, _("&Help")); SetMenuBar(frmEditorMenubar); frmEditorStatusbar = CreateStatusBar(1); frmEditorToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_FLAT); SetToolBar(frmEditorToolbar); frmEditorToolbar->AddTool(wxID_NEW, _("New"), wxBitmap(wxT("../share/toolbar/new.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("New project"), _("Create a new project")); frmEditorToolbar->AddTool(wxID_OPEN, _("Open"), wxBitmap(wxT("../share/toolbar/open.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open project"), _("Open an existing project")); frmEditorToolbar->AddTool(wxID_CLOSE, _("Close"), wxBitmap(wxT("../share/toolbar/close.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Close project"), _("Close the current project")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Make game disk"), wxBitmap(wxT("../share/toolbar/makegamedisk.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Make game disk "), _("Make a redistributable package from the current project")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_SAVE, _("Save"), wxBitmap(wxT("../share/toolbar/save.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Save map changes"), _("Save all changes in the project maps")); frmEditorToolbar->AddTool(wxID_REVERT, _("Revert"), wxBitmap(wxT("../share/toolbar/revert.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Revert map changes"), _("Discard all changes and reload the saved project maps")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Lower layer"), wxBitmap(wxT("../share/toolbar/lowerlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Lower layer editing"), _("Switch to the lower layer map editing mode")); frmEditorToolbar->AddTool(wxID_ANY, _("Upper layer"), wxBitmap(wxT("../share/toolbar/upperlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Upper layer editing"), _("Switch to the upper layer map editing mode")); frmEditorToolbar->AddTool(wxID_ANY, _("Events"), wxBitmap(wxT("../share/toolbar/eventlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Event layer editing"), _("Switch to the event layer map editing mode")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ZOOM_100, _("1:1"), wxBitmap(wxT("../share/toolbar/11scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:1 scale"), _("Display the map in 1:1 scale")); frmEditorToolbar->AddTool(wxID_ANY, _("1:2"), wxBitmap(wxT("../share/toolbar/12scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:2 scale"), _("Display the map in 1:2 scale")); frmEditorToolbar->AddTool(wxID_ANY, _("1:4"), wxBitmap(wxT("../share/toolbar/14scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:4 scale"), _("Display the map in 1:4 scale")); frmEditorToolbar->AddTool(wxID_ANY, _("1:8"), wxBitmap(wxT("../share/toolbar/18scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:8 scale"), _("Display the map in 1:8 scale")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Database"), wxBitmap(wxT("../share/toolbar/database.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Database editor"), _("Open the project database editor window")); frmEditorToolbar->AddTool(wxID_ANY, _("Material"), wxBitmap(wxT("../share/toolbar/material.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Material manager"), _("Add or remove material from the project")); frmEditorToolbar->AddTool(wxID_ANY, _("Music"), wxBitmap(wxT("../share/toolbar/music.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Music player"), _("Play background music while editing")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Play test"), wxBitmap(wxT("../share/toolbar/playtest.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Play test"), _("Launch the game project for testing")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Full screen"), wxBitmap(wxT("../share/toolbar/fullscreen.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_CHECK, _("Full screen"), _("Enable or disable full screen in play test")); frmEditorToolbar->AddTool(wxID_ANY, _("Title"), wxBitmap(wxT("../share/toolbar/title.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_CHECK, _("Show title"), _("Enable or disable background and music in the title in play test")); frmEditorToolbar->AddSeparator(); frmEditorToolbar->AddTool(wxID_ANY, _("Help"), wxBitmap(wxT("../share/toolbar/help.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Help contents"), _("Display the help index and contents of EasyRPG")); frmEditorToolbar->Realize(); pnEditorTileset = new wxScrolledWindow(swEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); tcMapTree = new wxTreeCtrl(pnEditorMapTree, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN|wxTR_DEFAULT_STYLE|wxTR_HAS_BUTTONS|wxTR_NO_LINES); pnEditorMap = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); set_properties(); do_layout(); // end wxGlade }
// ---------------------------------------------------------------------------- // main frame // ---------------------------------------------------------------------------- // frame constructor MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(NULL, -1, title, pos, size, style) { // set the frame icon SetIcon(wxICON(mondrian)); #if wxUSE_MENUS // create a menu bars wxMenu *fileMenu = new wxMenu; wxMenu *helpMenu = new wxMenu; wxMenu *image_processMenu = new wxMenu; wxMenu *filterMenu = new wxMenu; wxMenu *NonLinMenu = new wxMenu; // the "About" item should be in the help menu fileMenu->Append(MENU_FILE_OPEN, _T("&Open...\tCtrl-O"), _T("Open a new Image")); fileMenu->Append(MENU_FILE_QUIT, _T("E&xit\tAlt-X"), _T("Quit this program")); // Creates Help Menu helpMenu->Append(MENU_HELP_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); // Add linear filters to menu filterMenu->Append(MENU_FILTER_LP, _T("&Lowpass Filter\tAlt-L"), _T("Lowpass Filter")); filterMenu->Append(MENU_FILTER_HP, _T("&Highpass Filter\tAlt-H"), _T("Highpass Filter")); // Lab 2 // Add Non-Linear Filters NonLinMenu->Append(MENU_FILTER_NONLINEAR_MEDIAN, _T("&Median Filter\tAlt-M"), _T("Median Filter")); NonLinMenu->Append(MENU_FILTER_NONLINEAR_MINIMUM, _T("&Minimum Filter\tAlt-K"), _T("Minimum Filter")); NonLinMenu->Append(MENU_FILTER_NONLINEAR_MAXIMUM, _T("&Maximum Filter\tAlt-J"), _T("Maximum Filter")); //Add Filter submenus to Image Processing Menu image_processMenu->Append(MENU_FILTER,_T("&Linear Filters"),filterMenu, _T("Filter Menu")); // Add Non-Linear Filter Menu to Filter Menu image_processMenu->Append(MENU_FILTER,_T("&Non-Linear Filters"),NonLinMenu, _T("Non-Linear Filters")); // Lab 3 image_processMenu->Append(MENU_FILTER_EDGE, _T("&Edge Detection\tAlt-E"), _T("Edge Detection")); // Lab 3/4 image_processMenu->Append(MENU_FILTER_BINARIZE,_T("Binarize\tAlt-B"),_T("Binarize")); // Lab 5 image_processMenu->Append(ID_AreaCalculation, _T("&Area Calculation\tAlt-A"),_T("Apply Area Calculation")); // Lab 5 Area pointNumber = 99; areaborder = new wxPoint[pointNumber]; areaindex=0; bAreaCalculation = FALSE; bleftDown = FALSE; dist = 9999; // Text Detection image_processMenu->Append(MENU_FILTER_TEXTDETECTION, _T("&Text Detection\tAlt-T"),_T("Text Detection")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); menuBar->Append(image_processMenu, _T("&Image Process")); menuBar->Append(helpMenu, _T("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #endif // wxUSE_MENUS #if wxUSE_TOOLBAR wxToolBar *MyToolBar = new wxToolBar(this, wxID_ANY); MyToolBar->AddTool(MENU_FILTER_LP,lp_xpm, _T("Low Pass Filter")); MyToolBar->AddTool(MENU_FILTER_HP,hp_xpm, _T("High Pass Filter")); // Lab 2 Place Holders MyToolBar->AddTool(MENU_FILTER_NONLINEAR_MEDIAN,median_xpm, _T("Median Filter")); MyToolBar->AddTool(MENU_FILTER_NONLINEAR_MINIMUM,min_xpm, _T("Minimum Filter")); MyToolBar->AddTool(MENU_FILTER_NONLINEAR_MAXIMUM,max_xpm, _T("Maximum Filter")); // Lab 3 Place Holders MyToolBar->AddTool(MENU_FILTER_EDGE,edge_xpm, _T("Edge Detector")); MyToolBar->AddTool(MENU_FILTER_BINARIZE,binary_xpm, _T("Binarize")); // Lab 5 Place Holders MyToolBar->AddTool(ID_AreaCalculation,area_xpm,_T("Apply Area Calculation")); MyToolBar->AddTool(MENU_FILTER_UNDO,undo_xpm,_T("Undo")); // Text Detection MyToolBar->AddTool(MENU_FILTER_TEXTDETECTION,text_xpm,_T("Text Detection")); MyToolBar->Realize(); SetToolBar(MyToolBar); #endif #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText(_T("Welcome to BME 465!")); #endif // wxUSE_STATUSBAR pImage = NULL; // Lab 4 set the slider stuff to be empty sliderFrame = NULL; slider = NULL; }
MyFrame::MyFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) { // begin wxGlade: MyFrame::MyFrame panel_1 = new wxPanel(this, wxID_ANY); splitter = new wxSplitterWindow(panel_1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); notebook_1 = new wxNotebook(splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM); panel_environment = new wxPanel(notebook_1, wxID_ANY); panel_explorer = new wxPanel(notebook_1, wxID_ANY); window_1 = new wxSplitterWindow(panel_explorer, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER|wxSP_BORDER); window_1_pane_2 = new wxPanel(window_1, wxID_ANY); window_1_pane_1 = new wxPanel(window_1, wxID_ANY); panel_log = new wxPanel(notebook_1, wxID_ANY); panel_cpvr = new wxPanel(panel_1, wxID_ANY); menubar = new wxMenuBar(); wxMenu* fileMenu = new wxMenu(); fileMenu->Append(mnuNewID, _("&New ebuild\tCtrl-n"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(mnuLoadOverlayID, _("L&oad ebuild from PORTDIR_OVERLAY"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(mnuLoadID, _("&Load ebuild from PORTDIR"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(mnuSaveID, _("&Save ebuild\tCtrl-S"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(mnuDelID, _("&Delete this ebuild"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(mnuExportID, _("&Export ebuild and aux files to tar"), wxEmptyString, wxITEM_NORMAL); fileMenu->Append(exitID, _("E&xit\tAlt-X"), wxEmptyString, wxITEM_NORMAL); menubar->Append(fileMenu, _("&File")); wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(mnuFindID, _("&Find\tCtrl-F"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_1->Append(mnuFindAgainID, _("Find a&gain\tCtrl-g"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_1, _("&Edit")); wxMenu* wxglade_tmp_menu_2 = new wxMenu(); wxglade_tmp_menu_2->Append(mnuAddFuncID, _("&Function\tF6"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_2->Append(mnuLicenseID, _("&License"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_2, _("&Insert")); wxMenu* wxglade_tmp_menu_3 = new wxMenu(); wxglade_tmp_menu_3->Append(mnuCleanID, _("&Clean\tShift-F1"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuDigestID, _("&Digest\tF1"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuUnpackID, _("&Unpack\tF2"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuCompileID, _("C&ompile\tF3"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuInstallID, _("&Install\tF4"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuQmergeID, _("&Qmerge\tF5"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuEbuildID, _("&ebuild <this ebuild> command\tF9"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuEmergeID, _("e&merge this ebuild\tF10"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuRepoScanID, _("&Repoman scan"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuPatchID, _("Create patch from source in ${S}"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuImportID, _("&Import existing patch"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuDiffID, _("diff of this ebuild against PORTDIR version"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuRepoFullID, _("repoman full"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuFileCopyID, _("${FILESDIR} copy/diff/edit/del\tF8"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuXtermSID, _("xterm in ${S}\tF12"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuXtermDID, _("xterm in ${D}"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_3->Append(mnuXtermCVSID, _("xterm in CVS dir\tShift-F12"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_3, _("&Tools")); wxMenu* wxglade_tmp_menu_4 = new wxMenu(); wxglade_tmp_menu_4->Append(self.mnuFullCommitID, _("repoman cvs commit"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_4, _("&CVS")); wxMenu* wxglade_tmp_menu_5 = new wxMenu(); wxglade_tmp_menu_5->Append(mnuEditID, _("&ebuild in external editor\tF7"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_5->Append(mnuViewMetadataID, _("metadata.&xml"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_5->Append(mnuViewChangeLogID, _("Change&Log"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_5, _("&View")); wxMenu* menu_options = new wxMenu(); menu_options->Append(mnuClearLogID, _("&Clear log window\tF11"), wxEmptyString, wxITEM_NORMAL); menubar->Append(menu_options, _("Lo&g")); wxMenu* wxglade_tmp_menu_6 = new wxMenu(); wxglade_tmp_menu_6->Append(mnuPrefID, _("&Preferences"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_6, _("&Options")); wxMenu* wxglade_tmp_menu_7 = new wxMenu(); wxglade_tmp_menu_7->Append(mnuHelpID, _("&Contents"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuHelpRefID, _("Ebuild &Quick Reference"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuEclassID, _("&eclasses"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuPrivID, _("&Portage private functions"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuUseID, _("USE variables"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnulocalUseID, _("&local USE variables"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuFKEYS_ID, _("List &Fkeys"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuCVS_ID, _("Gentoo repoman &CVS help"), wxEmptyString, wxITEM_NORMAL); wxglade_tmp_menu_7->Append(mnuAboutID, _("&About Abeni"), wxEmptyString, wxITEM_NORMAL); menubar->Append(wxglade_tmp_menu_7, _("&Help")); SetMenuBar(menubar); statusbar = CreateStatusBar(2, 0); toolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_FLAT); SetToolBar(toolbar); toolbar->AddTool(newID, _("new"), wxBitmap("/usr/share/pixmaps/abeni/new.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("New ebuild"), wxEmptyString); toolbar->AddTool(openID, _("open"), wxBitmap("/usr/share/pixmaps/abeni/open.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open ebuild in PORTDIR"), wxEmptyString); toolbar->AddTool(openOvlID, _("openOvl"), wxBitmap("/usr/share/pixmaps/abeni/open_ovl.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open ebuild in PORTDIR_OVERLAY"), wxEmptyString); toolbar->AddTool(saveID, _("save"), wxBitmap("/usr/share/pixmaps/abeni/save.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Save ebuild Ctrl-S"), wxEmptyString); toolbar->AddTool(editID, _("edit"), wxBitmap("/usr/share/pixmaps/abeni/edit.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Edit ebuild in external editor F7"), wxEmptyString); toolbar->AddSeparator(); toolbar->AddTool(newFuncID, _("newFunc"), wxBitmap("/usr/share/pixmaps/abeni/fx.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("New Function F6"), wxEmptyString); toolbar->AddTool(toolCleanID, _("clean"), wxBitmap("/usr/share/pixmaps/abeni/clean.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Clean Shift-F1"), wxEmptyString); toolbar->AddTool(digestID, _("digest"), wxBitmap("/usr/share/pixmaps/abeni/digest.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Digest F1"), wxEmptyString); toolbar->AddTool(unpackID, _("unpack"), wxBitmap("/usr/share/pixmaps/abeni/unpack.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Unpack F2"), wxEmptyString); toolbar->AddTool(compileID, _("compile"), wxBitmap("/usr/share/pixmaps/abeni/compile.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Compile F3"), wxEmptyString); toolbar->AddTool(installID, _("install"), wxBitmap("/usr/share/pixmaps/abeni/install.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Install F4"), wxEmptyString); toolbar->AddTool(qmergeID, _("qmerge"), wxBitmap("/usr/share/pixmaps/abeni/qmerge.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Qmerge F5"), wxEmptyString); toolbar->AddTool(ebuildID, _("ebuild"), wxBitmap("/usr/share/pixmaps/abeni/ebuild.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("ebuild <this ebuild> command F9"), wxEmptyString); toolbar->AddTool(emergeID, _("emerge"), wxBitmap("/usr/share/pixmaps/abeni/emerge.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("emerge <options><this ebuild> F10"), wxEmptyString); toolbar->AddTool(xtermID, _("xterm"), wxBitmap("/usr/share/pixmaps/abeni/xterm.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Launch xterm in $S F12"), wxEmptyString); toolbar->AddSeparator(); toolbar->AddTool(self.StopID, _("stop"), wxBitmap("/usr/share/pixmaps/abeni/stop.png", wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Interrupt process running in log window"), wxEmptyString); toolbar->Realize(); static_line_2 = new wxStaticLine(this, wxID_ANY); button_Category = new wxButton(panel_cpvr, wxID_ANY, _("Category")); text_ctrl_Category = new wxTextCtrl(panel_cpvr, wxID_ANY, wxEmptyString); label_PN = new wxStaticText(panel_cpvr, wxID_ANY, _("$PN")); text_ctrl_PN = new wxTextCtrl(panel_cpvr, wxID_ANY, wxEmptyString); label_PVR = new wxStaticText(panel_cpvr, wxID_ANY, _("$PVR")); text_ctrl_PVR = new wxTextCtrl(panel_cpvr, wxID_ANY, wxEmptyString); button_1 = new wxToggleButton(panel_cpvr, wxID_ANY, _("noauto")); static_line_3 = new wxStaticLine(panel_1, wxID_ANY); STCeditor = new GentooSTC(splitter, wxID_ANY); text_ctrl_log = new wxTextCtrl(panel_log, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); tree_ctrl_1 = new wxTreeCtrl(window_1_pane_1, treeID, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER); explorer = new wx.GenericDirCtrl(window_1_pane_2, wxID_ANY, filter="All files|*"); button_view = new wxButton(window_1_pane_2, wxID_ANY, _("View")); button_edit = new wxButton(window_1_pane_2, wxID_ANY, _("Edit")); button_patch = new wxButton(window_1_pane_2, wxID_ANY, _("Create patch")); button_delete = new wxButton(window_1_pane_2, wxID_ANY, _("Delete")); text_ctrl_environment = new wxTextCtrl(panel_environment, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY); button_env_refresh = new wxButton(panel_environment, wxID_ANY, _("Refresh")); const wxString radio_box_env_choices[] = { _("Brief"), _("Full") }; radio_box_env = new wxRadioBox(panel_environment, wxID_ANY, _("View"), wxDefaultPosition, wxDefaultSize, 2, radio_box_env_choices, 1, wxRA_SPECIFY_ROWS); set_properties(); do_layout(); // end wxGlade }
/// 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(); }
void wxFrame::AttachMenuBar(wxMenuBar *menubar) { #if defined(__SMARTPHONE__) && defined(__WXWINCE__) wxMenu *autoMenu = NULL; if( menubar->GetMenuCount() == 1 ) { autoMenu = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(menubar->GetMenu(0)); SetRightMenu(wxID_ANY, menubar->GetMenuLabel(0), autoMenu); } else { autoMenu = new wxMenu; for( size_t n = 0; n < menubar->GetMenuCount(); n++ ) { wxMenu *item = menubar->GetMenu(n); wxString label = menubar->GetMenuLabel(n); wxMenu *new_item = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(item); autoMenu->Append(wxID_ANY, label, new_item); } SetRightMenu(wxID_ANY, _("Menu"), autoMenu); } #elif defined(WINCE_WITHOUT_COMMANDBAR) if (!GetToolBar()) { wxToolMenuBar* toolBar = new wxToolMenuBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxTB_HORIZONTAL, wxToolBarNameStr, menubar); SetToolBar(toolBar); menubar->SetToolBar(toolBar); } // When the main window is created using CW_USEDEFAULT the height of the // menubar is not taken into account, so we resize it afterwards if a // menubar is present HWND hwndMenuBar = SHFindMenuBar(GetHwnd()); if ( hwndMenuBar ) { RECT mbRect; ::GetWindowRect(hwndMenuBar, &mbRect); const int menuHeight = mbRect.bottom - mbRect.top; RECT rc; ::GetWindowRect(GetHwnd(), &rc); // adjust for menu / titlebar height rc.bottom -= (2*menuHeight-1); ::MoveWindow(Gethwnd(), rc.left, rc.top, rc.right, rc.bottom, FALSE); } #endif wxFrameBase::AttachMenuBar(menubar); if ( !menubar ) { // actually remove the menu from the frame m_hMenu = (WXHMENU)0; InternalSetMenuBar(); } else // set new non NULL menu bar { #if !defined(__WXWINCE__) || defined(WINCE_WITH_COMMANDBAR) // Can set a menubar several times. if ( menubar->GetHMenu() ) { m_hMenu = menubar->GetHMenu(); } else // no HMENU yet { m_hMenu = menubar->Create(); if ( !m_hMenu ) { wxFAIL_MSG( wxT("failed to create menu bar") ); return; } } #endif InternalSetMenuBar(); } }
// Constructor main_frame::main_frame( wxWindow* parent ) { // On MAC OS X, this makes the frame as brushed metal interface (like iTunes). // Looking around iTunes, the main window is brushed metal, other dialogs (like Prefs) // aren't metal, so that is what we will do also for our application. // This is a wxWidgets "Extra Style" so needs to get set via the function // wxWindow::SetExtraStyle*before* the frame is created. The creation will happen // in the next line via the wxXmlResource::Get()->LoadFrame SetExtraStyle( wxDIALOG_EX_METAL ); // Load up this frame from XRC. [Note, instead of making a class's // constructor take a wxWindow* parent with a default value of NULL, // we could have just had designed MyFrame class with an empty // constructor and then written here: // wxXmlResource::Get()->LoadFrame(this, (wxWindow* )NULL, "main_frame"); // since this frame will always be the top window, and thus parentless. // However, the current approach has source code that can be recycled // in case code to moves to having an invisible frame as the top level window. wxXmlResource::Get()->LoadFrame( this, parent, wxT( "main_frame" ) ); //----Add the frame icon------------------------------------------------------------ // Set an iconbundle for the frame (this should be in XmlResources eventually // once that capacity becomes available). wxIconBundle a_icon_bundle; a_icon_bundle.AddIcon( get_plucker_directory( RESOURCES ) << wxT( "/icons_application" ) << wxT( "/" ) << wxT( "application_32x32.xpm" ), wxBITMAP_TYPE_XPM ); a_icon_bundle.AddIcon( get_plucker_directory( RESOURCES ) << wxT( "/icons_application" ) << wxT( "/" ) << wxT( "application_16x16.xpm" ), wxBITMAP_TYPE_XPM ); a_icon_bundle.AddIcon( get_plucker_directory( RESOURCES ) << wxT( "/icons_application" ) << wxT( "/" ) << wxT( "application_48x48.xpm" ), wxBITMAP_TYPE_XPM ); a_icon_bundle.AddIcon( get_plucker_directory( RESOURCES ) << wxT( "/icons_application" ) << wxT( "/" ) << wxT( "application_64x64.xpm" ), wxBITMAP_TYPE_XPM ); SetIcons( a_icon_bundle ); //----Add the menu------------------------------------------------------------------ SetMenuBar( wxXmlResource::Get()->LoadMenuBar( wxT( "main_menubar" ) ) ); //----Menu: branding modifications-------------------------------------------------- // This should really be a runtime variable expansion in the XRC file, but // the feature isn't there yet, so do it via normal code. // Set the title SetTitle( plkrAPPLICATION_DESKTOP_NAME ); // Set the text of the about menu entry (this obviously needs to be done only after // the menu was added above.) wxString about_menu_label_string ; // As a side note, the accelerator on the About will be stripped on a Mac. about_menu_label_string << _( "&About" ) << wxT( " " ) << plkrAPPLICATION_DESKTOP_NAME; GetMenuBar()->SetLabel( wxID_ABOUT, about_menu_label_string ); //----Add the toolbar--------------------------------------------------------------- // If the user has specified that they want a toolbar (the 1L means default is 1)... if ( the_configuration->Read( wxT( "/PLUCKER_DESKTOP/main_frame_toolbar_enabled" ), 1L ) ) { // Calculate the name of the toolbar in the xrc. User can specify an extension // to the toolbar set and it will load that one, with some different icons (or styles). wxString toolbar_full_xrc_string = wxT( "main_toolbar" ); wxString theme; // We will set the default based on the user's color settings. If they are on // a high color system, the default is "high". Otherwise will stay "", just to // load the regular resource with no extension to the name "main_toolbar". // Default starts with "" for everyone... wxString default_theme; if ( 16 <= ::wxDisplayDepth() ) { // ...then default theme is "high", default_theme = wxT( "high" ); } // Load theme from configrution file, using our generated default, if no key. theme = the_configuration->Read( wxT( "/PLUCKER_DESKTOP/theme" ), default_theme ); // If key isn't "", then add a '_' and the theme onto the end of full xrc string. if ( theme != wxT( "" ) ) { toolbar_full_xrc_string << wxT( "_" ) << theme; } // Now load a toolbar by that name from the xrc. SetToolBar( wxXmlResource::Get()->LoadToolBar( this, toolbar_full_xrc_string ) ); wxLogDebug( wxT( "Loading toolbar called " ) + toolbar_full_xrc_string ); // Write and flush the results of our detection so that have them for // preferences dialog and for next execution. the_configuration->Write( wxT( "/PLUCKER_DESKTOP/theme" ), theme ); the_configuration->Flush(); } //----Insert a main_listctrl to its "unknown" placeholder in the XRC file---------- // Construct an instance of the main_listctrl custom class m_main_listctrl = new main_listctrl( this, ID_MAIN_LISTCTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); wxXmlResource::Get()->AttachUnknownControl( wxT( "main_frame_main_listctrl" ), m_main_listctrl ); //----Add the statusbar------------------------------------------------------------- // If the user has specified that they want a statusar (the IL means default is 1)... if ( the_configuration->Read( wxT( "/PLUCKER_DESKTOP/main_frame_statusbar_enabled" ), 1L ) ) { // Add a statusbar with one field [will automatically put a "gripsizer" // indicator on the lower right corner if the OS usually does that with // resizable frames]. CreateStatusBar( 1 ); } //----Load the saved position and size of the frame-------------------------------- // ..and now set the size, position of the frame using our common function for // this frame [utils_controls.cpp] utils_controls::read_dialog_position_and_size( this, wxT( "main_frame" ), wxDefaultPosition, wxSize( 350,320 ) ); }
//============================================================================= // MainFrame //============================================================================= wxGD::MainFrame::MainFrame( Handler *handler, wxWindow *parent ) : wxFrame(parent, wxID_ANY, "wxGUIDesigner", wxDefaultPosition, wxSize(630,480), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL), m_handler (handler), m_panel (NULL), m_mgr (NULL) { //============================================================================= // Icon bundle //============================================================================= wxBitmap bmpLogo = wxXmlResource::Get()->LoadBitmap("logo"); if( bmpLogo.IsOk() ) { wxImage imgLogo = bmpLogo.ConvertToImage(); wxIcon ico16, ico32; wxIconBundle bundle; ico16.CopyFromBitmap( imgLogo.Scale(16,16) ); bundle.AddIcon(ico16); ico32.CopyFromBitmap( imgLogo.Scale(32,32) ); bundle.AddIcon(ico32); SetIcons(bundle); } //============================================================================= // Bars //============================================================================= wxMenuBar *menuBar = wxXmlResource::Get()->LoadMenuBar("MainMenu"); SetMenuBar(menuBar); if(menuBar) { wxMenu *menuFile = menuBar->GetMenu(0); if(menuFile) m_history.UseMenu(menuFile); } SetToolBar( wxXmlResource::Get()->LoadToolBar(this, "ToolBar") ); CreateStatusBar(1); SetMinSize( wxSize(630,480) ); //============================================================================= // AUI //============================================================================= m_panel = new wxPanel(this, wxID_ANY); m_mgr = new wxAuiManager(m_panel, wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_LIVE_RESIZE | wxAUI_MGR_HINT_FADE | wxAUI_MGR_VENETIAN_BLINDS_HINT ); m_mgr->SetArtProvider( new AUI::DockArt() ); #ifdef __WXDEBUG__ wxWindow *dbgWnd = (wxWindow *)m_handler->GetDebugWindow(m_panel); m_mgr->AddPane( dbgWnd, wxAuiPaneInfo().Bottom(). Name("DebugWindowPane").Caption(_("Logger") ). CloseButton(false).MinSize(-1,120).FloatingSize(300,120). LeftDockable(false).RightDockable(false) ); #endif wxWindow *palette = (wxWindow *)m_handler->GetPaletteBook(m_panel); wxWindow *treeView = (wxWindow *)m_handler->GetTreeView(m_panel); wxWindow *editor = (wxWindow *)m_handler->GetEditorBook(m_panel); wxWindow *propBook = (wxWindow *)m_handler->GetPropertyBook(m_panel); m_mgr->AddPane( palette, wxAuiPaneInfo().Top(). Name("ToolPalettePane").Caption(_("Controls") ). CloseButton(false).MinSize(-1,69).FloatingSize(300,69). LeftDockable(false).RightDockable(false).DockFixed(true). PaneBorder(false) ); m_mgr->AddPane( treeView, wxAuiPaneInfo().Left(). Name("TreeViewPane").Caption(_("Project") ). MaximizeButton(true).CloseButton(false). MinSize(180,-1).FloatingSize(150,300). TopDockable(false).BottomDockable(false) ); m_mgr->AddPane( editor, wxAuiPaneInfo().Center(). Name("EditorBookPane").Caption(_("Editor") ). MaximizeButton(true).CloseButton(false).DockFixed(true) ); m_mgr->AddPane( propBook, wxAuiPaneInfo().Right(). Name("BookPane").Caption(_("Properties") ). MaximizeButton(true).CloseButton(false). MinSize(180,-1).FloatingSize(150,300). TopDockable(false).BottomDockable(false) ); LoadLayout(); m_mgr->Update(); //============================================================================= // Events //============================================================================= Bind( wxEVT_CLOSE_WINDOW, &MainFrame::OnClose, this ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAbout, this, XRCID("wxID_ABOUT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnPreferences, this, XRCID("wxID_PREFERENCES") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnExit, this, XRCID("wxID_EXIT") ); //============================================================================= // Project //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnNewProject, this, XRCID("wxID_NEW") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnOpenProject, this, XRCID("wxID_OPEN") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnOpenRecent, this, XRCID("wxID_FILE1"), XRCID("wxID_FILE9") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnSaveAsProject, this, XRCID("wxID_SAVEAS") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnSaveProject, this, XRCID("wxID_SAVE") ); //============================================================================= // Undo/Redo //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnUndo, this, XRCID("wxID_UNDO") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnRedo, this, XRCID("wxID_REDO") ); //============================================================================= // Clipboard //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnCut, this, XRCID("wxID_CUT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnCopy, this, XRCID("wxID_COPY") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnPaste, this, XRCID("wxID_PASTE") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnDelete, this, XRCID("wxID_DELETE") ); //============================================================================= // CodeGenerator //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnGenerateCode, this, XRCID("wxID_EXECUTE") ); //============================================================================= // Widget's alignment //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignLeft, this, XRCID("ID_ALIGN_LEFT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignCenterH, this, XRCID("ID_ALIGN_CENTER_H") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignRight, this, XRCID("ID_ALIGN_RIGHT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignTop, this, XRCID("ID_ALIGN_TOP") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignCenterV, this, XRCID("ID_ALIGN_CENTER_V") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnAlignBottom, this, XRCID("ID_ALIGN_BOTTOM") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnExpand, this, XRCID("ID_EXPAND") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnStretch, this, XRCID("ID_STRETCH") ); //============================================================================= // Widget's borders //============================================================================= Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnBorderLeft, this, XRCID("ID_BORDER_LEFT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnBorderRight, this, XRCID("ID_BORDER_RIGHT") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnBorderTop, this, XRCID("ID_BORDER_TOP") ); Bind( wxEVT_COMMAND_TOOL_CLICKED, &MainFrame::OnBorderBottom, this, XRCID("ID_BORDER_BOTTOM") ); }
MainFrame::MainFrame(wxWindow* parent,wxWindowID id) : my::employer(L"MainFrame_employer", false) , Cartographer(0) , Anchor_(NoAnchor) , WiFi_data_(NULL) , WiFi_relative_mode_(true) , WiFi_min_power_(-100) , WiFi_max_power_(10) , WiFi_min_power_abs_(-100) , WiFi_max_power_abs_(10) , MY_MUTEX_DEF(WiFi_mutex_,true) , big_font_(0) , small_font_(0) , gps_tracker_id_(0) , green_mark_id_(0) , red_mark_id_(0) , yellow_mark_id_(0) , pg_conn_(NULL) , MY_MUTEX_DEF(pg_mutex_,true) , Gps_test_(false) , MY_MUTEX_DEF(Gps_mutex_,true) { #undef _ #define _(s) (L##s) //(*Initialize(MainFrame) wxMenu* MenuHelp; wxMenuItem* MenuAbout; wxMenuBar* MainMenu; wxMenu* MenuFile; wxMenuItem* MenuQuit; Create(parent, wxID_ANY, _("Scan Analitics"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY")); SetClientSize(wxSize(626,293)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); FlexGridSizer1 = new wxFlexGridSizer(1, 1, 0, 0); FlexGridSizer1->AddGrowableCol(0); FlexGridSizer1->AddGrowableRow(0); Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxSize(616,331), wxTAB_TRAVERSAL, _T("ID_PANEL1")); FlexGridSizer1->Add(Panel1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(FlexGridSizer1); MainMenu = new wxMenuBar(); MenuFile = new wxMenu(); MenuSettings = new wxMenuItem(MenuFile, ID_SETTINGS, _("Настройки..."), wxEmptyString, wxITEM_NORMAL); MenuFile->Append(MenuSettings); MenuFile->AppendSeparator(); MenuQuit = new wxMenuItem(MenuFile, ID_QUIT, _("Выход\tAlt-F4"), wxEmptyString, wxITEM_NORMAL); MenuFile->Append(MenuQuit); MainMenu->Append(MenuFile, _("Файл")); MenuView = new wxMenu(); MenuMaps = new wxMenu(); MenuMapsNull = new wxMenuItem(MenuMaps, 0, _("Нет карт"), wxEmptyString, wxITEM_RADIO); MenuMaps->Append(MenuMapsNull); MenuView->Append(ID_MENUMAPS, _("Карты"), MenuMaps, wxEmptyString); MenuView->AppendSeparator(); MenuZoomIn = new wxMenuItem(MenuView, ID_ZOOMIN, _("Увеличить масштаб"), wxEmptyString, wxITEM_NORMAL); MenuView->Append(MenuZoomIn); MenuZoomOut = new wxMenuItem(MenuView, ID_ZOOMOUT, _("Уменьшить масштаб"), wxEmptyString, wxITEM_NORMAL); MenuView->Append(MenuZoomOut); MenuView->AppendSeparator(); MenuGpsTracker = new wxMenuItem(MenuView, ID_GPSTRACKER, _("Загружать данные с Gps"), wxEmptyString, wxITEM_CHECK); MenuView->Append(MenuGpsTracker); MenuGpsAnchor = new wxMenuItem(MenuView, ID_GPSANCHOR, _("Следить за Gps"), wxEmptyString, wxITEM_CHECK); MenuView->Append(MenuGpsAnchor); MenuView->AppendSeparator(); MenuWifiScan = new wxMenuItem(MenuView, ID_WIFISCAN, _("Загружать данные с WiFi-сканера"), wxEmptyString, wxITEM_CHECK); MenuView->Append(MenuWifiScan); MenuWiFiAnchor = new wxMenuItem(MenuView, ID_WIFIANCHOR, _("Следить за данными WiFi-сканера"), wxEmptyString, wxITEM_CHECK); MenuView->Append(MenuWiFiAnchor); MainMenu->Append(MenuView, _("Вид")); MenuHelp = new wxMenu(); MenuAbout = new wxMenuItem(MenuHelp, ID_ABOUT, _("О программе...\tF1"), wxEmptyString, wxITEM_NORMAL); MenuHelp->Append(MenuAbout); MainMenu->Append(MenuHelp, _("Помощь")); SetMenuBar(MainMenu); StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1")); int __wxStatusBarWidths_1[1] = { -1 }; int __wxStatusBarStyles_1[1] = { wxSB_NORMAL }; StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1); StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1); SetStatusBar(StatusBar1); FlexGridSizer1->SetSizeHints(this); Connect(ID_SETTINGS,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnSettings); Connect(ID_QUIT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnQuit); Connect(ID_ZOOMIN,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnZoomIn); Connect(ID_ZOOMOUT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnZoomOut); Connect(ID_GPSTRACKER,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnGpsTracker); Connect(ID_GPSANCHOR,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnGpsAnchor); Connect(ID_WIFISCAN,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnWiFiScan); Connect(ID_WIFIANCHOR,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnWiFiAnchor); Connect(ID_ABOUT,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&MainFrame::OnAbout); //*) setlocale(LC_NUMERIC, "C"); { wxIcon FrameIcon; FrameIcon.CopyFromBitmap(LoadBitmapFromC(images::cartographer)); SetIcon(FrameIcon); } MainToolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxNO_BORDER); MainToolBar->AddTool(ID_ZOOMIN, L"ZoomIn", LoadBitmapFromC(images::zoom_in), L"Увеличить"); MainToolBar->AddTool(ID_ZOOMOUT, L"ZoomOut", LoadBitmapFromC(images::zoom_out), L"Уменьшить"); MainToolBar->AddSeparator(); MainToolBar->AddTool(ID_GPSTRACKER, L"GpsTracker", LoadBitmapFromC(images::gps_tracker), L"Gps", wxITEM_CHECK); MainToolBar->AddTool(ID_GPSANCHOR, L"GpsAnchor", LoadBitmapFromC(images::anchor), L"Следить за Gps", wxITEM_CHECK); MainToolBar->AddSeparator(); MainToolBar->AddTool(ID_WIFISCAN, L"WiFiScan", LoadBitmapFromC(images::wifi), L"WiFi", wxITEM_CHECK); MainToolBar->AddTool(ID_WIFIANCHOR, L"WiFiAnchor", LoadBitmapFromC(images::anchor), L"Следить за WiFi", wxITEM_CHECK); MainToolBar->Realize(); SetToolBar(MainToolBar); ReloadSettings(); { int w, h; bool maximized; MyConfig->Read(L"/MainFrame/Width", &w, 400); MyConfig->Read(L"/MainFrame/Height", &h, 400); MyConfig->Read(L"/MainFrame/Maximized", &maximized, true); SetClientSize(w, h); Maximize(maximized); } Show(true); /* Создание Картографа на месте Panel1 */ { delete Panel1; std::wstring error; bool only_cache = MyConfig->ReadBool(L"/Cartographer/OnlyCache", false); if (!only_cache) { wxString str = MyConfig->Read(L"/Cartographer/ServerAddr", L""); try { Cartographer = new cartographer::Painter(this, (const wchar_t*)str.c_str()); } catch (my::exception &e) { /* Не удалось создать Картограф - возможно не получилось соединиться с сервером */ error = e.message(); only_cache = true; } } if (only_cache) { try { Cartographer = new cartographer::Painter(this, L"cache"); } catch (my::exception &e) { if (error.empty()) throw e; else throw my::exception(error); } } FlexGridSizer1->Add(Cartographer, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(FlexGridSizer1); if (!error.empty()) { wxMessageBox(L"Не удалось запустить Картограф" L" с заданными настройками. Картограф запущен" L" в режиме работы с кэшем.\n\nТекст ошибки:\n\n" + error, L"Ошибка", wxOK | wxICON_ERROR, this); } } /* Создание Картографа */ Cartographer->Bind(wxEVT_MOTION, &MainFrame::OnMapMouseMove, this, wxID_ANY); /* Создаём шрифты */ big_font_ = Cartographer->CreateFont( wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD) ); small_font_ = Cartographer->CreateFont( wxFont(8, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD) ); /* Загружаем список карт */ { MenuMaps->Delete(MenuMapsNull); cartographer::map_info active_map = Cartographer->GetActiveMapInfo(); long maps_count = Cartographer->GetMapsCount(); for(long i = 0; i < maps_count; ++i) { cartographer::map_info map = Cartographer->GetMapInfo(i); wxMenuItem *item = new wxMenuItem(MenuMaps, i, map.name + L"\t" + my::num::to_wstring(i + 1), wxEmptyString, wxITEM_RADIO); MenuMaps->Append(item); if (active_map.sid == map.sid) item->Check(); MenuMaps->Bind(wxEVT_COMMAND_MENU_SELECTED, &MainFrame::OnMapChange, this, i); } } /* Изображения */ gps_tracker_id_ = Cartographer->LoadImageFromC(images::gps_tracker); Cartographer->SetImageCentralPoint(gps_tracker_id_, 15.5, 19.0); green_mark_id_ = Cartographer->LoadImageFromC(images::green_mark); red_mark_id_ = Cartographer->LoadImageFromC(images::red_mark); yellow_mark_id_ = Cartographer->LoadImageFromC(images::yellow_mark); /* Запускаем собственную прорисовку */ Cartographer->SetPainter( boost::bind(&MainFrame::OnMapPaint, this, _1, _2)); Cartographer->SetStatusHandler( boost::bind(&MainFrame::StatusHandler, this, _1)); Cartographer->MoveTo(13, cartographer::DMSToDD( 48,28,48.77, 135,4,19.04 )); //UpdateWiFiData( macaddr(0, 0x10, 0xE7, 0xA4, 0x46, 0x9D) ); WiFiScan_worker_ = new_worker( L"WiFiScan_worker"); GpsTracker_worker_ = new_worker( L"GpsTracker_worker"); boost::thread( boost::bind( &MainFrame::CheckerProc, this, new_worker(L"Checker_worker")) ); }
void WinEDA_ViewlibFrame::ReCreateHToolbar(void) /****************************************************/ { int ii; EDA_LibComponentStruct * RootLibEntry = NULL, * CurrentLibEntry = NULL; bool asdeMorgan = FALSE, state; if ( (g_CurrentViewLibraryName != wxEmptyString) && (g_CurrentViewComponentName != wxEmptyString) ) { RootLibEntry = FindLibPart(g_CurrentViewComponentName.GetData(), g_CurrentViewLibraryName.GetData(), FIND_ROOT); if ( RootLibEntry && LookForConvertPart(RootLibEntry) > 1 ) asdeMorgan = TRUE; CurrentLibEntry = FindLibPart(g_CurrentViewComponentName.GetData(), g_CurrentViewLibraryName.GetData(), FIND_ALIAS); } if ( m_HToolBar == NULL ) { m_HToolBar = new WinEDA_Toolbar(TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE); SetToolBar(m_HToolBar); // Set up toolbar m_HToolBar->AddTool(ID_LIBVIEW_SELECT_LIB, wxEmptyString, BITMAP(library_xpm), _("Select library to browse")); m_HToolBar->AddTool(ID_LIBVIEW_SELECT_PART, wxEmptyString, BITMAP(add_component_xpm), _("Select part to browse")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBVIEW_PREVIOUS, wxEmptyString, BITMAP(lib_previous_xpm), _("Display previous part")); m_HToolBar->AddTool(ID_LIBVIEW_NEXT, wxEmptyString, BITMAP(lib_next_xpm), _("Display next part")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_ZOOM_PLUS_BUTT, wxEmptyString, BITMAP(zoom_in_xpm), _("zoom + (F1)")); m_HToolBar->AddTool(ID_ZOOM_MOINS_BUTT, wxEmptyString, BITMAP(zoom_out_xpm), _("zoom - (F2)")); m_HToolBar->AddTool(ID_ZOOM_REDRAW_BUTT, wxEmptyString, BITMAP(repaint_xpm), _("redraw (F3)")); m_HToolBar->AddTool(ID_ZOOM_PAGE_BUTT, wxEmptyString, BITMAP(zoom_optimal_xpm), _("1:1 zoom")); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, wxEmptyString, BITMAP(morgan1_xpm), _("Show as \"De Morgan\" normal part"), wxITEM_CHECK); m_HToolBar->AddTool(ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, wxEmptyString, BITMAP(morgan2_xpm), _("Show as \"De Morgan\" convert part"), wxITEM_CHECK); m_HToolBar->AddSeparator(); SelpartBox = new WinEDAChoiceBox(m_HToolBar, ID_LIBVIEW_SELECT_PART_NUMBER, wxDefaultPosition, wxSize(150,-1)); m_HToolBar->AddControl(SelpartBox); m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBVIEW_VIEWDOC, wxEmptyString, BITMAP(datasheet_xpm), _("View component documents") ); m_HToolBar->EnableTool(ID_LIBVIEW_VIEWDOC, FALSE); if ( m_IsModal ) // The lib browser is called from a "load component" command { m_HToolBar->AddSeparator(); m_HToolBar->AddTool(ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, wxEmptyString, BITMAP(export_xpm), _("Export to schematic") ); } // after adding the buttons to the toolbar, must call Realize() to reflect // the changes m_HToolBar->Realize(); } // Must be AFTER Realize(): m_HToolBar->ToggleTool(ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, (g_ViewConvert <= 1) ? TRUE : FALSE); m_HToolBar->ToggleTool(ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, (g_ViewConvert >= 2) ? TRUE : FALSE ); m_HToolBar->EnableTool(ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, asdeMorgan); m_HToolBar->EnableTool(ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, asdeMorgan); int jj = 1; if( RootLibEntry ) jj = MAX(RootLibEntry->m_UnitCount, 1); SelpartBox->Clear(); for ( ii = 0; ii < jj ; ii ++ ) { wxString msg; msg.Printf( _("Part %c"), 'A' + ii); SelpartBox->Append(msg); } SelpartBox->SetSelection(0); state = FALSE; if ( CurrentLibEntry && jj > 1 ) state = TRUE; SelpartBox->Enable(state); state = FALSE; if( CurrentLibEntry && (CurrentLibEntry->m_DocFile != wxEmptyString) ) state = TRUE; m_HToolBar->EnableTool(ID_LIBVIEW_VIEWDOC, state); }
void MainFrame::InitializeMenubar() { // creates menubar m_fileMenu = new wxMenu(); m_fileMenu->Append(wxID_ADD, wxT("Add Connection..."), wxT("Add new Redis connection")); m_fileMenu->AppendSeparator(); m_fileMenu->Append(wxID_NEW, wxT("New Key Value Pair..."), wxT("Add new key value pair")); m_fileMenu->AppendSeparator(); m_fileMenu->Append(ID_MENU_SELECT_DB, wxT("Select Database..."), wxT("Select the database index")); m_fileMenu->Append(ID_MENU_DISCONNECT, wxT("Disconnect"), wxT("Close the current connection")); m_fileMenu->AppendSeparator(); m_fileMenu->Append(wxID_EXIT, wxT("E&xit")); m_editMenu = new wxMenu(); m_editMenu->Append(wxID_EDIT, wxT("Modify Value..."), wxT("Modify selected key's value")); m_editMenu->Append(wxID_DELETE, wxT("Delete Key"), wxT("Delete the selected key")); m_editMenu->AppendSeparator(); m_editMenu->Append(ID_MENU_EXPIRE, wxT("Set Expiration"), wxT("Set expiration for selected key")); m_helpMenu = new wxMenu(); m_helpMenu->Append(wxID_ABOUT, wxT("About...")); m_menubar = new wxMenuBar(); m_menubar->Append(m_fileMenu, wxT("&File")); m_menubar->Append(m_editMenu, wxT("&Edit")); m_menubar->Append(m_helpMenu, wxT("&Help")); SetMenuBar(m_menubar); m_statusBar = new wxStatusBar(this, ID_MAIN_STATUS_BAR); SetStatusBar(m_statusBar); wxToolBar *toolbar = new wxToolBar(this, ID_MAIN_TOOL_BAR); long style = toolbar->GetWindowStyle() | wxTB_TEXT; toolbar->SetWindowStyle(style); wxBitmap bm(network_xpm); toolbar->AddTool(wxID_ADD, wxT("Add Connection"), bm); toolbar->AddSeparator(); SetToolBar(toolbar); // wire events Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAbout)); Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnQuit)); Connect(wxID_ADD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAddConnection)); Connect(ID_MENU_DISCONNECT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnCloseConnection)); Connect(wxID_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAddKeyValuePair)); Connect(wxID_EDIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnEditKeyValue)); Connect(wxID_DELETE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnDeleteKey)); Connect(ID_MENU_EXPIRE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnExpireKey)); Connect(ID_MENU_SELECT_DB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnSelectDb)); Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(MainFrame::OnClose)); Connect(wxID_NEW, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnRedisConnectedUpdateUI)); Connect(ID_MENU_SELECT_DB, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnRedisConnectedUpdateUI)); Connect(ID_MENU_DISCONNECT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnRedisConnectedUpdateUI)); Connect(wxID_DELETE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnKeySelectedUpdateUI)); Connect(wxID_EDIT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnKeySelectedUpdateUI)); Connect(ID_MENU_EXPIRE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrame::OnKeySelectedUpdateUI)); }
// 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 CAssemblyWindow::AddToolBar() { BMessage *message; // make the pop up menu for 'Select' tool BPopUpMenu *selectMenu = new BPopUpMenu("", false, false); selectMenu->SetFont(be_plain_font); message = new BMessage(SELECT_MODE_CHANGED); message->AddInt32("mev:mode", CEventEditor::RECTANGLE_SELECTION); selectMenu->AddItem(new CIconMenuItem("Rectangle", message, ResourceUtils::LoadImage("ArrowTool"))); message = new BMessage(*message); message->ReplaceInt32("mev:mode", CEventEditor::LASSO_SELECTION); selectMenu->AddItem(new CIconMenuItem("Lasso", message, ResourceUtils::LoadImage("LassoTool"))); selectMenu->SetTargetForItems(this); // make the pop up menu for 'Create' tool BPopUpMenu *createMenu = new BPopUpMenu("", false, false); createMenu->SetFont(be_plain_font); message = new BMessage(NEW_EVENT_TYPE_CHANGED); message->AddInt32("type", EvtType_Count); createMenu->AddItem(new CIconMenuItem("Default", message, ResourceUtils::LoadImage("PencilTool"))); createMenu->AddSeparatorItem(); message = new BMessage(*message); message->ReplaceInt32("type", EvtType_Tempo); createMenu->AddItem(new CIconMenuItem("Tempo", message, ResourceUtils::LoadImage("MetroTool"))); message = new BMessage(*message); message->ReplaceInt32("type", EvtType_TimeSig); createMenu->AddItem(new CIconMenuItem("Time Signature", message, ResourceUtils::LoadImage("TimeSigTool"))); message = new BMessage(*message); message->ReplaceInt32("type", EvtType_Repeat); createMenu->AddItem(new CIconMenuItem("Repeat", message, ResourceUtils::LoadImage("RepeatTool"))); message = new BMessage(*message); message->ReplaceInt32("type", EvtType_End); createMenu->AddItem(new CIconMenuItem("Part End", message, ResourceUtils::LoadImage("EndTool"))); createMenu->SetTargetForItems(this); BRect rect(Bounds()); if (KeyMenuBar()) rect.top = KeyMenuBar()->Frame().bottom + 1.0; rect.right += 1.0; // add the tool bar CToolBar *toolBar = new CToolBar(rect, "General"); CTool *tool; toolBar->AddTool(tool = new CBitmapTool("Snap To Grid", ResourceUtils::LoadImage("GridTool"), new BMessage(CEventEditor::TOOL_GRID))); tool->SetValue(B_CONTROL_ON); toolBar->AddSeparator(); toolBar->AddTool(tool = new CMenuTool("Select", ResourceUtils::LoadImage("ArrowTool"), selectMenu, new BMessage(CEventEditor::TOOL_SELECT))); tool->SetValue(B_CONTROL_ON); toolBar->AddTool(new CMenuTool("Create", ResourceUtils::LoadImage("PencilTool"), createMenu, new BMessage(CEventEditor::TOOL_CREATE))); toolBar->AddTool(tool = new CBitmapTool("Eraser", ResourceUtils::LoadImage("EraserTool"), new BMessage(CEventEditor::TOOL_ERASE))); toolBar->MakeRadioGroup("Select", "Eraser", true); SetToolBar(toolBar); }