From 57c3e98f8c72c239de676ed11050e74d6b71ba4b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 3 Aug 2018 09:28:30 +0200 Subject: [PATCH] Fix a wxWidgets minor alert --- eeschema/dialogs/dialog_edit_label.cpp | 3 +- eeschema/dialogs/dialog_edit_label_base.cpp | 27 +- eeschema/dialogs/dialog_edit_label_base.fbp | 458 +++++++++++--------- eeschema/dialogs/dialog_edit_label_base.h | 3 +- 4 files changed, 283 insertions(+), 208 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_label.cpp b/eeschema/dialogs/dialog_edit_label.cpp index 6fa8be3787..f031057ef0 100644 --- a/eeschema/dialogs/dialog_edit_label.cpp +++ b/eeschema/dialogs/dialog_edit_label.cpp @@ -174,13 +174,14 @@ void DIALOG_LABEL_EDITOR::InitDialog() { m_textLabel = m_textLabelMultiLine; m_textLabelSingleLine->Show( false ); - m_textControlSizer->AddGrowableRow( 0 ); + m_staticTextLabel->Show( false ); multiLine = true; } else { m_textLabel = m_textLabelSingleLine; m_textLabelMultiLine->Show( false ); + m_staticTextText->Show( false ); wxTextValidator* validator = (wxTextValidator*) m_textLabel->GetValidator(); // Add invalid label characters to this list. diff --git a/eeschema/dialogs/dialog_edit_label_base.cpp b/eeschema/dialogs/dialog_edit_label_base.cpp index 28141e384a..7873ef43fb 100644 --- a/eeschema/dialogs/dialog_edit_label_base.cpp +++ b/eeschema/dialogs/dialog_edit_label_base.cpp @@ -16,32 +16,33 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - m_textControlSizer = new wxFlexGridSizer( 2, 2, 3, 3 ); + m_textControlSizer = new wxFlexGridSizer( 3, 2, 3, 3 ); m_textControlSizer->AddGrowableCol( 1 ); + m_textControlSizer->AddGrowableRow( 1 ); m_textControlSizer->SetFlexibleDirection( wxBOTH ); m_textControlSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticText1 = new wxStaticText( this, wxID_ANY, _("&Text:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - m_staticText1->SetToolTip( _("Enter the text to be used within the schematic") ); + m_staticTextLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLabel->Wrap( -1 ); + m_staticTextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); - m_textControlSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); - - wxBoxSizer* bSizeText; - bSizeText = new wxBoxSizer( wxVERTICAL ); + m_textControlSizer->Add( m_staticTextLabel, 0, wxRIGHT, 3 ); m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH ); m_textLabelSingleLine->SetValidator( wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, &m_labelText ) ); - bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 ); + m_textControlSizer->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 ); + + m_staticTextText = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextText->Wrap( -1 ); + m_staticTextText->SetToolTip( _("Enter the text to be used within the schematic") ); + + m_textControlSizer->Add( m_staticTextText, 0, wxRIGHT, 5 ); m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) ); - bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 ); - - - m_textControlSizer->Add( bSizeText, 1, wxEXPAND, 3 ); + m_textControlSizer->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 ); m_SizeTitle = new wxStaticText( this, wxID_ANY, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SizeTitle->Wrap( -1 ); diff --git a/eeschema/dialogs/dialog_edit_label_base.fbp b/eeschema/dialogs/dialog_edit_label_base.fbp index f362808cce..97f6a89374 100644 --- a/eeschema/dialogs/dialog_edit_label_base.fbp +++ b/eeschema/dialogs/dialog_edit_label_base.fbp @@ -102,17 +102,17 @@ 2 wxBOTH 1 - + 1 3 m_textControlSizer wxFLEX_GROWMODE_SPECIFIED protected - 2 + 3 3 3 - wxALIGN_CENTER_VERTICAL|wxRIGHT + wxRIGHT 0 1 @@ -142,7 +142,7 @@ 0 0 wxID_ANY - &Text: + Text: 0 @@ -150,7 +150,7 @@ 0 1 - m_staticText1 + m_staticTextLabel 1 @@ -195,195 +195,267 @@ 3 - wxEXPAND + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_VALUESINGLE + + 0 + + + + 0 + + 1 + m_textLabelSingleLine + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER|wxTE_RICH + + 0 + + wxString + wxFILTER_EXCLUDE_CHAR_LIST + wxTextValidator + m_labelText + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnEnterKey + + + + + + + 5 + wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text: + + 0 + + + 0 + + 1 + m_staticTextText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Enter the text to be used within the schematic + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + wxEXPAND|wxLEFT 1 - - -1,-1 - bSizeText - wxVERTICAL - none - - 3 - wxEXPAND|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_VALUESINGLE - - 0 - - - - 0 - - 1 - m_textLabelSingleLine - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER|wxTE_RICH - - 0 - - wxString - wxFILTER_EXCLUDE_CHAR_LIST - wxTextValidator - m_labelText - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnEnterKey - - - - - - - 3 - wxEXPAND|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_VALUEMULTI - - 0 - - - - 0 - -1,60 - 1 - m_textLabelMultiLine - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_MULTILINE - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_VALUEMULTI + + 0 + + + + 0 + -1,60 + 1 + m_textLabelMultiLine + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_MULTILINE + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_edit_label_base.h b/eeschema/dialogs/dialog_edit_label_base.h index 7308c8ab32..1e87e465e2 100644 --- a/eeschema/dialogs/dialog_edit_label_base.h +++ b/eeschema/dialogs/dialog_edit_label_base.h @@ -43,8 +43,9 @@ class DIALOG_LABEL_EDITOR_BASE : public DIALOG_SHIM }; wxFlexGridSizer* m_textControlSizer; - wxStaticText* m_staticText1; + wxStaticText* m_staticTextLabel; wxTextCtrl* m_textLabelSingleLine; + wxStaticText* m_staticTextText; wxTextCtrl* m_textLabelMultiLine; wxStaticText* m_SizeTitle; wxTextCtrl* m_TextSize;