Instantate a default menu from no selection when menu is first built.
This might resolve some of the GTK menu anomalies.
This commit is contained in:
parent
b7f4113f96
commit
45a9544726
|
@ -69,12 +69,6 @@ void CONDITIONAL_MENU::AddItem( int aId, const wxString& aText, const wxString&
|
|||
AddBitmapToMenuItem( item, KiBitmap( aIcon ) );
|
||||
|
||||
addEntry( ENTRY( item, aIcon, aCondition, aOrder, false ) );
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Make sure the Mac-specific preference-menu handling code can find it
|
||||
if( aId == wxID_PREFERENCES )
|
||||
Append( new wxMenuItem( this, aId, aText, aTooltip, wxITEM_NORMAL ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +98,14 @@ void CONDITIONAL_MENU::AddSeparator( const SELECTION_CONDITION& aCondition, int
|
|||
}
|
||||
|
||||
|
||||
SELECTION g_resolveDummySelection;
|
||||
|
||||
void CONDITIONAL_MENU::Resolve()
|
||||
{
|
||||
Evaluate( g_resolveDummySelection );
|
||||
}
|
||||
|
||||
|
||||
void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
|
||||
{
|
||||
Clear();
|
||||
|
@ -143,9 +145,13 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
|
|||
|
||||
case ENTRY::WXITEM:
|
||||
#ifdef __WXMAC__
|
||||
// wxWidgets moved the Preferences... item to the Apple menu
|
||||
// Instantiate the Preferences item only on the first Resolve(); after that
|
||||
// wxWidgets will have moved it to the Application menu
|
||||
if( entry.wxItem()->GetId() == wxID_PREFERENCES )
|
||||
continue;
|
||||
{
|
||||
if( &aSelection != &g_resolveDummySelection )
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
menuItem = new wxMenuItem( this,
|
||||
entry.wxItem()->GetId(),
|
||||
|
|
|
@ -108,6 +108,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- Edit menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -135,6 +137,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
editMenu->AddItem( EE_ACTIONS::symbolProperties, havePartCondition );
|
||||
editMenu->AddItem( EE_ACTIONS::pinTable, havePartCondition );
|
||||
|
||||
editMenu->Resolve();
|
||||
|
||||
//-- View menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -181,6 +185,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AddSeparator();
|
||||
viewMenu->AddCheckItem( EE_ACTIONS::showComponentTree, compTreeShownCondition );
|
||||
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Place menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -192,6 +198,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AddItem( EE_ACTIONS::drawSymbolArc, EE_CONDITIONS::ShowAlways );
|
||||
placeMenu->AddItem( EE_ACTIONS::drawSymbolLines, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
placeMenu->Resolve();
|
||||
|
||||
//-- Inspect menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* inspectMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -208,6 +216,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Check for duplicate and off-grid pins" ),
|
||||
KiBitmap( erc_xpm ) );
|
||||
|
||||
inspectMenu->Resolve();
|
||||
|
||||
//-- Preferences menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -239,8 +249,9 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
||||
prefsMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
||||
|
||||
//
|
||||
// Create the menubar and append all submenus
|
||||
prefsMenu->Resolve();
|
||||
|
||||
//-- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( editMenu, _( "&Edit" ) );
|
||||
|
|
|
@ -131,6 +131,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- Edit menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -165,6 +167,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Sets symbol fields to original library values" ),
|
||||
update_fields_xpm, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
editMenu->Resolve();
|
||||
|
||||
//-- View menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -217,9 +221,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AddCheckItem( EE_ACTIONS::toggleHiddenPins, hiddenPinsCondition );
|
||||
|
||||
#ifdef __APPLE__
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->AddSeparator();
|
||||
#endif
|
||||
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Place menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -246,6 +252,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AddItem( EE_ACTIONS::placeSchematicText, EE_CONDITIONS::ShowAlways );
|
||||
placeMenu->AddItem( EE_ACTIONS::placeImage, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
placeMenu->Resolve();
|
||||
|
||||
//-- Inspect menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* inspectMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -255,6 +263,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
inspectMenu->AddItem( EE_ACTIONS::runSimulation, EE_CONDITIONS::ShowAlways );
|
||||
#endif
|
||||
|
||||
inspectMenu->Resolve();
|
||||
|
||||
//-- Tools menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* toolsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -291,6 +301,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
toolsMenu->AddItem( EE_ACTIONS::assignFootprints, EE_CONDITIONS::ShowAlways );
|
||||
toolsMenu->AddItem( EE_ACTIONS::generateBOM, EE_CONDITIONS::ShowAlways );
|
||||
|
||||
toolsMenu->Resolve();
|
||||
|
||||
//-- Preferences menu -----------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -322,7 +334,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
||||
prefsMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
||||
|
||||
//-- Menubar -----------------------------------------------
|
||||
prefsMenu->Resolve();
|
||||
|
||||
//-- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( editMenu, _( "&Edit" ) );
|
||||
|
|
|
@ -96,19 +96,16 @@ void LIB_VIEW_FRAME::ReCreateVToolbar()
|
|||
}
|
||||
|
||||
|
||||
// Virtual function
|
||||
void LIB_VIEW_FRAME::ReCreateMenuBar()
|
||||
{
|
||||
LIB_CONTROL* libControl = m_toolManager->GetTool<LIB_CONTROL>();
|
||||
// wxWidgets handles the Mac Application menu behind the scenes, but that means
|
||||
// wxWidgets handles the OSX Application menu behind the scenes, but that means
|
||||
// we always have to start from scratch with a new wxMenuBar.
|
||||
wxMenuBar* oldMenuBar = GetMenuBar();
|
||||
wxMenuBar* menuBar = new wxMenuBar();
|
||||
wxString text;
|
||||
|
||||
// Recreate all menus:
|
||||
|
||||
// Menu File:
|
||||
//-- File menu -----------------------------------------------------------
|
||||
//
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
|
||||
AddMenuItem( fileMenu, wxID_EXIT,
|
||||
|
@ -116,13 +113,13 @@ void LIB_VIEW_FRAME::ReCreateMenuBar()
|
|||
_( "Close schematic symbol viewer" ),
|
||||
KiBitmap( exit_xpm ) );
|
||||
|
||||
// View menu
|
||||
//-- View menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, libControl );
|
||||
|
||||
auto gridShownCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return IsGridVisible();
|
||||
};
|
||||
|
||||
auto electricalTypesShownCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetShowElectricalType();
|
||||
};
|
||||
|
@ -139,9 +136,11 @@ void LIB_VIEW_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AddSeparator();
|
||||
viewMenu->AddCheckItem( EE_ACTIONS::showElectricalTypes, electricalTypesShownCondition );
|
||||
|
||||
// Append menus to the menubar
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( viewMenu, _( "&View" ) );
|
||||
AddStandardHelpMenu( menuBar );
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
wxMenuBar* oldMenuBar = GetMenuBar();
|
||||
wxMenuBar* menuBar = new wxMenuBar();
|
||||
|
||||
//-- File menu -----------------------------------------------
|
||||
//-- File menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
static ACTION_MENU* openRecentGbrMenu;
|
||||
|
@ -142,7 +142,9 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
//-- View menu -----------------------------------------------
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- View menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -226,7 +228,9 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
_( "Show in high contrast mode" ),
|
||||
contrast_mode_xpm, contrastModeCondition );
|
||||
|
||||
//-- Tools menu -----------------------------------------------
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Tools menu -------------------------------------------------------
|
||||
//
|
||||
wxMenu* toolsMenu = new wxMenu;
|
||||
|
||||
|
@ -270,9 +274,9 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
preferencesMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
||||
preferencesMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
||||
|
||||
preferencesMenu->AppendSeparator();
|
||||
preferencesMenu->Resolve();
|
||||
|
||||
//-- Menubar -----------------------------------------------
|
||||
//-- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( viewMenu, _( "&View" ) );
|
||||
|
|
|
@ -110,6 +110,15 @@ public:
|
|||
*/
|
||||
void Evaluate( SELECTION& aSelection );
|
||||
|
||||
/**
|
||||
* Function Resolve()
|
||||
*
|
||||
* Updates the initial contents so that wxWidgets doesn't get its knickers tied in a knot
|
||||
* over the menu being empty (mainly an issue on GTK, but also on OSX with the preferences
|
||||
* and quit menu items).
|
||||
*/
|
||||
void Resolve();
|
||||
|
||||
private:
|
||||
///> Helper class to organize menu entries.
|
||||
class ENTRY
|
||||
|
|
|
@ -57,8 +57,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
if( openRecentMenu )
|
||||
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
||||
|
||||
//
|
||||
// File Menu:
|
||||
//-- File menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -86,8 +85,9 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
//
|
||||
// Edit Menu:
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- Edit menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -110,8 +110,9 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
editMenu->AddItem( ACTIONS::paste, idleCondition );
|
||||
editMenu->AddItem( ACTIONS::doDelete, SELECTION_CONDITIONS::MoreThan( 0 ) );
|
||||
|
||||
//
|
||||
// View Menu:
|
||||
editMenu->Resolve();
|
||||
|
||||
//-- View menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -137,8 +138,9 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AddCheckItem( ACTIONS::toggleGrid, gridShownCondition );
|
||||
viewMenu->AddCheckItem( ACTIONS::toggleCursorStyle, fullCrosshairCondition );
|
||||
|
||||
//
|
||||
// Place Menu:
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Place menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -150,8 +152,9 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AddSeparator();
|
||||
placeMenu->AddItem( PL_ACTIONS::appendImportedWorksheet, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
//
|
||||
// Menu for preferences
|
||||
placeMenu->Resolve();
|
||||
|
||||
//-- Preferences menu --------------------------------------------------
|
||||
//
|
||||
wxMenu* preferencesMenu = new wxMenu;
|
||||
|
||||
|
@ -163,7 +166,8 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
|||
// Language submenu
|
||||
Pgm().AddMenuLanguageList( preferencesMenu );
|
||||
|
||||
// Append menus to the menubar
|
||||
//-- Menubar -----------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( editMenu, _( "&Edit" ) );
|
||||
menuBar->Append( viewMenu, _( "&View" ) );
|
||||
|
|
|
@ -59,7 +59,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
return( !libName.IsEmpty() || !partName.IsEmpty() );
|
||||
};
|
||||
|
||||
//-- File menu -----------------------------------------------
|
||||
//-- File menu ----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* fileMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -131,7 +131,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
//-- Edit menu -----------------------------------------------
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- Edit menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -171,7 +173,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Delete the current footprint" ),
|
||||
KiBitmap( delete_xpm ) );
|
||||
|
||||
//-- View menu -----------------------------------------------
|
||||
editMenu->Resolve();
|
||||
|
||||
//-- View menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -260,7 +264,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "&Search Tree" ), _( "Toggles the search tree visibility" ),
|
||||
search_tree_xpm, searchTreeShownCondition );
|
||||
|
||||
//-- Place menu -----------------------------------------------
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Place menu -------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -277,8 +283,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
placeMenu->AddItem( PCB_ACTIONS::setAnchor, SELECTION_CONDITIONS::ShowAlways );
|
||||
placeMenu->AddItem( ACTIONS::gridSetOrigin, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
placeMenu->Resolve();
|
||||
|
||||
//-- Inspect menu -----------------------------------------------
|
||||
//-- Inspect menu -------------------------------------------------------
|
||||
//
|
||||
wxMenu* inspectMenu = new wxMenu;
|
||||
|
||||
|
@ -287,7 +294,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Measure distance" ),
|
||||
KiBitmap( measurement_xpm ) );
|
||||
|
||||
//-- Tools menu -----------------------------------------------
|
||||
//-- Tools menu -------------------------------------------------------
|
||||
//
|
||||
wxMenu* toolsMenu = new wxMenu;
|
||||
|
||||
|
@ -302,7 +309,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
KiBitmap( insert_module_board_xpm ) );
|
||||
|
||||
|
||||
//-- Preferences menu -----------------------------------------------
|
||||
//-- Preferences menu -------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
|
@ -333,6 +340,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
||||
prefsMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
||||
|
||||
prefsMenu->Resolve();
|
||||
|
||||
//--MenuBar -----------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
|
|
|
@ -201,7 +201,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
fileMenu->AddItem( ACTIONS::print, SELECTION_CONDITIONS::ShowAlways );
|
||||
fileMenu->AddItem( ACTIONS::plot, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
|
||||
// Archive submenu
|
||||
ACTION_MENU* submenuArchive = new ACTION_MENU();
|
||||
submenuArchive->SetTool( selTool );
|
||||
|
@ -225,6 +224,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
|
||||
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
fileMenu->Resolve();
|
||||
|
||||
//-- Edit menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -280,7 +281,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
_( "Clean stubs, vias, delete break points or unconnected tracks" ),
|
||||
delete_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
editMenu->Resolve();
|
||||
|
||||
//----- View menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
auto layersPaletteShownCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
|
@ -412,6 +416,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AppendSeparator();
|
||||
#endif
|
||||
|
||||
viewMenu->Resolve();
|
||||
|
||||
//-- Place Menu ----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
@ -448,6 +454,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
|
||||
placeMenu->AddMenu( autoplaceSubmenu );
|
||||
|
||||
placeMenu->Resolve();
|
||||
|
||||
//-- Route Menu ----------------------------------------------------------
|
||||
//
|
||||
wxMenu* routeMenu = new wxMenu;
|
||||
|
@ -514,6 +522,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );
|
||||
prefsMenu->AddCheckItem( ACTIONS::standardGraphics, standardGraphicsCondition );
|
||||
|
||||
prefsMenu->Resolve();
|
||||
|
||||
//--MenuBar -----------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
|
|
|
@ -115,7 +115,6 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateVToolbar()
|
|||
}
|
||||
|
||||
|
||||
// Virtual function
|
||||
void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
|
||||
{
|
||||
SELECTION_TOOL* selTool = m_toolManager->GetTool<SELECTION_TOOL>();
|
||||
|
@ -123,11 +122,9 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
|
|||
// we always have to start from scratch with a new wxMenuBar.
|
||||
wxMenuBar* oldMenuBar = GetMenuBar();
|
||||
wxMenuBar* menuBar = new wxMenuBar();
|
||||
wxString text;
|
||||
|
||||
// Recreate all menus:
|
||||
|
||||
// Menu File:
|
||||
//----- File menu -----------------------------------------------------------
|
||||
//
|
||||
wxMenu* fileMenu = new wxMenu;
|
||||
|
||||
// Close viewer
|
||||
|
@ -136,7 +133,8 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
|
|||
_( "Close footprint viewer" ),
|
||||
KiBitmap( exit_xpm ) );
|
||||
|
||||
// View menu
|
||||
//----- View menu -----------------------------------------------------------
|
||||
//
|
||||
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
viewMenu->AddSeparator();
|
||||
|
@ -145,14 +143,16 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
|
|||
viewMenu->AddItem( ACTIONS::zoomFitScreen, SELECTION_CONDITIONS::ShowAlways );
|
||||
viewMenu->AddItem( ACTIONS::zoomRedraw, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->AddSeparator();
|
||||
viewMenu->AddItem( ID_MODVIEW_SHOW_3D_VIEW,
|
||||
AddHotkeyName( _( "3D Viewer" ), g_Module_Viewer_Hotkeys_Descr, HK_3D_VIEWER ),
|
||||
_( "Show footprint in 3D viewer" ),
|
||||
three_d_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
// 3D view
|
||||
text = AddHotkeyName( _( "3&D Viewer" ), g_Module_Viewer_Hotkeys_Descr, HK_3D_VIEWER );
|
||||
AddMenuItem( viewMenu, ID_MODVIEW_SHOW_3D_VIEW, text, _( "Show footprint in 3D viewer" ),
|
||||
KiBitmap( three_d_xpm ) );
|
||||
viewMenu->Resolve();
|
||||
|
||||
// Append menus to the menubar
|
||||
//----- Menubar -------------------------------------------------------------
|
||||
//
|
||||
menuBar->Append( fileMenu, _( "&File" ) );
|
||||
menuBar->Append( viewMenu, _( "&View" ) );
|
||||
AddStandardHelpMenu( menuBar );
|
||||
|
|
Loading…
Reference in New Issue