Cleanup doDelete ACTIONs

This commit is contained in:
Michael Kavanagh 2019-07-31 13:48:00 +01:00 committed by Wayne Stambaugh
parent 79b2ff7551
commit b414cbfada
6 changed files with 14 additions and 14 deletions

View File

@ -68,7 +68,7 @@ bool LIB_EDIT_TOOL::Init()
moveMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty, 200 ); moveMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty, 200 );
moveMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty, 200 ); moveMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty, 200 );
moveMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty, 200 ); moveMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty, 200 );
moveMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 ); moveMenu.AddItem( ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 );
moveMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 ); moveMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
@ -98,7 +98,7 @@ bool LIB_EDIT_TOOL::Init()
selToolMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( EE_ACTIONS::rotateCW, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( EE_ACTIONS::mirrorX, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( EE_ACTIONS::mirrorY, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( ACTIONS::doDelete, EE_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 ); selToolMenu.AddItem( EE_ACTIONS::properties, EE_CONDITIONS::Count( 1 ), 200 );
@ -303,7 +303,7 @@ int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->UnbrightenItem( m_pickerItem );
selectionTool->AddItemToSel( m_pickerItem, true ); selectionTool->AddItemToSel( m_pickerItem, true );
m_toolMgr->RunAction( EE_ACTIONS::doDelete, true ); m_toolMgr->RunAction( ACTIONS::doDelete, true );
m_pickerItem = nullptr; m_pickerItem = nullptr;
} }
@ -753,7 +753,7 @@ void LIB_EDIT_TOOL::setTransitions()
Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() ); Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() ); Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &LIB_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() ); Go( &LIB_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() );
Go( &LIB_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); Go( &LIB_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() );
Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() );

View File

@ -215,7 +215,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else if( evt->Category() == TC_COMMAND ) else if( evt->Category() == TC_COMMAND )
{ {
if( evt->IsAction( &EE_ACTIONS::doDelete ) ) if( evt->IsAction( &ACTIONS::doDelete ) )
{ {
// Exit on a remove operation; there is no further processing for removed items. // Exit on a remove operation; there is no further processing for removed items.
break; break;

View File

@ -227,7 +227,7 @@ bool SCH_EDIT_TOOL::Init()
moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition ); moveMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition );
moveMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition ); moveMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition );
moveMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition ); moveMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition );
moveMenu.AddItem( EE_ACTIONS::doDelete, E_C::NotEmpty ); moveMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty );
moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition ); moveMenu.AddItem( EE_ACTIONS::properties, propertiesCondition );
moveMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition ); moveMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition );
@ -287,7 +287,7 @@ bool SCH_EDIT_TOOL::Init()
selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::doDelete, E_C::NotEmpty, 200 ); selToolMenu.AddItem( ACTIONS::doDelete, E_C::NotEmpty, 200 );
selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::editReference, E_C::SingleSymbol, 200 ); selToolMenu.AddItem( EE_ACTIONS::editReference, E_C::SingleSymbol, 200 );
@ -969,7 +969,7 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->UnbrightenItem( m_pickerItem );
selectionTool->AddItemToSel( m_pickerItem, true ); selectionTool->AddItemToSel( m_pickerItem, true );
m_toolMgr->RunAction( EE_ACTIONS::doDelete, true ); m_toolMgr->RunAction( ACTIONS::doDelete, true );
m_pickerItem = nullptr; m_pickerItem = nullptr;
} }
@ -1396,7 +1396,7 @@ void SCH_EDIT_TOOL::setTransitions()
Go( &SCH_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); Go( &SCH_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() );
Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() ); Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() ); Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &SCH_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() ); Go( &SCH_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() );
Go( &SCH_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); Go( &SCH_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() );
Go( &SCH_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); Go( &SCH_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() );

View File

@ -862,7 +862,7 @@ int SCH_EDITOR_CONTROL::Cut( const TOOL_EVENT& aEvent )
} }
if( doCopy() ) if( doCopy() )
m_toolMgr->RunAction( EE_ACTIONS::doDelete, true ); m_toolMgr->RunAction( ACTIONS::doDelete, true );
return 0; return 0;
} }

View File

@ -359,7 +359,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else if( evt->Category() == TC_COMMAND ) else if( evt->Category() == TC_COMMAND )
{ {
if( evt->IsAction( &EE_ACTIONS::doDelete ) ) if( evt->IsAction( &ACTIONS::doDelete ) )
{ {
// Exit on a remove operation; there is no further processing for removed items. // Exit on a remove operation; there is no further processing for removed items.
break; break;

View File

@ -56,7 +56,7 @@ bool PL_EDIT_TOOL::Init()
ctxMenu.AddItem( ACTIONS::cancelInteractive, SELECTION_CONDITIONS::ShowAlways, 1 ); ctxMenu.AddItem( ACTIONS::cancelInteractive, SELECTION_CONDITIONS::ShowAlways, 1 );
ctxMenu.AddSeparator( 200 ); ctxMenu.AddSeparator( 200 );
ctxMenu.AddItem( PL_ACTIONS::doDelete, SELECTION_CONDITIONS::NotEmpty, 200 ); ctxMenu.AddItem( ACTIONS::doDelete, SELECTION_CONDITIONS::NotEmpty, 200 );
// Finally, add the standard zoom/grid items // Finally, add the standard zoom/grid items
m_frame->AddStandardSubMenus( m_menu ); m_frame->AddStandardSubMenus( m_menu );
@ -70,7 +70,7 @@ bool PL_EDIT_TOOL::Init()
selToolMenu.AddItem( PL_ACTIONS::copy, SELECTION_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( PL_ACTIONS::copy, SELECTION_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( PL_ACTIONS::paste, SELECTION_CONDITIONS::ShowAlways, 200 ); selToolMenu.AddItem( PL_ACTIONS::paste, SELECTION_CONDITIONS::ShowAlways, 200 );
selToolMenu.AddItem( PL_ACTIONS::move, SELECTION_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( PL_ACTIONS::move, SELECTION_CONDITIONS::NotEmpty, 200 );
selToolMenu.AddItem( PL_ACTIONS::doDelete, SELECTION_CONDITIONS::NotEmpty, 200 ); selToolMenu.AddItem( ACTIONS::doDelete, SELECTION_CONDITIONS::NotEmpty, 200 );
return true; return true;
} }
@ -200,7 +200,7 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
} }
else if( evt->Category() == TC_COMMAND ) else if( evt->Category() == TC_COMMAND )
{ {
if( evt->IsAction( &PL_ACTIONS::doDelete ) ) if( evt->IsAction( &ACTIONS::doDelete ) )
{ {
// Exit on a remove operation; there is no further processing for removed items. // Exit on a remove operation; there is no further processing for removed items.
break; break;