pcbnew: Force resize event when changing pad type

The local settings panel needs to have its children sized when shown.
Triggering a resize event on changing the pad shape accomplishes this.
This is not triggered in master due to refactor of the custom pad
connection options.

Fixes: lp:1837789
* https://bugs.launchpad.net/kicad/+bug/1837789
This commit is contained in:
Seth Hillbrand 2019-08-27 05:52:21 -07:00
parent 80e0d848f2
commit fe71a66bb9
4 changed files with 587 additions and 4662 deletions

View File

@ -940,20 +940,13 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
m_staticTextCornerSizeRatioUnit->Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT ); m_staticTextCornerSizeRatioUnit->Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT );
m_cornerRadius.Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT ); m_cornerRadius.Enable( m_PadShape->GetSelection() == CHOICE_SHAPE_ROUNDRECT );
// PAD_SHAPE_CUSTOM type has constraints for zone connection and thermal shape:
// only not connected or solid connection is allowed to avoid destroying the shape.
// Enable/disable options only available for custom shaped pads
m_ZoneConnectionChoice->Enable( !is_custom );
m_ZoneConnectionCustom->Enable( is_custom );
m_spokeWidth.Enable( !is_custom );
m_thermalGap.Enable( !is_custom );
m_sbSizerZonesSettings->Show( !is_custom ); m_sbSizerZonesSettings->Show( !is_custom );
m_sbSizerCustomShapedZonesSettings->Show( is_custom ); m_sbSizerCustomShapedZonesSettings->Show( is_custom );
transferDataToPad( m_dummyPad ); transferDataToPad( m_dummyPad );
updateRoundRectCornerValues(); updateRoundRectCornerValues();
m_localSettingsPanel->SetSize( m_localSettingsPanel->GetEffectiveMinSize() );
redraw(); redraw();
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,19 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017) // C++ code generated with wxFormBuilder (version Apr 23 2019)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_PAD_PROPERTIES_BASE_H__ #pragma once
#define __DIALOG_PAD_PROPERTIES_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
class TEXT_CTRL_EVAL; class TEXT_CTRL_EVAL;
class WX_GRID; class WX_GRID;
class wxListView;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
@ -53,20 +54,20 @@ class WX_GRID;
class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
enum enum
{ {
wxID_DIALOG_EDIT_PAD = 1000, wxID_DIALOG_EDIT_PAD = 1000,
wxID_PADNUMCTRL wxID_PADNUMCTRL
}; };
wxNotebook* m_notebook; wxNotebook* m_notebook;
wxPanel* m_panelGeneral; wxPanel* m_panelGeneral;
wxStaticText* m_PadNumText; wxStaticText* m_PadNumText;
wxTextCtrl* m_PadNumCtrl; wxTextCtrl* m_PadNumCtrl;
wxStaticText* m_PadNameText; wxStaticText* m_PadNameText;
NET_SELECTOR* m_PadNetSelector; NET_SELECTOR* m_PadNetSelector;
wxStaticText* m_staticText44; wxStaticText* m_staticText44;
wxChoice* m_PadType; wxChoice* m_PadType;
wxStaticText* m_staticText45; wxStaticText* m_staticText45;
@ -185,7 +186,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }
@ -208,13 +209,13 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); } virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); }
virtual void onChangePadMode( wxCommandEvent& event ) { event.Skip(); } virtual void onChangePadMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAD_PROPERTIES_BASE(); ~DIALOG_PAD_PROPERTIES_BASE();
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -223,7 +224,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
wxStaticText* m_staticTextPosStart; wxStaticText* m_staticTextPosStart;
wxStaticText* m_startXLabel; wxStaticText* m_startXLabel;
@ -250,12 +251,12 @@ class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
public: public:
DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE(); ~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE();
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -264,7 +265,7 @@ class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM
class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
wxStaticText* m_staticTextMove; wxStaticText* m_staticTextMove;
wxStaticText* m_xLabel; wxStaticText* m_xLabel;
@ -284,12 +285,12 @@ class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
public: public:
DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad Custom Shape Geometry Transform"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad Custom Shape Geometry Transform"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE(); ~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE();
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -298,7 +299,7 @@ class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM
class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
WX_GRID* m_gridCornersList; WX_GRID* m_gridCornersList;
wxBitmapButton* m_addButton; wxBitmapButton* m_addButton;
@ -315,7 +316,7 @@ class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void onGridSelect( wxGridRangeSelectEvent& event ) { event.Skip(); } virtual void onGridSelect( wxGridRangeSelectEvent& event ) { event.Skip(); }
virtual void onCellSelect( wxGridEvent& event ) { event.Skip(); } virtual void onCellSelect( wxGridEvent& event ) { event.Skip(); }
@ -323,13 +324,12 @@ class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM
virtual void OnButtonDelete( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonDelete( wxCommandEvent& event ) { event.Skip(); }
virtual void onPaintPolyPanel( wxPaintEvent& event ) { event.Skip(); } virtual void onPaintPolyPanel( wxPaintEvent& event ) { event.Skip(); }
virtual void onPolyPanelResize( wxSizeEvent& event ) { event.Skip(); } virtual void onPolyPanelResize( wxSizeEvent& event ) { event.Skip(); }
public: public:
DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Basic Shape Polygon"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Basic Shape Polygon"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE(); ~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE();
}; };
#endif //__DIALOG_PAD_PROPERTIES_BASE_H__