From f13a546c9b39dfd5b1d9100c027ae4cf01490712 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 25 Jul 2018 20:26:55 +0200 Subject: [PATCH] Fix a few wxWidgets asserts or alerts. --- common/widgets/unit_binder.cpp | 8 +++++++- eeschema/dialogs/dialog_edit_label_base.cpp | 6 +++--- eeschema/dialogs/dialog_edit_label_base.fbp | 3 ++- eeschema/dialogs/dialog_edit_label_base.h | 6 ++++-- pcbnew/dialogs/dialog_copper_zones_base.cpp | 4 ++-- pcbnew/dialogs/dialog_copper_zones_base.fbp | 7 ++++--- pcbnew/dialogs/dialog_copper_zones_base.h | 2 +- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/common/widgets/unit_binder.cpp b/common/widgets/unit_binder.cpp index 1219801f1c..dcb01368af 100644 --- a/common/widgets/unit_binder.cpp +++ b/common/widgets/unit_binder.cpp @@ -58,7 +58,13 @@ UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent, m_value->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( UNIT_BINDER::onSetFocus ), NULL, this ); m_value->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( UNIT_BINDER::onKillFocus ), NULL, this ); - m_value->Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( UNIT_BINDER::onTextEnter ), NULL, this ); + + // Connext wxEVT_TEXT_ENTER when (and *only when*) m_value has the wxTE_PROCESS_ENTER style + // because: + // 1 - it is useless + // 2 - it generate wxWidgets assert + if( m_value->HasFlag( wxTE_PROCESS_ENTER ) ) + m_value->Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( UNIT_BINDER::onTextEnter ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_edit_label_base.cpp b/eeschema/dialogs/dialog_edit_label_base.cpp index a7d710b9ef..b1585627a2 100644 --- a/eeschema/dialogs/dialog_edit_label_base.cpp +++ b/eeschema/dialogs/dialog_edit_label_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "dialog_edit_label_base.h" @@ -63,7 +63,7 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL ); m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 3 ); + bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxEXPAND|wxLEFT|wxRIGHT, 3 ); m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 ); m_textSizeUnits->Wrap( -1 ); diff --git a/eeschema/dialogs/dialog_edit_label_base.fbp b/eeschema/dialogs/dialog_edit_label_base.fbp index 2005a25088..6e8bb77a3d 100644 --- a/eeschema/dialogs/dialog_edit_label_base.fbp +++ b/eeschema/dialogs/dialog_edit_label_base.fbp @@ -14,6 +14,7 @@ dialog_edit_label_base 1000 none + 1 dialog_edit_label_base @@ -727,7 +728,7 @@ none 3 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT + wxEXPAND|wxLEFT|wxRIGHT 0 1 diff --git a/eeschema/dialogs/dialog_edit_label_base.h b/eeschema/dialogs/dialog_edit_label_base.h index 93b111fdfe..719d6cecf3 100644 --- a/eeschema/dialogs/dialog_edit_label_base.h +++ b/eeschema/dialogs/dialog_edit_label_base.h @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Aug 4 2017) // http://www.wxformbuilder.org/ // -// PLEASE DO *NOT* EDIT THIS FILE! +// PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __DIALOG_EDIT_LABEL_BASE_H__ @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp index 0b631babd7..b9e19f65b3 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.cpp +++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jun 5 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -258,7 +258,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i bSizerbottom->Add( m_sdbSizer, 1, wxEXPAND|wxALL, 5 ); - m_MainBoxSizer->Add( bSizerbottom, 0, wxALIGN_RIGHT|wxEXPAND|wxLEFT, 5 ); + m_MainBoxSizer->Add( bSizerbottom, 0, wxEXPAND|wxLEFT, 5 ); this->SetSizer( m_MainBoxSizer ); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index e7c4836223..faff767eee 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -14,6 +14,7 @@ dialog_copper_zones_base 1000 none + 1 dialog_copper_zones_base @@ -3298,7 +3299,7 @@ 5 - wxALIGN_RIGHT|wxEXPAND|wxLEFT + wxEXPAND|wxLEFT 0 @@ -3393,11 +3394,11 @@ - + 5 wxEXPAND|wxALL 1 - + 0 1 0 diff --git a/pcbnew/dialogs/dialog_copper_zones_base.h b/pcbnew/dialogs/dialog_copper_zones_base.h index cf055e9b69..88e247046a 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.h +++ b/pcbnew/dialogs/dialog_copper_zones_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jun 5 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!