Browse Source

Ripout the old SyncToolbars infrastructure reminants

The tool framework no longer needs to request updates of the UI
state for the controls, wxWidgets will do it for us.
pull/16/head
Ian McInerney 5 years ago
parent
commit
4491f24d5e
  1. 3
      common/eda_draw_frame.cpp
  2. 5
      common/tool/tool_manager.cpp
  3. 3
      cvpcb/cvpcb_mainframe.cpp
  4. 2
      eeschema/lib_view_frame.cpp
  5. 1
      eeschema/libedit/libedit.cpp
  6. 8
      gerbview/gerbview_frame.cpp
  7. 6
      include/eda_base_frame.h
  8. 2
      kicad/kicad_manager_frame.cpp
  9. 1
      pcbnew/dialogs/dialog_drc.cpp
  10. 3
      pcbnew/pcb_base_edit_frame.cpp
  11. 3
      pcbnew/pcb_layer_widget.cpp
  12. 3
      pcbnew/tools/pcbnew_control.cpp
  13. 6
      pcbnew/widgets/appearance_controls.cpp

3
common/eda_draw_frame.cpp

@ -917,9 +917,6 @@ void EDA_DRAW_FRAME::RecreateToolbars()
if( m_auxiliaryToolBar ) // Additional tools under main toolbar
ReCreateAuxiliaryToolbar();
// Update the checked state of tools
SyncToolbars();
}

5
common/tool/tool_manager.cpp

@ -1150,10 +1150,5 @@ void TOOL_MANAGER::UpdateUI( const TOOL_EVENT& aEvent )
EDA_BASE_FRAME* frame = dynamic_cast<EDA_BASE_FRAME*>( GetToolHolder() );
if( frame )
{
frame->UpdateStatusBar();
if( !aEvent.IsMotion() && !aEvent.IsDrag() )
frame->SyncToolbars();
}
}

3
cvpcb/cvpcb_mainframe.cpp

@ -167,9 +167,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Start the main processing loop
m_toolManager->InvokeTool( "cvpcb.Control" );
// Ensure the toolbars are sync'd properly so the filtering options display correct
SyncToolbars();
SetShutdownBlockReason( _( "Symbol to footprint changes are unsaved" ) );
}

2
eeschema/lib_view_frame.cpp

@ -146,7 +146,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateMenuBar(); // Create after toolbars so that SyncToolbars works
ReCreateMenuBar();
m_libList = new wxListBox( this, ID_LIBVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_HSCROLL | wxNO_BORDER );

1
eeschema/libedit/libedit.cpp

@ -228,7 +228,6 @@ bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_PART* aEntry, const wxString& aL
updateTitle();
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurPart()->HasConversion() );
SyncToolbars();
// Display the document information based on the entry selected just in
// case the entry is an alias.

8
gerbview/gerbview_frame.cpp

@ -204,9 +204,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent )
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true );
// Update the checked state of tools
SyncToolbars();
// Ensure the window is on top
Raise();
}
@ -401,8 +398,6 @@ void GERBVIEW_FRAME::ReFillLayerWidget()
m_LayersManager->ReFill();
m_SelLayerBox->Resync();
ReCreateAuxiliaryToolbar();
// Update the checked state of tools
SyncToolbars();
wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_LayersManager );
wxSize bestz = m_LayersManager->GetBestSize();
@ -1131,9 +1126,6 @@ void GERBVIEW_FRAME::ActivateGalCanvas()
ReCreateOptToolbar();
ReCreateMenuBar();
// Update the checked state of tools
SyncToolbars();
}

6
include/eda_base_frame.h

@ -528,12 +528,6 @@ public:
*/
virtual void UpdateStatusBar() { }
/**
* Update the toolbars (mostly settings/check buttons/checkboxes) with the current
* controller state.
*/
virtual void SyncToolbars() { };
/**
* Redraw the menus and what not in current language.
*/

2
kicad/kicad_manager_frame.cpp

@ -421,8 +421,6 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName )
m_leftWin->ReCreateTreePrj();
SyncToolbars();
// Rebuild the list of watched paths.
// however this is possible only when the main loop event handler is running,
// so we use it to run the rebuild function.

1
pcbnew/dialogs/dialog_drc.cpp

@ -450,7 +450,6 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
updateDisplayedCounts();
refreshBoardEditor();
m_brdEditor->OnModify();
m_brdEditor->SyncToolbars();
}
}

3
pcbnew/pcb_base_edit_frame.cpp

@ -139,9 +139,6 @@ void PCB_BASE_EDIT_FRAME::SetGridVisibility( bool aVisible )
// Update the grid checkbox in the layer widget
if( m_appearancePanel )
m_appearancePanel->SetObjectVisible( LAYER_GRID, aVisible );
// TODO (ISM): Remove this by changing toolbars to use the EVT_UPDATE_UI to get the state
SyncToolbars();
}

3
pcbnew/pcb_layer_widget.cpp

@ -697,9 +697,6 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
PCB_DISPLAY_OPTIONS opt = myframe->GetDisplayOptions();
opt.m_ShowGlobalRatsnest = isEnabled;
myframe->SetDisplayOptions( opt );
// TODO(ISM): Remove once EVT_UPDATE_UI works
myframe->SyncToolbars();
}
}
else if( aId != LAYER_GRID )

3
pcbnew/tools/pcbnew_control.cpp

@ -244,9 +244,6 @@ int PCBNEW_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent )
m_frame->SetDisplayOptions( opts );
// TODO(ISM): remove once EVT_UPDATE_UI works
m_frame->SyncToolbars();
return 0;
}

6
pcbnew/widgets/appearance_controls.cpp

@ -127,9 +127,6 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_frame->SetDisplayOptions( opts );
m_frame->GetCanvas()->SetHighContrastLayer( m_frame->GetActiveLayer() );
m_frame->GetCanvas()->Refresh();
// TODO: remove once EVT_UPDATE_UI works
m_frame->SyncToolbars();
};
m_rbHighContrastNormal->Bind( wxEVT_RADIOBUTTON,
@ -937,9 +934,6 @@ void APPEARANCE_CONTROLS::onObjectVisibilityChanged( GAL_LAYER_ID aLayer, bool i
PCB_DISPLAY_OPTIONS opt = m_frame->GetDisplayOptions();
opt.m_ShowGlobalRatsnest = isVisible;
m_frame->SetDisplayOptions( opt );
// TODO(ISM): Remove once EVT_UPDATE_UI works
m_frame->SyncToolbars();
}
break;

Loading…
Cancel
Save