From 32dec0127e07aefefd49d7b7c0b305cac9782773 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 31 Dec 2021 23:43:13 +0000 Subject: [PATCH] Fix some issues with Eeschema's Shape Properties dialog. Fixes https://gitlab.com/kicad/code/kicad/issues/10140 --- eeschema/dialogs/dialog_shape_properties_base.cpp | 10 ++-------- eeschema/dialogs/dialog_shape_properties_base.fbp | 3 +-- eeschema/dialogs/dialog_shape_properties_base.h | 10 ---------- eeschema/tools/sch_edit_tool.cpp | 1 + 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/eeschema/dialogs/dialog_shape_properties_base.cpp b/eeschema/dialogs/dialog_shape_properties_base.cpp index 8be5815ad4..09b2748907 100644 --- a/eeschema/dialogs/dialog_shape_properties_base.cpp +++ b/eeschema/dialogs/dialog_shape_properties_base.cpp @@ -11,10 +11,6 @@ /////////////////////////////////////////////////////////////////////////// -BEGIN_EVENT_TABLE( DIALOG_SHAPE_PROPERTIES_BASE, DIALOG_SHIM ) - EVT_BUTTON( wxID_APPLY, DIALOG_SHAPE_PROPERTIES_BASE::_wxFB_resetDefaults ) -END_EVENT_TABLE() - DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -56,7 +52,7 @@ DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wx m_panel1->SetSizer( bSizer2 ); m_panel1->Layout(); bSizer2->Fit( m_panel1 ); - fgSizerGeneral->Add( m_panel1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); + fgSizerGeneral->Add( m_panel1, 0, wxALIGN_CENTER_VERTICAL, 2 ); fgSizerGeneral->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -106,7 +102,7 @@ DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wx m_panel11->SetSizer( bSizer21 ); m_panel11->Layout(); bSizer21->Fit( m_panel11 ); - fgSizerGeneral->Add( m_panel11, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + fgSizerGeneral->Add( m_panel11, 0, wxALIGN_CENTER_VERTICAL, 5 ); mainSizer->Add( fgSizerGeneral, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 10 ); @@ -125,8 +121,6 @@ DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wx m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); - m_sdbSizerApply = new wxButton( this, wxID_APPLY ); - m_sdbSizer->AddButton( m_sdbSizerApply ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); diff --git a/eeschema/dialogs/dialog_shape_properties_base.fbp b/eeschema/dialogs/dialog_shape_properties_base.fbp index 338358ec1e..25387da432 100644 --- a/eeschema/dialogs/dialog_shape_properties_base.fbp +++ b/eeschema/dialogs/dialog_shape_properties_base.fbp @@ -1079,7 +1079,7 @@ wxALL|wxALIGN_RIGHT 0 - 1 + 0 1 0 0 @@ -1090,7 +1090,6 @@ m_sdbSizer protected - resetDefaults diff --git a/eeschema/dialogs/dialog_shape_properties_base.h b/eeschema/dialogs/dialog_shape_properties_base.h index ae16b005e6..9bcfcc6576 100644 --- a/eeschema/dialogs/dialog_shape_properties_base.h +++ b/eeschema/dialogs/dialog_shape_properties_base.h @@ -35,13 +35,8 @@ class COLOR_SWATCH; /////////////////////////////////////////////////////////////////////////////// class DIALOG_SHAPE_PROPERTIES_BASE : public DIALOG_SHIM { - DECLARE_EVENT_TABLE() private: - // Private event handlers - void _wxFB_resetDefaults( wxCommandEvent& event ){ resetDefaults( event ); } - - protected: wxStaticText* m_lineWidthLabel; wxTextCtrl* m_lineWidthCtrl; @@ -60,13 +55,8 @@ class DIALOG_SHAPE_PROPERTIES_BASE : public DIALOG_SHIM wxStaticLine* m_staticline; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; - wxButton* m_sdbSizerApply; wxButton* m_sdbSizerCancel; - // Virtual event handlers, overide them in your derived class - virtual void resetDefaults( wxCommandEvent& event ) { event.Skip(); } - - public: DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("%s Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 51670f1267..96d29cb60f 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -255,6 +255,7 @@ bool SCH_EDIT_TOOL::Init() case SCH_HIER_LABEL_T: case SCH_NETCLASS_FLAG_T: case SCH_FIELD_T: + case SCH_SHAPE_T: case SCH_BITMAP_T: return aSel.GetSize() == 1;