DIALOG_ZONE_MANAGER: refresh zone display when resizing the dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17892
This commit is contained in:
jean-pierre charras 2024-04-29 13:44:09 +02:00
parent e5a17b96a3
commit 15e5eabb91
5 changed files with 14 additions and 2 deletions

View File

@ -226,6 +226,13 @@ int InvokeZonesManager( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aZoneInfo )
} }
void DIALOG_ZONE_MANAGER::onDialogResize( wxSizeEvent& event )
{
event.Skip();
FitCanvasToScreen();
}
void DIALOG_ZONE_MANAGER::OnZoneSelectionChanged( ZONE* zone ) void DIALOG_ZONE_MANAGER::OnZoneSelectionChanged( ZONE* zone )
{ {
for( ZONE_SELECTION_CHANGE_NOTIFIER* i : for( ZONE_SELECTION_CHANGE_NOTIFIER* i :

View File

@ -74,6 +74,7 @@ protected:
void SelectZoneTableItem( wxDataViewItem const& aItem ); void SelectZoneTableItem( wxDataViewItem const& aItem );
void OnViewZonesOverviewOnLeftUp( wxMouseEvent& aEvent ) override; void OnViewZonesOverviewOnLeftUp( wxMouseEvent& aEvent ) override;
void onDialogResize( wxSizeEvent& event ) override;
void OnOk( wxCommandEvent& aEvt ); void OnOk( wxCommandEvent& aEvt );

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -104,6 +104,7 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID
m_MainBoxSizer->Fit( this ); m_MainBoxSizer->Fit( this );
// Connect Events // Connect Events
this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_ZONE_MANAGER_BASE::onDialogResize ) );
m_viewZonesOverview->Connect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this );
m_viewZonesOverview->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this );
m_viewZonesOverview->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this );
@ -119,6 +120,7 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID
DIALOG_ZONE_MANAGER_BASE::~DIALOG_ZONE_MANAGER_BASE() DIALOG_ZONE_MANAGER_BASE::~DIALOG_ZONE_MANAGER_BASE()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_ZONE_MANAGER_BASE::onDialogResize ) );
m_viewZonesOverview->Disconnect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this );
m_viewZonesOverview->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this );
m_viewZonesOverview->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this );

View File

@ -57,6 +57,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnSize">onDialogResize</event>
<object class="wxBoxSizer" expanded="true"> <object class="wxBoxSizer" expanded="true">
<property name="minimum_size">-1,-1</property> <property name="minimum_size">-1,-1</property>
<property name="name">m_MainBoxSizer</property> <property name="name">m_MainBoxSizer</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) // C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -62,6 +62,7 @@ class DIALOG_ZONE_MANAGER_BASE : public DIALOG_SHIM
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
// Virtual event handlers, override them in your derived class // Virtual event handlers, override them in your derived class
virtual void onDialogResize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnTableChar( wxKeyEvent& event ) { event.Skip(); } virtual void OnTableChar( wxKeyEvent& event ) { event.Skip(); }
virtual void OnTableCharHook( wxKeyEvent& event ) { event.Skip(); } virtual void OnTableCharHook( wxKeyEvent& event ) { event.Skip(); }
virtual void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) { event.Skip(); } virtual void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) { event.Skip(); }