diff --git a/common/bitmap.cpp b/common/bitmap.cpp index 1dbd25bd3d..318bacb045 100644 --- a/common/bitmap.cpp +++ b/common/bitmap.cpp @@ -220,34 +220,39 @@ bool SaveCanvasImageToFile( EDA_DRAW_FRAME* aFrame, const wxString& aFileName, } -wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, - const wxBitmap& aImage, wxItemKind aType = wxITEM_NORMAL ) +void AddBitmapToMenuItem( wxMenuItem* aMenu, const wxBitmap& aImage ) { - wxMenuItem* item; - - item = new wxMenuItem( aMenu, aId, aText, wxEmptyString, aType ); - // Retrieve the global applicaton show icon option: bool useImagesInMenus; Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); + wxItemKind menu_type = aMenu->GetKind(); + if( useImagesInMenus ) { - if( aType == wxITEM_CHECK || aType == wxITEM_RADIO ) + if( menu_type == wxITEM_CHECK || menu_type == wxITEM_RADIO ) { #if defined( __WINDOWS__ ) - item->SetBitmaps( KiBitmap( checked_ok_xpm ), aImage ); + aMenu->SetBitmaps( KiBitmap( checked_ok_xpm ), aImage ); // A workaround to a strange bug on Windows, wx Widgets 3.0: // size of bitmaps is not taken in account for wxITEM_{CHECK,RADIO} menu // unless we call SetFont - item->SetFont( *wxNORMAL_FONT ); + aMenu->SetFont( *wxNORMAL_FONT ); #endif } - else if( aType != wxITEM_RADIO ) + else if( menu_type != wxITEM_RADIO ) { - item->SetBitmap( aImage ); + aMenu->SetBitmap( aImage ); } } +} + + +wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, + const wxBitmap& aImage, wxItemKind aType = wxITEM_NORMAL ) +{ + wxMenuItem* item = new wxMenuItem( aMenu, aId, aText, wxEmptyString, aType ); + AddBitmapToMenuItem( item, aImage ); aMenu->Append( item ); @@ -259,31 +264,8 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, const wxString& aHelpText, const wxBitmap& aImage, wxItemKind aType = wxITEM_NORMAL ) { - wxMenuItem* item; - - item = new wxMenuItem( aMenu, aId, aText, aHelpText, aType ); - - // Retrieve the global applicaton show icon option: - bool useImagesInMenus; - Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); - - if( useImagesInMenus ) - { - if( aType == wxITEM_CHECK || aType == wxITEM_RADIO ) - { - #if defined( __WINDOWS__ ) - item->SetBitmaps( KiBitmap( checked_ok_xpm ), aImage ); - // A workaround to a strange bug on Windows, wx Widgets 3.0: - // size of bitmaps is not taken in account for wxITEM_{CHECK,RADIO} menu - // unless we call SetFont - item->SetFont( *wxNORMAL_FONT ); - #endif - } - else if( aType != wxITEM_RADIO ) - { - item->SetBitmap( aImage ); - } - } + wxMenuItem* item = new wxMenuItem( aMenu, aId, aText, aHelpText, aType ); + AddBitmapToMenuItem( item, aImage ); aMenu->Append( item ); @@ -294,17 +276,9 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, int aId, const wxString& aText, wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, const wxString& aText, const wxBitmap& aImage ) { - wxMenuItem* item; - - item = new wxMenuItem( aMenu, aId, aText ); + wxMenuItem* item = new wxMenuItem( aMenu, aId, aText ); item->SetSubMenu( aSubMenu ); - - // Retrieve the global applicaton show icon option: - bool useImagesInMenus; - Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); - - if( useImagesInMenus ) - item->SetBitmap( aImage ); + AddBitmapToMenuItem( item, aImage ); aMenu->Append( item ); @@ -316,17 +290,9 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, const wxString& aText, const wxString& aHelpText, const wxBitmap& aImage ) { - wxMenuItem* item; - - item = new wxMenuItem( aMenu, aId, aText, aHelpText ); + wxMenuItem* item = new wxMenuItem( aMenu, aId, aText, aHelpText ); item->SetSubMenu( aSubMenu ); - - // Retrieve the global applicaton show icon option: - bool useImagesInMenus; - Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus ); - - if( useImagesInMenus ) - item->SetBitmap( aImage ); + AddBitmapToMenuItem( item, aImage ); aMenu->Append( item ); diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 2a02663d42..3782415e5b 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -139,6 +139,9 @@ SIM_PLOT_FRAME::SIM_PLOT_FRAME( KIWAY* aKiway, wxWindow* aParent ) // Get the previous size and position of windows: LoadSettings( config() ); + // Give icons to menuitems + setIconsForMenuItems(); + m_simulator = SPICE_SIMULATOR::CreateInstance( "ngspice" ); if( !m_simulator ) @@ -258,6 +261,76 @@ void SIM_PLOT_FRAME::LoadSettings( wxConfigBase* aCfg ) } +// A small helper struct to handle bitmaps initialisation in menus +struct BM_MENU_INIT_ITEM +{ + int m_MenuId; + BITMAP_DEF m_Bitmap; +}; + + +void SIM_PLOT_FRAME::setIconsForMenuItems() +{ + // Give icons to menuitems of the main menubar + BM_MENU_INIT_ITEM bm_list[] + { + // File menu: + { wxID_NEW, simulator_xpm }, + { wxID_OPEN,directory_browser_xpm }, + { wxID_SAVE, directory_xpm}, + { ID_SAVE_AS_IMAGE, export_xpm}, + { ID_SAVE_AS_CSV, export_xpm}, + { wxID_CLOSE, exit_xpm}, + + // simulator menu: + { ID_MENU_RUN_SIM, sim_run_xpm}, + { ID_MENU_ADD_SIGNAL, sim_add_signal_xpm}, + { ID_MENU_PROBE_SIGNALS, sim_probe_xpm}, + { ID_MENU_TUNE_SIGNALS, sim_tune_xpm}, + { ID_MENU_SHOW_NETLIST, netlist_xpm}, + { ID_MENU_SET_SIMUL, sim_settings_xpm}, + + // View menu + { wxID_ZOOM_IN, zoom_in_xpm}, + { wxID_ZOOM_OUT, zoom_out_xpm}, + { wxID_ZOOM_FIT, zoom_fit_in_page_xpm}, + { ID_MENU_SHOW_GRID, grid_xpm}, + { ID_MENU_SHOW_LEGEND, text_xpm}, + + { 0, nullptr } // Sentinel + }; + + // wxMenuItems are already created and attached to the m_mainMenu wxMenuBar. + // A problem is the fact setting bitmaps in wxMenuItems after they are attached + // to a wxMenu do not work in all cases. + // So the trick is: + // Remove the wxMenuItem from its wxMenu + // Set the bitmap + // Insert the modified wxMenuItem to its previous place + for( int ii = 0; bm_list[ii].m_MenuId; ++ii ) + { + wxMenuItem* item = m_mainMenu->FindItem( bm_list[ii].m_MenuId ); + + if( !item || !bm_list[ii].m_Bitmap) + continue; + + wxMenu* menu = item->GetMenu(); + // Calculate the initial index of item inside the wxMenu parent + wxMenuItemList& mlist = menu->GetMenuItems(); + int mpos = mlist.IndexOf( item ); + + if( mpos >= 0 ) // Should be always the case + { + // Modify the bitmap + menu->Remove( item ); + AddBitmapToMenuItem( item, KiBitmap( bm_list[ii].m_Bitmap ) ); + // Insert item to its the initial index + menu->Insert( mpos, item ); + } + } +} + + void SIM_PLOT_FRAME::setSubWindowsSashSize() { if( m_splitterLeftRightSashPosition > 0 ) diff --git a/eeschema/sim/sim_plot_frame.h b/eeschema/sim/sim_plot_frame.h index e1db3e2e33..496ca27f22 100644 --- a/eeschema/sim/sim_plot_frame.h +++ b/eeschema/sim/sim_plot_frame.h @@ -165,6 +165,10 @@ private: void LoadSettings( wxConfigBase* aCfg ) override; void SaveSettings( wxConfigBase* aCfg ) override; + /** Give icons to menuitems of the main menubar + */ + void setIconsForMenuItems(); + /** * @brief Adds a new plot to the current panel. * @param aName is the device/net name. diff --git a/eeschema/sim/sim_plot_frame_base.cpp b/eeschema/sim/sim_plot_frame_base.cpp index 2340db2177..23b71a6dd3 100644 --- a/eeschema/sim/sim_plot_frame_base.cpp +++ b/eeschema/sim/sim_plot_frame_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2018) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,279 +12,281 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : KIWAY_PLAYER( parent, id, title, pos, size, style, name ) { this->SetSizeHints( wxSize( 200,200 ), wxDefaultSize ); - + m_mainMenu = new wxMenuBar( 0 ); m_fileMenu = new wxMenu(); wxMenuItem* m_newPlot; m_newPlot = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( _("New Plot") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_newPlot ); - + m_fileMenu->AppendSeparator(); - + wxMenuItem* m_openWorkbook; m_openWorkbook = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( _("Open Workbook") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_openWorkbook ); - + wxMenuItem* m_saveWorkbook; m_saveWorkbook = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( _("Save Workbook") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_saveWorkbook ); - + m_fileMenu->AppendSeparator(); - + wxMenuItem* m_saveImage; - m_saveImage = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as image") ) , wxEmptyString, wxITEM_NORMAL ); + m_saveImage = new wxMenuItem( m_fileMenu, ID_SAVE_AS_IMAGE, wxString( _("Save as image") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_saveImage ); - + wxMenuItem* m_saveCsv; - m_saveCsv = new wxMenuItem( m_fileMenu, wxID_ANY, wxString( _("Save as .csv file") ) , wxEmptyString, wxITEM_NORMAL ); + m_saveCsv = new wxMenuItem( m_fileMenu, ID_SAVE_AS_CSV, wxString( _("Save as .csv File") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_saveCsv ); - + m_fileMenu->AppendSeparator(); - + wxMenuItem* m_exitSim; m_exitSim = new wxMenuItem( m_fileMenu, wxID_CLOSE, wxString( _("Exit Simulation") ) , wxEmptyString, wxITEM_NORMAL ); m_fileMenu->Append( m_exitSim ); - - m_mainMenu->Append( m_fileMenu, _("File") ); - + + m_mainMenu->Append( m_fileMenu, _("File") ); + m_simulationMenu = new wxMenu(); - m_runSimulation = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL ); + m_runSimulation = new wxMenuItem( m_simulationMenu, ID_MENU_RUN_SIM, wxString( _("Run Simulation") ) , wxEmptyString, wxITEM_NORMAL ); m_simulationMenu->Append( m_runSimulation ); - + m_simulationMenu->AppendSeparator(); - - m_addSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Add signals...") ) , wxEmptyString, wxITEM_NORMAL ); + + m_addSignals = new wxMenuItem( m_simulationMenu, ID_MENU_ADD_SIGNAL, wxString( _("Add Signals...") ) , wxEmptyString, wxITEM_NORMAL ); m_simulationMenu->Append( m_addSignals ); - - m_probeSignals = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL ); + + m_probeSignals = new wxMenuItem( m_simulationMenu, ID_MENU_PROBE_SIGNALS, wxString( _("Probe from schematics") ) , wxEmptyString, wxITEM_NORMAL ); m_simulationMenu->Append( m_probeSignals ); - - m_tuneValue = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Tune component value") ) , wxEmptyString, wxITEM_NORMAL ); + + m_tuneValue = new wxMenuItem( m_simulationMenu, ID_MENU_TUNE_SIGNALS, wxString( _("Tune Component Value") ) , wxEmptyString, wxITEM_NORMAL ); m_simulationMenu->Append( m_tuneValue ); - - m_showNetlist = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Show SPICE Netlist...") ) , _("Shows current simulation's netlist. Useful for debugging SPICE errors."), wxITEM_NORMAL ); - m_simulationMenu->Append( m_showNetlist ); - + m_simulationMenu->AppendSeparator(); - - m_settings = new wxMenuItem( m_simulationMenu, wxID_ANY, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL ); + + m_showNetlist = new wxMenuItem( m_simulationMenu, ID_MENU_SHOW_NETLIST, wxString( _("Show SPICE Netlist...") ) , _("Shows current simulation's netlist. Useful for debugging SPICE errors."), wxITEM_NORMAL ); + m_simulationMenu->Append( m_showNetlist ); + + m_simulationMenu->AppendSeparator(); + + m_settings = new wxMenuItem( m_simulationMenu, ID_MENU_SET_SIMUL, wxString( _("Settings...") ) , wxEmptyString, wxITEM_NORMAL ); m_simulationMenu->Append( m_settings ); - - m_mainMenu->Append( m_simulationMenu, _("Simulation") ); - + + m_mainMenu->Append( m_simulationMenu, _("Simulation") ); + m_viewMenu = new wxMenu(); wxMenuItem* m_zoomIn; m_zoomIn = new wxMenuItem( m_viewMenu, wxID_ZOOM_IN, wxString( _("Zoom In") ) , wxEmptyString, wxITEM_NORMAL ); m_viewMenu->Append( m_zoomIn ); - + wxMenuItem* m_zoomOut; m_zoomOut = new wxMenuItem( m_viewMenu, wxID_ZOOM_OUT, wxString( _("Zoom Out") ) , wxEmptyString, wxITEM_NORMAL ); m_viewMenu->Append( m_zoomOut ); - + wxMenuItem* m_zoomFit; m_zoomFit = new wxMenuItem( m_viewMenu, wxID_ZOOM_FIT, wxString( _("Fit on Screen") ) , wxEmptyString, wxITEM_NORMAL ); m_viewMenu->Append( m_zoomFit ); - + m_viewMenu->AppendSeparator(); - + wxMenuItem* m_showGrid; - m_showGrid = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &grid") ) , wxEmptyString, wxITEM_CHECK ); + m_showGrid = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_GRID, wxString( _("Show &grid") ) , wxEmptyString, wxITEM_CHECK ); m_viewMenu->Append( m_showGrid ); - + wxMenuItem* m_showLegend; - m_showLegend = new wxMenuItem( m_viewMenu, wxID_ANY, wxString( _("Show &legend") ) , wxEmptyString, wxITEM_CHECK ); + m_showLegend = new wxMenuItem( m_viewMenu, ID_MENU_SHOW_LEGEND, wxString( _("Show &Legend") ) , wxEmptyString, wxITEM_CHECK ); m_viewMenu->Append( m_showLegend ); - - m_mainMenu->Append( m_viewMenu, _("View") ); - + + m_mainMenu->Append( m_viewMenu, _("View") ); + this->SetMenuBar( m_mainMenu ); - + m_sizerMain = new wxBoxSizer( wxVERTICAL ); - - m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT ); - m_toolBar->Realize(); - + + m_toolBar = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT|wxTB_HORIZONTAL|wxTB_TEXT ); + m_toolBar->Realize(); + m_sizerMain->Add( m_toolBar, 0, wxEXPAND, 5 ); - + m_splitterLeftRight = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D ); m_splitterLeftRight->SetSashGravity( 0.7 ); m_splitterLeftRight->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this ); m_splitterLeftRight->SetMinimumPaneSize( 50 ); - + m_panelLeft = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelLeft->SetMinSize( wxSize( 300,-1 ) ); - + m_sizer11 = new wxBoxSizer( wxVERTICAL ); - + m_splitterPlotAndConsole = new wxSplitterWindow( m_panelLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D ); m_splitterPlotAndConsole->SetSashGravity( 0.8 ); m_splitterPlotAndConsole->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this ); m_splitterPlotAndConsole->SetMinimumPaneSize( 50 ); - + m_plotPanel = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_plotPanel->SetMinSize( wxSize( -1,200 ) ); - + m_sizerPlot = new wxBoxSizer( wxHORIZONTAL ); - + m_plotNotebook = new wxAuiNotebook( m_plotPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_MIDDLE_CLICK_CLOSE|wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT|wxAUI_NB_TOP ); m_welcomePanel = new wxPanel( m_plotNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_sizer8 = new wxBoxSizer( wxVERTICAL ); - - + + m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 ); - + wxBoxSizer* bSizer81; bSizer81 = new wxBoxSizer( wxHORIZONTAL ); - - + + bSizer81->Add( 0, 0, 1, wxEXPAND, 5 ); - + m_staticTextInfo = new wxStaticText( m_welcomePanel, wxID_ANY, _("Start the simulation by clicking the Run Simulation button"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_staticTextInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - + bSizer81->Add( m_staticTextInfo, 0, wxALL|wxEXPAND, 5 ); - - + + bSizer81->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + m_sizer8->Add( bSizer81, 0, wxEXPAND, 5 ); - - + + m_sizer8->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + m_welcomePanel->SetSizer( m_sizer8 ); m_welcomePanel->Layout(); m_sizer8->Fit( m_welcomePanel ); m_plotNotebook->AddPage( m_welcomePanel, _("a page"), false, wxNullBitmap ); - + m_sizerPlot->Add( m_plotNotebook, 1, wxEXPAND | wxALL, 5 ); - - + + m_plotPanel->SetSizer( m_sizerPlot ); m_plotPanel->Layout(); m_sizerPlot->Fit( m_plotPanel ); m_panelConsole = new wxPanel( m_splitterPlotAndConsole, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelConsole->SetMinSize( wxSize( -1,100 ) ); - + m_sizerConsole = new wxBoxSizer( wxVERTICAL ); - + m_simConsole = new wxTextCtrl( m_panelConsole, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY ); m_simConsole->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - + m_sizerConsole->Add( m_simConsole, 1, wxALL|wxEXPAND, 5 ); - - + + m_panelConsole->SetSizer( m_sizerConsole ); m_panelConsole->Layout(); m_sizerConsole->Fit( m_panelConsole ); m_splitterPlotAndConsole->SplitHorizontally( m_plotPanel, m_panelConsole, 500 ); m_sizer11->Add( m_splitterPlotAndConsole, 1, wxEXPAND, 5 ); - - + + m_panelLeft->SetSizer( m_sizer11 ); m_panelLeft->Layout(); m_sizer11->Fit( m_panelLeft ); m_sidePanel = new wxPanel( m_splitterLeftRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_sidePanel->SetMinSize( wxSize( 200,-1 ) ); - + m_sideSizer = new wxBoxSizer( wxVERTICAL ); - + m_splitterSignals = new wxSplitterWindow( m_sidePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D ); m_splitterSignals->SetSashGravity( 0.3 ); m_splitterSignals->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this ); m_splitterSignals->SetMinimumPaneSize( 20 ); - + m_panelSignals = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelSignals->SetMinSize( wxSize( -1,100 ) ); - + wxStaticBoxSizer* sbSizer1; sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelSignals, wxID_ANY, _("Signals") ), wxVERTICAL ); - + m_signals = new wxListView( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL ); sbSizer1->Add( m_signals, 1, wxALL|wxEXPAND, 5 ); - - + + m_panelSignals->SetSizer( sbSizer1 ); m_panelSignals->Layout(); sbSizer1->Fit( m_panelSignals ); m_panelCursorsAndTune = new wxPanel( m_splitterSignals, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelCursorsAndTune->SetMinSize( wxSize( -1,300 ) ); - + wxBoxSizer* bSizer9; bSizer9 = new wxBoxSizer( wxVERTICAL ); - + m_splitterTuneValues = new wxSplitterWindow( m_panelCursorsAndTune, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D ); m_splitterTuneValues->SetSashGravity( 0.5 ); m_splitterTuneValues->Connect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this ); m_splitterTuneValues->SetMinimumPaneSize( 20 ); - + m_panelCursors = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelCursors->SetMinSize( wxSize( -1,100 ) ); - + wxStaticBoxSizer* sbSizer3; sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelCursors, wxID_ANY, _("Cursors") ), wxVERTICAL ); - + m_cursors = new wxListCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL ); sbSizer3->Add( m_cursors, 1, wxALL|wxEXPAND, 5 ); - - + + m_panelCursors->SetSizer( sbSizer3 ); m_panelCursors->Layout(); sbSizer3->Fit( m_panelCursors ); m_tunePanel = new wxPanel( m_splitterTuneValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_tunePanel->SetMinSize( wxSize( -1,200 ) ); - + m_tuneSizerStb = new wxStaticBoxSizer( new wxStaticBox( m_tunePanel, wxID_ANY, _("Tune") ), wxHORIZONTAL ); - + m_tuneSizer = new wxBoxSizer( wxHORIZONTAL ); - - + + m_tuneSizerStb->Add( m_tuneSizer, 1, wxEXPAND, 5 ); - - + + m_tunePanel->SetSizer( m_tuneSizerStb ); m_tunePanel->Layout(); m_tuneSizerStb->Fit( m_tunePanel ); m_splitterTuneValues->SplitHorizontally( m_panelCursors, m_tunePanel, 0 ); bSizer9->Add( m_splitterTuneValues, 1, wxEXPAND, 5 ); - - + + m_panelCursorsAndTune->SetSizer( bSizer9 ); m_panelCursorsAndTune->Layout(); bSizer9->Fit( m_panelCursorsAndTune ); m_splitterSignals->SplitHorizontally( m_panelSignals, m_panelCursorsAndTune, 0 ); m_sideSizer->Add( m_splitterSignals, 1, wxEXPAND, 5 ); - - + + m_sidePanel->SetSizer( m_sideSizer ); m_sidePanel->Layout(); m_sideSizer->Fit( m_sidePanel ); m_splitterLeftRight->SplitVertically( m_panelLeft, m_sidePanel, 700 ); m_sizerMain->Add( m_splitterLeftRight, 1, wxEXPAND, 5 ); - - + + this->SetSizer( m_sizerMain ); this->Layout(); - + this->Centre( wxBOTH ); - + // Connect Events - this->Connect( m_newPlot->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ) ); - this->Connect( m_openWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ) ); - this->Connect( m_saveWorkbook->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ) ); - this->Connect( m_saveImage->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ) ); - this->Connect( m_saveCsv->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ) ); - this->Connect( m_exitSim->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ) ); - this->Connect( m_zoomIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ) ); - this->Connect( m_zoomOut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ) ); - this->Connect( m_zoomFit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ) ); - this->Connect( m_showGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ) ); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ), this, m_newPlot->GetId()); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ), this, m_openWorkbook->GetId()); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ), this, m_saveWorkbook->GetId()); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ), this, m_saveImage->GetId()); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ), this, m_saveCsv->GetId()); + m_fileMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ), this, m_exitSim->GetId()); + m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ), this, m_zoomIn->GetId()); + m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ), this, m_zoomOut->GetId()); + m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ), this, m_zoomFit->GetId()); + m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ), this, m_showGrid->GetId()); this->Connect( m_showGrid->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) ); - this->Connect( m_showLegend->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ) ); + m_viewMenu->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ), this, m_showLegend->GetId()); this->Connect( m_showLegend->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) ); m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this ); m_plotNotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this ); @@ -295,22 +297,11 @@ SIM_PLOT_FRAME_BASE::SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id, const SIM_PLOT_FRAME_BASE::~SIM_PLOT_FRAME_BASE() { // Disconnect Events - this->Disconnect( wxID_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuNewPlot ) ); - this->Disconnect( wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuOpenWorkbook ) ); - this->Disconnect( wxID_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveWorkbook ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveImage ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuSaveCsv ) ); - this->Disconnect( wxID_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuExit ) ); - this->Disconnect( wxID_ZOOM_IN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomIn ) ); - this->Disconnect( wxID_ZOOM_OUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomOut ) ); - this->Disconnect( wxID_ZOOM_FIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuZoomFit ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowGrid ) ); - this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegend ) ); - this->Disconnect( wxID_ANY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) ); + this->Disconnect( ID_MENU_SHOW_GRID, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowGridUpdate ) ); + this->Disconnect( ID_MENU_SHOW_LEGEND, wxEVT_UPDATE_UI, wxUpdateUIEventHandler( SIM_PLOT_FRAME_BASE::menuShowLegendUpdate ) ); m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotChanged ), NULL, this ); m_plotNotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEventHandler( SIM_PLOT_FRAME_BASE::onPlotClose ), NULL, this ); m_signals->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( SIM_PLOT_FRAME_BASE::onSignalDblClick ), NULL, this ); m_signals->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( SIM_PLOT_FRAME_BASE::onSignalRClick ), NULL, this ); - + } diff --git a/eeschema/sim/sim_plot_frame_base.fbp b/eeschema/sim/sim_plot_frame_base.fbp index c6cb802ee4..be77036374 100644 --- a/eeschema/sim/sim_plot_frame_base.fbp +++ b/eeschema/sim/sim_plot_frame_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -54,41 +54,6 @@ SIM_PLOT_FRAME wxTAB_TRAVERSAL 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -111,30 +76,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - + File m_fileMenu protected @@ -151,7 +93,6 @@ menuNewPlot - m_separator3 @@ -170,7 +111,6 @@ menuOpenWorkbook - @@ -185,7 +125,6 @@ menuSaveWorkbook - m_separator1 @@ -196,7 +135,7 @@ 0 1 - wxID_ANY + ID_SAVE_AS_IMAGE wxITEM_NORMAL Save as image m_saveImage @@ -204,22 +143,20 @@ menuSaveImage - 0 1 - wxID_ANY + ID_SAVE_AS_CSV wxITEM_NORMAL - Save as .csv file + Save as .csv File m_saveCsv none menuSaveCsv - m_separator4 @@ -238,10 +175,9 @@ menuExit - - + Simulation m_simulationMenu protected @@ -250,15 +186,13 @@ 0 1 - wxID_ANY + ID_MENU_RUN_SIM wxITEM_NORMAL Run Simulation m_runSimulation protected - - m_separator31 @@ -269,60 +203,56 @@ 0 1 - wxID_ANY + ID_MENU_ADD_SIGNAL wxITEM_NORMAL - Add signals... + Add Signals... m_addSignals protected - - 0 1 - wxID_ANY + ID_MENU_PROBE_SIGNALS wxITEM_NORMAL Probe from schematics m_probeSignals protected - - 0 1 - wxID_ANY + ID_MENU_TUNE_SIGNALS wxITEM_NORMAL - Tune component value + Tune Component Value m_tuneValue protected - - + + + m_separator7 + none 0 1 Shows current simulation's netlist. Useful for debugging SPICE errors. - wxID_ANY + ID_MENU_SHOW_NETLIST wxITEM_NORMAL Show SPICE Netlist... m_showNetlist protected - - m_separator41 @@ -333,18 +263,16 @@ 0 1 - wxID_ANY + ID_MENU_SET_SIMUL wxITEM_NORMAL Settings... m_settings protected - - - + View m_viewMenu protected @@ -361,7 +289,6 @@ menuZoomIn - @@ -376,7 +303,6 @@ menuZoomOut - @@ -391,7 +317,6 @@ menuZoomFit - m_separator2 @@ -402,7 +327,7 @@ 0 1 - wxID_ANY + ID_MENU_SHOW_GRID wxITEM_CHECK Show &grid m_showGrid @@ -417,9 +342,9 @@ 0 1 - wxID_ANY + ID_MENU_SHOW_LEGEND wxITEM_CHECK - Show &legend + Show &Legend m_showLegend none @@ -494,29 +419,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -580,33 +482,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 @@ -659,29 +534,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - m_sizer11 @@ -748,33 +600,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 @@ -827,29 +652,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - m_sizerPlot @@ -913,38 +715,8 @@ - - - - - onPlotChanged - onPlotClose - - - - - - - - - - - - - - - - - - - - - - - - a page @@ -1000,29 +772,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - m_sizer8 @@ -1090,6 +839,7 @@ 0 wxID_ANY Start the simulation by clicking the Run Simulation button + 0 0 @@ -1115,29 +865,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -1222,29 +949,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - m_sizerConsole @@ -1312,33 +1016,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1401,29 +1078,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - m_sideSizer @@ -1490,33 +1144,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 @@ -1569,29 +1196,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - wxID_ANY Signals @@ -1600,7 +1204,6 @@ wxVERTICAL 1 none - 5 wxALL|wxEXPAND @@ -1661,49 +1264,8 @@ - - - - - - - onSignalDblClick - - - - - - - - - - - - - - - - - - - onSignalRClick - - - - - - - - - - - - - - - @@ -1761,29 +1323,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - bSizer9 @@ -1850,33 +1389,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 @@ -1929,29 +1441,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - wxID_ANY Cursors @@ -1960,7 +1449,6 @@ wxVERTICAL 1 none - 5 wxALL|wxEXPAND @@ -2021,49 +1509,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2121,29 +1566,6 @@ wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - wxID_ANY Tune @@ -2152,7 +1574,6 @@ wxHORIZONTAL 1 protected - 5 wxEXPAND diff --git a/eeschema/sim/sim_plot_frame_base.h b/eeschema/sim/sim_plot_frame_base.h index 6c5a7bb186..6b7f4997d0 100644 --- a/eeschema/sim/sim_plot_frame_base.h +++ b/eeschema/sim/sim_plot_frame_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2018) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __SIM_PLOT_FRAME_BASE_H__ -#define __SIM_PLOT_FRAME_BASE_H__ +#pragma once #include #include @@ -34,6 +33,16 @@ /////////////////////////////////////////////////////////////////////////// +#define ID_SAVE_AS_IMAGE 1000 +#define ID_SAVE_AS_CSV 1001 +#define ID_MENU_RUN_SIM 1002 +#define ID_MENU_ADD_SIGNAL 1003 +#define ID_MENU_PROBE_SIGNALS 1004 +#define ID_MENU_TUNE_SIGNALS 1005 +#define ID_MENU_SHOW_NETLIST 1006 +#define ID_MENU_SET_SIMUL 1007 +#define ID_MENU_SHOW_GRID 1008 +#define ID_MENU_SHOW_LEGEND 1009 /////////////////////////////////////////////////////////////////////////////// /// Class SIM_PLOT_FRAME_BASE @@ -41,7 +50,7 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER { private: - + protected: wxMenuBar* m_mainMenu; wxMenu* m_fileMenu; @@ -80,7 +89,7 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER wxPanel* m_tunePanel; wxStaticBoxSizer* m_tuneSizerStb; wxBoxSizer* m_tuneSizer; - + // Virtual event handlers, overide them in your derived class virtual void menuNewPlot( wxCommandEvent& event ) { event.Skip(); } virtual void menuOpenWorkbook( wxCommandEvent& event ) { event.Skip(); } @@ -99,38 +108,37 @@ class SIM_PLOT_FRAME_BASE : public KIWAY_PLAYER virtual void onPlotClose( wxAuiNotebookEvent& event ) { event.Skip(); } virtual void onSignalDblClick( wxMouseEvent& event ) { event.Skip(); } virtual void onSignalRClick( wxListEvent& event ) { event.Skip(); } - - + + public: - + SIM_PLOT_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Spice Simulator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 511,468 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("SIM_PLOT_FRAME") ); - + ~SIM_PLOT_FRAME_BASE(); - + void m_splitterLeftRightOnIdle( wxIdleEvent& ) { m_splitterLeftRight->SetSashPosition( 700 ); m_splitterLeftRight->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterLeftRightOnIdle ), NULL, this ); } - + void m_splitterPlotAndConsoleOnIdle( wxIdleEvent& ) { m_splitterPlotAndConsole->SetSashPosition( 500 ); m_splitterPlotAndConsole->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterPlotAndConsoleOnIdle ), NULL, this ); } - + void m_splitterSignalsOnIdle( wxIdleEvent& ) { m_splitterSignals->SetSashPosition( 0 ); m_splitterSignals->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterSignalsOnIdle ), NULL, this ); } - + void m_splitterTuneValuesOnIdle( wxIdleEvent& ) { m_splitterTuneValues->SetSashPosition( 0 ); m_splitterTuneValues->Disconnect( wxEVT_IDLE, wxIdleEventHandler( SIM_PLOT_FRAME_BASE::m_splitterTuneValuesOnIdle ), NULL, this ); } - + }; -#endif //__SIM_PLOT_FRAME_BASE_H__ diff --git a/include/menus_helpers.h b/include/menus_helpers.h index 3794799d57..773710042d 100644 --- a/include/menus_helpers.h +++ b/include/menus_helpers.h @@ -35,6 +35,15 @@ #include #include +/** + * Add a bitmap to a menuitem + * @param aMenu is the menuitem. + * @param aImage is the icon to add to aMenu. + * It is added only if use images in menus config option allows it. + * For wxITEM_CHECK or wxITEM_RADIO menuitems, the bitmap is added only + * on Windows, other platforms do not support it + */ +void AddBitmapToMenuItem( wxMenuItem* aMenu, const wxBitmap& aImage ); /**