Commit 87225998 authored by Maciej Suminski's avatar Maciej Suminski

CONDITIONAL_MENU supports separators and ordering.

parent 958046dd
...@@ -74,7 +74,7 @@ bool PCB_EDITOR_CONTROL::Init() ...@@ -74,7 +74,7 @@ bool PCB_EDITOR_CONTROL::Init()
if( selTool ) if( selTool )
{ {
selTool->GetMenu().AddMenu( new ZONE_CONTEXT_MENU, _( "Zones" ), selTool->GetMenu().AddMenu( new ZONE_CONTEXT_MENU, _( "Zones" ), false,
SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T ) ); SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T ) );
} }
......
...@@ -63,7 +63,8 @@ bool PLACEMENT_TOOL::Init() ...@@ -63,7 +63,8 @@ bool PLACEMENT_TOOL::Init()
menu->AppendSeparator(); menu->AppendSeparator();
menu->Add( COMMON_ACTIONS::distributeHorizontally ); menu->Add( COMMON_ACTIONS::distributeHorizontally );
menu->Add( COMMON_ACTIONS::distributeVertically ); menu->Add( COMMON_ACTIONS::distributeVertically );
m_selectionTool->GetMenu().AddMenu( menu, _( "Align/distribute" ), SELECTION_CONDITIONS::MoreThan( 1 ) ); m_selectionTool->GetMenu().AddMenu( menu, _( "Align/distribute" ), false,
SELECTION_CONDITIONS::MoreThan( 1 ) );
return true; return true;
} }
......
...@@ -85,19 +85,21 @@ bool SELECTION_TOOL::Init() ...@@ -85,19 +85,21 @@ bool SELECTION_TOOL::Init()
{ {
m_selection.group = new KIGFX::VIEW_GROUP; m_selection.group = new KIGFX::VIEW_GROUP;
m_menu.AddMenu( new SELECT_MENU, _( "Select..." ), m_menu.AddMenu( new SELECT_MENU, _( "Select..." ), false,
(SELECTION_CONDITION) SELECTION_CONDITIONS::OnlyConnectedItems && (SELECTION_CONDITION) SELECTION_CONDITIONS::OnlyConnectedItems &&
SELECTION_CONDITIONS::Count( 1 ) ); SELECTION_CONDITIONS::Count( 1 ) );
m_menu.AddItem( COMMON_ACTIONS::zoomCenter ); m_menu.AddSeparator( SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomIn );
m_menu.AddItem( COMMON_ACTIONS::zoomOut );
m_menu.AddItem( COMMON_ACTIONS::zoomFitScreen );
m_menu.AddMenu( new ZOOM_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Zoom" ); m_menu.AddItem( COMMON_ACTIONS::zoomCenter, SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddMenu( new GRID_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Grid" ); m_menu.AddItem( COMMON_ACTIONS::zoomIn, SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomOut , SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddItem( COMMON_ACTIONS::zoomFitScreen , SELECTION_CONDITIONS::ShowAlways, 1000 );
//m_menu.AddSeparator(); m_menu.AddMenu( new ZOOM_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Zoom",
false, SELECTION_CONDITIONS::ShowAlways, 1000 );
m_menu.AddMenu( new GRID_MENU( getEditFrame<PCB_BASE_FRAME>() ), "Grid",
false, SELECTION_CONDITIONS::ShowAlways, 1000 );
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment