Remove excess calls to SelectedItemsModified

We really don't want to post these events unless the *selected* items
were actually modified, since it results in a redraw of the properties
panel (which disturbs edit state and causes flicker on MSW).

Now the COMMIT system is responsible for sending this event iff the
commit touches items that are selected.

Side note: UpdateMsgPanel is useless on every app except pl_editor, so
it can probably be refactored/removed at some point.
This commit is contained in:
Jon Evans 2022-12-26 20:57:58 -05:00
parent 5eb3f5d3e7
commit ee0a41e3bc
7 changed files with 9 additions and 11 deletions

View File

@ -779,7 +779,6 @@ void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem )
void EDA_DRAW_FRAME::UpdateMsgPanel()
{
GetToolManager()->ProcessEvent( EVENTS::SelectedItemsModified );
}

View File

@ -171,6 +171,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
bool itemsDeselected = false;
bool solderMaskDirty = false;
bool autofillZones = false;
bool selectedModified = false;
if( Empty() )
return;
@ -244,6 +245,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
solderMaskDirty = true;
}
if( boardItem->IsSelected() )
selectedModified = true;
switch( changeType )
{
case CHT_ADD:
@ -570,6 +574,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
if( autofillZones )
m_toolMgr->RunAction( PCB_ACTIONS::zoneFillDirty );
if( selectedModified )
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
if( frame )
{
if( !( aCommitFlags & SKIP_SET_DIRTY ) )

View File

@ -407,8 +407,6 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
if( wasLocked != m_item->IsLocked() )
m_parent->GetToolManager()->PostEvent( EVENTS::SelectedEvent );
m_parent->UpdateMsgPanel();
return true;
}

View File

@ -677,9 +677,6 @@ void PCB_BASE_FRAME::ShowChangedLanguage()
// tooltips in toolbars
RecreateToolbars();
// status bar
UpdateMsgPanel();
}

View File

@ -758,7 +758,6 @@ void ROUTER_TOOL::updateSizesAfterLayerSwitch( PCB_LAYER_ID targetLayer )
}
m_router->UpdateSizes( sizes );
frame()->UpdateMsgPanel();
}

View File

@ -1243,7 +1243,6 @@ int BOARD_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode )
commit.Push( aMode == ON ? _( "Lock" ) : _( "Unlock" ) );
m_toolMgr->PostEvent( EVENTS::SelectedEvent );
m_frame->UpdateMsgPanel();
m_frame->OnModify();
}
@ -1524,7 +1523,8 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
if( dlg.ShowModal() == wxID_OK )
{
board()->SynchronizeNetsAndNetClasses( false );
m_frame->UpdateMsgPanel();
// Refresh UI that depends on netclasses, such as the properties panel
m_toolMgr->ProcessEvent( EVENTS::SelectedItemsModified );
}
return 0;

View File

@ -669,8 +669,6 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
m_editedPoint = nullptr;
frame()->UpdateMsgPanel();
return 0;
}