Add AutoplaceFields to symbol tool context menu.

This commit is contained in:
Jeff Young 2019-05-17 16:44:58 +01:00
parent 7c25001622
commit 5f851a4bad
4 changed files with 19 additions and 18 deletions

View File

@ -150,7 +150,7 @@ public:
static TOOL_ACTION showDatasheet; static TOOL_ACTION showDatasheet;
static TOOL_ACTION showMarkerInfo; static TOOL_ACTION showMarkerInfo;
static TOOL_ACTION showSymbolEditor; static TOOL_ACTION showSymbolEditor;
static TOOL_ACTION editWithSymbolEditor; static TOOL_ACTION editWithLibEdit;
static TOOL_ACTION showLibraryBrowser; static TOOL_ACTION showLibraryBrowser;
/// Clipboard /// Clipboard

View File

@ -397,6 +397,7 @@ bool SCH_EDIT_TOOL::Init()
drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol, 200 ); drawMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol, 200 );
std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>(); std::shared_ptr<SYMBOL_UNIT_MENU> symUnitMenu2 = std::make_shared<SYMBOL_UNIT_MENU>();
@ -404,8 +405,8 @@ bool SCH_EDIT_TOOL::Init()
drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 ); drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 );
drawMenu.AddMenu( symUnitMenu2.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 ); drawMenu.AddMenu( symUnitMenu2.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
drawMenu.AddItem( EE_ACTIONS::editWithSymbolEditor, drawMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition
singleComponentCondition && EE_CONDITIONS::Idle, 200 ); && EE_CONDITIONS::Idle, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );
@ -439,8 +440,8 @@ bool SCH_EDIT_TOOL::Init()
m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 ); m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 );
selToolMenu.AddMenu( symUnitMenu3.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 ); selToolMenu.AddMenu( symUnitMenu3.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 );
selToolMenu.AddItem( EE_ACTIONS::editWithSymbolEditor, selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition
singleComponentCondition && EE_CONDITIONS::Idle, 200 ); && EE_CONDITIONS::Idle, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 );
selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 );

View File

@ -81,7 +81,7 @@ TOOL_ACTION EE_ACTIONS::showSymbolEditor( "eeschema.EditorControl.showSymbolEdit
_( "Show Symbol Editor" ), _( "Create, delete and edit symbols" ), _( "Show Symbol Editor" ), _( "Create, delete and edit symbols" ),
libedit_xpm ); libedit_xpm );
TOOL_ACTION EE_ACTIONS::editWithSymbolEditor( "eeschema.EditorControl.editWithSymbolEditor", TOOL_ACTION EE_ACTIONS::editWithLibEdit( "eeschema.EditorControl.editWithSymbolEditor",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_WITH_LIBEDIT ), AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_WITH_LIBEDIT ),
_( "Edit with Symbol Editor" ), _( "Open the symbol editor to edit the symbol" ), _( "Edit with Symbol Editor" ), _( "Open the symbol editor to edit the symbol" ),
libedit_xpm ); libedit_xpm );
@ -705,7 +705,7 @@ int SCH_EDITOR_CONTROL::FindReplace( const TOOL_EVENT& aEvent )
} }
int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::EditWithLibEdit( const TOOL_EVENT& aEvent )
{ {
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>(); EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::ComponentsOnly );
@ -830,7 +830,7 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::find.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::find.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::replace.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::replace.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editWithSymbolEditor.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::EditWithLibEdit, EE_ACTIONS::editWithLibEdit.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ShowSymbolEditor, EE_ACTIONS::showSymbolEditor.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ShowSymbolEditor, EE_ACTIONS::showSymbolEditor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ShowLibraryBrowser, EE_ACTIONS::showLibraryBrowser.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ShowLibraryBrowser, EE_ACTIONS::showLibraryBrowser.MakeEvent() );

View File

@ -83,7 +83,7 @@ public:
int FindReplace( const TOOL_EVENT& aEvent ); int FindReplace( const TOOL_EVENT& aEvent );
int EditWithSymbolEditor( const TOOL_EVENT& aEvent ); int EditWithLibEdit( const TOOL_EVENT& aEvent );
int ShowSymbolEditor( const TOOL_EVENT& aEvent ); int ShowSymbolEditor( const TOOL_EVENT& aEvent );
int ShowLibraryBrowser( const TOOL_EVENT& aEvent ); int ShowLibraryBrowser( const TOOL_EVENT& aEvent );