Add unit submenu to page layout editor view menu

This commit is contained in:
Ian McInerney 2020-10-05 20:22:57 +01:00
parent 27f3ac980f
commit 9d3aca56bb
2 changed files with 13 additions and 0 deletions

View File

@ -110,6 +110,16 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK ); viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK );
// Units submenu
ACTION_MENU* unitsSubMenu = new ACTION_MENU( false, selTool );
unitsSubMenu->SetTitle( _( "&Units" ) );
unitsSubMenu->SetIcon( unit_mm_xpm );
unitsSubMenu->Add( ACTIONS::inchesUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::milsUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::millimetersUnits, ACTION_MENU::CHECK );
viewMenu->Add( unitsSubMenu );
viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK ); viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK );
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();

View File

@ -253,6 +253,9 @@ void PL_EDITOR_FRAME::setupUIConditions()
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
mgr->SetConditions( ACTIONS::cut, ENABLE( SELECTION_CONDITIONS::NotEmpty ) ); mgr->SetConditions( ACTIONS::cut, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );
mgr->SetConditions( ACTIONS::copy, ENABLE( SELECTION_CONDITIONS::NotEmpty ) ); mgr->SetConditions( ACTIONS::copy, ENABLE( SELECTION_CONDITIONS::NotEmpty ) );