Update grid drop-down when changing user grid.

This commit is contained in:
Jeff Young 2018-11-23 23:33:02 +00:00
parent f05b756ccf
commit 647fa6547d
7 changed files with 10 additions and 7 deletions

View File

@ -307,7 +307,7 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
// Grid selection choice box. // Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL ); wxDefaultPosition, wxDefaultSize, 0, NULL );
updateGridSelectBox(); UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox ); m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this ); KiScaledSeparator( m_mainToolBar, this );

View File

@ -79,7 +79,6 @@ protected:
PCB_GENERAL_SETTINGS m_configSettings; PCB_GENERAL_SETTINGS m_configSettings;
void updateGridSelectBox();
void updateZoomSelectBox(); void updateZoomSelectBox();
virtual void unitsChangeRefresh() override; virtual void unitsChangeRefresh() override;
@ -206,6 +205,8 @@ public:
PCB_SCREEN* GetScreen() const override { return (PCB_SCREEN*) EDA_DRAW_FRAME::GetScreen(); } PCB_SCREEN* GetScreen() const override { return (PCB_SCREEN*) EDA_DRAW_FRAME::GetScreen(); }
void UpdateGridSelectBox();
/** /**
* Function BestZoom * Function BestZoom
* @return the "best" zoom to show the entire board or footprint on the screen. * @return the "best" zoom to show the entire board or footprint on the screen.

View File

@ -137,6 +137,8 @@ bool DIALOG_SET_GRID::TransferDataFromWindow()
mgr->ProcessEvent( gridOriginUpdate ); mgr->ProcessEvent( gridOriginUpdate );
} }
m_parent->UpdateGridSelectBox();
return wxDialog::TransferDataFromWindow(); return wxDialog::TransferDataFromWindow();
} }

View File

@ -914,7 +914,7 @@ void PCB_BASE_FRAME::unitsChangeRefresh()
{ {
EDA_DRAW_FRAME::unitsChangeRefresh(); // Update the status bar. EDA_DRAW_FRAME::unitsChangeRefresh(); // Update the status bar.
updateGridSelectBox(); UpdateGridSelectBox();
} }
@ -1012,7 +1012,7 @@ const wxString PCB_BASE_FRAME::GetZoomLevelIndicator() const
} }
void PCB_BASE_FRAME::updateGridSelectBox() void PCB_BASE_FRAME::UpdateGridSelectBox()
{ {
UpdateStatusBar(); UpdateStatusBar();
DisplayUnitsMsg(); DisplayUnitsMsg();

View File

@ -117,7 +117,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
// Grid selection choice box. // Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL ); wxDefaultPosition, wxDefaultSize, 0, NULL );
updateGridSelectBox(); UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox ); m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this ); KiScaledSeparator( m_mainToolBar, this );

View File

@ -104,7 +104,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar()
// Grid selection choice box. // Grid selection choice box.
m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT, m_gridSelectBox = new wxChoice( m_mainToolBar, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, 0, NULL ); wxDefaultPosition, wxDefaultSize, 0, NULL );
updateGridSelectBox(); UpdateGridSelectBox();
m_mainToolBar->AddControl( m_gridSelectBox ); m_mainToolBar->AddControl( m_gridSelectBox );
KiScaledSeparator( m_mainToolBar, this ); KiScaledSeparator( m_mainToolBar, this );

View File

@ -613,7 +613,7 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
ID_ON_GRID_SELECT, ID_ON_GRID_SELECT,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
0, NULL ); 0, NULL );
updateGridSelectBox(); UpdateGridSelectBox();
m_auxiliaryToolBar->AddControl( m_gridSelectBox ); m_auxiliaryToolBar->AddControl( m_gridSelectBox );
// Add the box to display and select the current Zoom // Add the box to display and select the current Zoom