From 18c8f50b1d097743201c25f14d2deab320e4dea6 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 29 Apr 2016 13:37:36 -0400 Subject: [PATCH] Component library editor field properties dialog improvements. * Remove fixed dialog size setting to allow sizers to do thier job. * General spacing and layout improvements. --- ...ialog_edit_libentry_fields_in_lib_base.cpp | 39 +++++++++---------- ...ialog_edit_libentry_fields_in_lib_base.fbp | 38 +++++++++--------- .../dialog_edit_libentry_fields_in_lib_base.h | 4 +- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.cpp index fe6c5332d7..8bdc8b5cd3 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 28 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -23,9 +23,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE bSizerFiledsList = new wxBoxSizer( wxVERTICAL ); fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); - fieldListCtrl->SetMinSize( wxSize( 220,-1 ) ); - - bSizerFiledsList->Add( fieldListCtrl, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 8 ); + bSizerFiledsList->Add( fieldListCtrl, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 6 ); addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 ); addFieldButton->SetToolTip( _("Add a new custom field") ); @@ -68,7 +66,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE bSizerJustify->Add( m_FieldVJustifyCtrl, 1, wxEXPAND|wxALL, 5 ); - fieldEditBoxSizer->Add( bSizerJustify, 1, wxEXPAND|wxBOTTOM, 5 ); + fieldEditBoxSizer->Add( bSizerJustify, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizerAspect; bSizerAspect = new wxBoxSizer( wxHORIZONTAL ); @@ -76,12 +74,12 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE wxStaticBoxSizer* visibilitySizer; visibilitySizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Visibility") ), wxVERTICAL ); - showCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 ); + showCheckBox = new wxCheckBox( this, wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 ); showCheckBox->SetToolTip( _("Check if you want this field visible") ); visibilitySizer->Add( showCheckBox, 0, wxALL, 5 ); - rotateCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 ); + rotateCheckBox = new wxCheckBox( this, wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 ); rotateCheckBox->SetToolTip( _("Check if you want this field's text rotated 90 degrees") ); visibilitySizer->Add( rotateCheckBox, 0, wxALL, 5 ); @@ -96,7 +94,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE bSizerAspect->Add( m_StyleRadioBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - fieldEditBoxSizer->Add( bSizerAspect, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + fieldEditBoxSizer->Add( bSizerAspect, 1, wxALL|wxEXPAND|wxTOP, 5 ); wxBoxSizer* fieldNameBoxSizer; fieldNameBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -124,13 +122,13 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE m_show_datasheet_button = new wxButton( this, wxID_ANY, _("Show in Browser"), wxDefaultPosition, wxDefaultSize, 0 ); m_show_datasheet_button->SetToolTip( _("If your datasheet is given as an http:// link, then pressing this button should bring it up in your webbrowser.") ); - fieldNameBoxSizer->Add( m_show_datasheet_button, 0, wxBOTTOM|wxEXPAND, 5 ); + fieldNameBoxSizer->Add( m_show_datasheet_button, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxALL|wxEXPAND, 5 ); wxFlexGridSizer* fgSizerPosSize; - fgSizerPosSize = new wxFlexGridSizer( 3, 3, 0, 0 ); + fgSizerPosSize = new wxFlexGridSizer( 3, 3, 5, 5 ); fgSizerPosSize->AddGrowableCol( 1 ); fgSizerPosSize->SetFlexibleDirection( wxBOTH ); fgSizerPosSize->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -143,25 +141,25 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE textSizeTextCtrl->SetMaxLength( 0 ); textSizeTextCtrl->SetToolTip( _("The vertical height of the currently selected field's text in the schematic") ); - fgSizerPosSize->Add( textSizeTextCtrl, 0, wxEXPAND|wxBOTTOM, 5 ); + fgSizerPosSize->Add( textSizeTextCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_staticTextUnitSize = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitSize->Wrap( -1 ); - fgSizerPosSize->Add( m_staticTextUnitSize, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerPosSize->Add( m_staticTextUnitSize, 0, wxALIGN_CENTER_VERTICAL, 5 ); - posXLabel = new wxStaticText( this, wxID_ANY, _("PosX"), wxDefaultPosition, wxDefaultSize, 0 ); + posXLabel = new wxStaticText( this, wxID_ANY, _("X Position"), wxDefaultPosition, wxDefaultSize, 0 ); posXLabel->Wrap( -1 ); fgSizerPosSize->Add( posXLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); posXTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); posXTextCtrl->SetMaxLength( 0 ); - fgSizerPosSize->Add( posXTextCtrl, 0, wxEXPAND|wxTOP, 5 ); + fgSizerPosSize->Add( posXTextCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_staticTextUnitPosX = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitPosX->Wrap( -1 ); - fgSizerPosSize->Add( m_staticTextUnitPosX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerPosSize->Add( m_staticTextUnitPosX, 0, wxALIGN_CENTER_VERTICAL, 5 ); - posYLabel = new wxStaticText( this, wxID_ANY, _("PosY"), wxDefaultPosition, wxDefaultSize, 0 ); + posYLabel = new wxStaticText( this, wxID_ANY, _("Y Position"), wxDefaultPosition, wxDefaultSize, 0 ); posYLabel->Wrap( -1 ); fgSizerPosSize->Add( posYLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -169,14 +167,14 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE posYTextCtrl->SetMaxLength( 0 ); posYTextCtrl->SetToolTip( _("The Y coordinate of the text relative to the component") ); - fgSizerPosSize->Add( posYTextCtrl, 0, wxEXPAND, 5 ); + fgSizerPosSize->Add( posYTextCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_staticTextUnitPosY = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitPosY->Wrap( -1 ); - fgSizerPosSize->Add( m_staticTextUnitPosY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizerPosSize->Add( m_staticTextUnitPosY, 0, wxALIGN_CENTER_VERTICAL, 5 ); - fieldEditBoxSizer->Add( fgSizerPosSize, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + fieldEditBoxSizer->Add( fgSizerPosSize, 1, wxALL|wxEXPAND, 5 ); bSizerFieldsSetup->Add( fieldEditBoxSizer, 2, wxEXPAND, 5 ); @@ -194,11 +192,12 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE stdDialogButtonSizer->AddButton( stdDialogButtonSizerCancel ); stdDialogButtonSizer->Realize(); - mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 8 ); + mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 6 ); this->SetSizer( mainSizer ); this->Layout(); + mainSizer->Fit( this ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::OnCloseDialog ) ); diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp index 4eb010eb50..42a647e78a 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp @@ -44,7 +44,7 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE - 542,529 + -1,-1 wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Field Properties @@ -106,13 +106,13 @@ 5 wxEXPAND 3 - + bSizerFiledsList wxVERTICAL none - 8 + 6 wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 @@ -148,7 +148,7 @@ 0 - 220,-1 + -1,-1 1 fieldListCtrl 1 @@ -493,7 +493,7 @@ none 5 - wxEXPAND|wxBOTTOM + wxALL|wxEXPAND 1 @@ -684,7 +684,7 @@ 5 - wxEXPAND|wxTOP|wxBOTTOM + wxALL|wxEXPAND|wxTOP 1 @@ -1332,7 +1332,7 @@ 5 - wxBOTTOM|wxEXPAND + wxBOTTOM|wxEXPAND|wxTOP 0 1 @@ -1422,20 +1422,20 @@ 5 - wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + wxALL|wxEXPAND 1 3 wxBOTH 1 - 0 + 5 fgSizerPosSize wxFLEX_GROWMODE_SPECIFIED none 3 - 0 + 5 5 wxALIGN_CENTER_VERTICAL @@ -1521,7 +1521,7 @@ 5 - wxEXPAND|wxBOTTOM + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -1612,7 +1612,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 @@ -1725,7 +1725,7 @@ 0 0 wxID_ANY - PosX + X Position 0 @@ -1778,7 +1778,7 @@ 5 - wxEXPAND|wxTOP + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -1869,7 +1869,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 @@ -1982,7 +1982,7 @@ 0 0 wxID_ANY - PosY + Y Position 0 @@ -2035,7 +2035,7 @@ 5 - wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND 0 1 @@ -2126,7 +2126,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL 0 1 @@ -2295,7 +2295,7 @@ - 8 + 6 wxALL|wxEXPAND 0 diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.h b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.h index 1954c4c103..002e727903 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.h +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 28 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -84,7 +84,7 @@ class DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE : public DIALOG_SHIM public: - DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Field Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 542,529 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); + DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Field Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); ~DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE(); };