Fix missing AF_ACTIVATE flags on some tools.

Fixes: lp:1813659
* https://bugs.launchpad.net/kicad/+bug/1813659
This commit is contained in:
Jeff Young 2019-07-26 09:28:59 -06:00
parent 5f438b7a85
commit 815602d1af
14 changed files with 26 additions and 24 deletions

View File

@ -69,7 +69,7 @@ void LIB_EDIT_FRAME::ReCreateVToolbar()
KiScaledBitmap( export_xpm, this ),
_( "Export current drawing" ), wxITEM_CHECK );
m_drawToolBar->Add( EE_ACTIONS::deleteItemCursor, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Realize();
}
@ -194,6 +194,6 @@ void LIB_EDIT_FRAME::SyncToolbars()
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::drawSymbolCircle );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::drawSymbolArc );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::drawSymbolLines );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::deleteItemCursor );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::deleteTool );
m_drawToolBar->Refresh();
}

View File

@ -149,7 +149,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
editMenu->AddItem( ACTIONS::duplicate, EE_CONDITIONS::NotEmpty );
editMenu->AddSeparator();
editMenu->AddItem( EE_ACTIONS::deleteItemCursor, EE_CONDITIONS::ShowAlways );
editMenu->AddItem( EE_ACTIONS::deleteTool, EE_CONDITIONS::ShowAlways );
editMenu->AddSeparator();
editMenu->AddItem( ACTIONS::find, EE_CONDITIONS::ShowAlways );

View File

@ -114,7 +114,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
// Set up toolbar
m_drawToolBar->Add( ACTIONS::selectionTool, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::highlightNetCursor, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::highlightNetTool, ACTION_TOOLBAR::TOGGLE );
KiScaledSeparator( m_drawToolBar, this );
m_drawToolBar->Add( EE_ACTIONS::placeSymbol, ACTION_TOOLBAR::TOGGLE );
@ -136,7 +136,7 @@ void SCH_EDIT_FRAME::ReCreateVToolbar()
m_drawToolBar->Add( EE_ACTIONS::drawLines, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::placeSchematicText, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::placeImage, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::deleteItemCursor, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( EE_ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Realize();
}
@ -186,7 +186,7 @@ void SCH_EDIT_FRAME::SyncToolbars()
m_optionsToolBar->Refresh();
TOGGLE_TOOL( m_drawToolBar, ACTIONS::selectionTool );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::highlightNetCursor );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::highlightNetTool );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::placeSymbol );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::placePower );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::drawWire );
@ -204,6 +204,6 @@ void SCH_EDIT_FRAME::SyncToolbars()
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::drawLines );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::placeSchematicText );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::placeImage );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::deleteItemCursor );
TOGGLE_TOOL( m_drawToolBar, EE_ACTIONS::deleteTool );
m_drawToolBar->Refresh();
}

View File

@ -472,7 +472,7 @@ TOOL_ACTION EE_ACTIONS::pinTable( "eeschema.InteractiveEdit.pinTable",
_( "Pin Table..." ), _( "Displays pin table for bulk editing of pins" ),
pin_table_xpm );
TOOL_ACTION EE_ACTIONS::deleteItemCursor( "eeschema.InteractiveEdit.deleteTool",
TOOL_ACTION EE_ACTIONS::deleteTool( "eeschema.InteractiveEdit.deleteTool",
AS_GLOBAL, 0, "",
_( "Delete Tool" ), _( "Delete clicked items" ),
delete_xpm, AF_ACTIVATE );
@ -513,7 +513,7 @@ TOOL_ACTION EE_ACTIONS::clearHighlight( "eeschema.EditorControl.clearHighlight",
TOOL_ACTION EE_ACTIONS::updateNetHighlighting( "eeschema.EditorControl.updateNetHighlighting",
AS_GLOBAL );
TOOL_ACTION EE_ACTIONS::highlightNetCursor( "eeschema.EditorControl.highlightNetTool",
TOOL_ACTION EE_ACTIONS::highlightNetTool( "eeschema.EditorControl.highlightNetTool",
AS_GLOBAL, 0, "",
_( "Highlight Nets" ), _( "Highlight wires and pins of a net" ),
net_highlight_schematic_xpm, AF_ACTIVATE );

View File

@ -93,7 +93,7 @@ public:
static TOOL_ACTION placeSchematicText;
static TOOL_ACTION drawLines;
static TOOL_ACTION placeImage;
static TOOL_ACTION deleteItemCursor;
static TOOL_ACTION deleteTool;
static TOOL_ACTION finishLineWireOrBus;
static TOOL_ACTION finishWire;
static TOOL_ACTION finishBus;
@ -202,7 +202,7 @@ public:
static TOOL_ACTION highlightNet;
static TOOL_ACTION clearHighlight;
static TOOL_ACTION updateNetHighlighting;
static TOOL_ACTION highlightNetCursor;
static TOOL_ACTION highlightNetTool;
///> @copydoc COMMON_ACTIONS::TranslateLegacyId()
virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) override

View File

@ -743,7 +743,7 @@ void LIB_EDIT_TOOL::setTransitions()
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &LIB_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() );
Go( &LIB_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &LIB_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteTool.MakeEvent() );
Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() );
Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::symbolProperties.MakeEvent() );

View File

@ -1409,7 +1409,7 @@ void SCH_EDIT_TOOL::setTransitions()
Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() );
Go( &SCH_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() );
Go( &SCH_EDIT_TOOL::DoDelete, EE_ACTIONS::doDelete.MakeEvent() );
Go( &SCH_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &SCH_EDIT_TOOL::DeleteItemCursor, EE_ACTIONS::deleteTool.MakeEvent() );
Go( &SCH_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() );
Go( &SCH_EDIT_TOOL::EditField, EE_ACTIONS::editReference.MakeEvent() );

View File

@ -1154,7 +1154,7 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::HighlightNet, EE_ACTIONS::highlightNet.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ClearHighlight, EE_ACTIONS::clearHighlight.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::HighlightNetCursor, EE_ACTIONS::highlightNetCursor.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::HighlightNetCursor, EE_ACTIONS::highlightNetTool.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, EVENTS::SelectedItemsModified );
Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, EE_ACTIONS::updateNetHighlighting.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ClearHighlight, ACTIONS::cancelInteractive.MakeEvent() );

View File

@ -135,7 +135,7 @@ void PL_EDITOR_FRAME::ReCreateVToolbar()
m_drawToolBar->Add( PL_ACTIONS::appendImportedWorksheet, ACTION_TOOLBAR::TOGGLE );
KiScaledSeparator( m_drawToolBar, this );
m_drawToolBar->Add( PL_ACTIONS::deleteItemCursor, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Add( PL_ACTIONS::deleteTool, ACTION_TOOLBAR::TOGGLE );
m_drawToolBar->Realize();
}
@ -161,7 +161,7 @@ void PL_EDITOR_FRAME::SyncToolbars()
TOGGLE_TOOL( m_drawToolBar, PL_ACTIONS::drawRectangle );
TOGGLE_TOOL( m_drawToolBar, PL_ACTIONS::placeText );
TOGGLE_TOOL( m_drawToolBar, PL_ACTIONS::placeImage );
TOGGLE_TOOL( m_drawToolBar, PL_ACTIONS::deleteItemCursor );
TOGGLE_TOOL( m_drawToolBar, PL_ACTIONS::deleteTool );
m_drawToolBar->Toggle( PL_ACTIONS::appendImportedWorksheet, false ); // Not really a tool
m_drawToolBar->Refresh();

View File

@ -72,7 +72,7 @@ TOOL_ACTION PL_ACTIONS::appendImportedWorksheet( "plEditor.InteractiveEdit.appen
_( "Append an existing page layout design file to current file" ),
import_xpm, AF_ACTIVATE );
TOOL_ACTION PL_ACTIONS::deleteItemCursor( "plEditor.InteractiveEdit.deleteTool",
TOOL_ACTION PL_ACTIONS::deleteTool( "plEditor.InteractiveEdit.deleteTool",
AS_GLOBAL, 0, "",
_( "Delete Items" ), _( "Delete clicked items" ),
delete_xpm, AF_ACTIVATE );

View File

@ -70,7 +70,7 @@ public:
static TOOL_ACTION move;
// Miscellaneous
static TOOL_ACTION deleteItemCursor;
static TOOL_ACTION deleteTool;
static TOOL_ACTION refreshPreview;
static TOOL_ACTION toggleBackground;
static TOOL_ACTION showInspector;

View File

@ -500,7 +500,7 @@ void PL_EDIT_TOOL::setTransitions()
Go( &PL_EDIT_TOOL::Main, PL_ACTIONS::move.MakeEvent() );
Go( &PL_EDIT_TOOL::ImportWorksheetContent, PL_ACTIONS::appendImportedWorksheet.MakeEvent() );
Go( &PL_EDIT_TOOL::DeleteItemCursor, PL_ACTIONS::deleteItemCursor.MakeEvent() );
Go( &PL_EDIT_TOOL::DeleteItemCursor, PL_ACTIONS::deleteTool.MakeEvent() );
Go( &PL_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() );
Go( &PL_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() );

View File

@ -548,7 +548,7 @@ TOOL_ACTION PCB_ACTIONS::placeModule( "pcbnew.EditorControl.placeModule",
TOOL_ACTION PCB_ACTIONS::drillOrigin( "pcbnew.EditorControl.drillOrigin",
AS_GLOBAL, 0, "",
_( "Drill and Place Offset" ), _( "Place origin point for drill and place files" ),
pcb_offset_xpm );
pcb_offset_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::toggleLock( "pcbnew.EditorControl.toggleLock",
AS_GLOBAL,
@ -585,7 +585,7 @@ TOOL_ACTION PCB_ACTIONS::clearHighlight( "pcbnew.EditorControl.clearHighlight",
TOOL_ACTION PCB_ACTIONS::highlightNetTool( "pcbnew.EditorControl.highlightNetTool",
AS_GLOBAL, 0, "",
_( "Highlight Nets" ), _( "Highlight all copper items of a net" ),
net_highlight_xpm );
net_highlight_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::highlightNetSelection( "pcbnew.EditorControl.highlightNetSelection",
AS_GLOBAL,
@ -609,7 +609,7 @@ TOOL_ACTION PCB_ACTIONS::showEeschema( "pcbnew.EditorControl.showEeschema",
TOOL_ACTION PCB_ACTIONS::localRatsnestTool( "pcbnew.Control.localRatsnestTool",
AS_GLOBAL, 0, "",
_( "Highlight Ratsnest" ), _( "Show ratsnest of selected item(s)" ),
tool_ratsnest_xpm );
tool_ratsnest_xpm, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::hideDynamicRatsnest( "pcbnew.Control.hideDynamicRatsnest",
AS_GLOBAL );
@ -907,7 +907,7 @@ TOOL_ACTION PCB_ACTIONS::layerChanged( "pcbnew.Control.layerChanged",
TOOL_ACTION PCB_ACTIONS::deleteTool( "pcbnew.Control.deleteTool",
AS_GLOBAL, 0, "",
_( "Delete Items Tool" ), _( "Click on items to delete them" ),
delete_xpm );
delete_xpm, AF_ACTIVATE );
//Show board statistics tool
TOOL_ACTION PCB_ACTIONS::boardStatistics( "pcbnew.InspectionTool.ShowStatisticsDialog", AS_GLOBAL,

View File

@ -668,7 +668,8 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
if( reselect && module )
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module );
auto cleanup = [&] () {
auto cleanup = [&] ()
{
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
commit.Revert();
module = NULL;
@ -927,6 +928,7 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
}
}
preview.Clear();
delete target;
view->Remove( &preview );
controls->SetSnapping( false );