From 8145a8c067e18a6307951bf5135df156d253d73b Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Fri, 7 Mar 2014 17:52:43 +0000 Subject: [PATCH 1/8] Changes --- eeschema/dialogs/dialog_eeschema_options.cpp | 119 +-- eeschema/dialogs/dialog_eeschema_options.h | 13 +- .../dialogs/dialog_eeschema_options_base.cpp | 156 +-- .../dialogs/dialog_eeschema_options_base.fbp | 971 +++++------------- .../dialogs/dialog_eeschema_options_base.h | 32 +- eeschema/eeschema_config.cpp | 9 +- 6 files changed, 357 insertions(+), 943 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 14424143c6..3dce163983 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -37,6 +37,25 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : { m_choiceUnits->SetFocus(); m_sdbSizer1OK->SetDefault(); + + wxListItem col0; + col0.SetId( 0 ); + col0.SetText( _( "ID" ) ); + col0.SetWidth( 50 ); + + wxListItem col1; + col1.SetId( 1 ); + col1.SetText( _( "Name" ) ); + col1.SetWidth( 150 ); + + wxListItem col2; + col2.SetId( 2 ); + col2.SetText( _( "Default Value" ) ); + col2.SetWidth( 250 ); + + templateFieldListCtrl->InsertColumn( 0, col0 ); + templateFieldListCtrl->InsertColumn( 1, col1 ); + templateFieldListCtrl->InsertColumn( 2, col2 ); } @@ -120,88 +139,32 @@ void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id m_choiceGridSize->SetSelection( select ); } -void DIALOG_EESCHEMA_OPTIONS::SetFieldName( int aNdx, wxString aName ) + +void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) { - switch( aNdx ) + long itemindex = templateFieldListCtrl->InsertItem( 0, wxT( "ID" ) ); + templateFieldListCtrl->SetItem( itemindex, 1, wxT( "Next Fieldname" ) ); + templateFieldListCtrl->SetItem( itemindex, 2, wxT( "A Default value" ) ); + + event.Skip(); +} + + +void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ) +{ + printf( "SetTemplateFields %d\n", aFields.size() ); + + for( size_t i = 0; i < aFields.size(); i++ ) { - case 0: - m_fieldName1->SetValue( aName ); - break; - - case 1: - m_fieldName2->SetValue( aName ); - break; - - case 2: - m_fieldName3->SetValue( aName ); - break; - - case 3: - m_fieldName4->SetValue( aName ); - break; - - case 4: - m_fieldName5->SetValue( aName ); - break; - - case 5: - m_fieldName6->SetValue( aName ); - break; - - case 6: - m_fieldName7->SetValue( aName ); - break; - - case 7: - m_fieldName8->SetValue( aName ); - break; - - default: - break; + long itemindex = templateFieldListCtrl->InsertItem( 0, wxT( "?" ) ); + templateFieldListCtrl->SetItem( itemindex, 1, aFields[i].m_Name ); + templateFieldListCtrl->SetItem( itemindex, 2, aFields[i].m_Value ); } } -wxString DIALOG_EESCHEMA_OPTIONS::GetFieldName( int aNdx ) + +TEMPLATE_FIELDNAMES* DIALOG_EESCHEMA_OPTIONS::GetTemplateFields( void ) { - wxString nme; - - switch ( aNdx ) - { - case 0: - nme = m_fieldName1->GetValue(); - break; - - case 1: - nme = m_fieldName2->GetValue(); - break; - - case 2: - nme = m_fieldName3->GetValue(); - break; - - case 3: - nme = m_fieldName4->GetValue(); - break; - - case 4: - nme = m_fieldName5->GetValue(); - break; - - case 5: - nme = m_fieldName6->GetValue(); - break; - - case 6: - nme = m_fieldName7->GetValue(); - break; - - case 7: - nme = m_fieldName8->GetValue(); - break; - - default: - break; - } - - return nme; + return &templateFields; } + diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index 01ce909728..1eaca0ec0a 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -32,9 +32,15 @@ #define __dialog_eeschema_options__ #include +#include class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE { +protected: + TEMPLATE_FIELDNAMES templateFields; + + void OnAddButtonClick( wxCommandEvent& event ); + public: DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ); @@ -121,11 +127,8 @@ public: void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); } bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); } - /** Set the field \a aNdx textctrl to \a aName */ - void SetFieldName( int aNdx, wxString aName ); - - /** Get the field \a aNdx name from the fields textctrl */ - wxString GetFieldName( int aNdx ); + void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ); + TEMPLATE_FIELDNAMES* GetTemplateFields( void ); private: void OnMiddleBtnPanEnbl( wxCommandEvent& event ) diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index ce75352bda..39b271f70b 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -12,6 +12,8 @@ BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM ) EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits ) EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl ) + EVT_BUTTON( wxID_ADD_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnAddButtonClick ) + EVT_BUTTON( wxID_DELETE_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnDeleteButtonClick ) END_EVENT_TABLE() DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) @@ -212,153 +214,16 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx wxBoxSizer* bSizer6; bSizer6 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer8; - bSizer8 = new wxBoxSizer( wxVERTICAL ); - - m_staticText211 = new wxStaticText( m_panel2, wxID_ANY, _("Please enter fieldnames which you want presented in the component fieldname (property) editors. Names may not include (, ), or \" characters."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText211->Wrap( 400 ); - bSizer8->Add( m_staticText211, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - - bSizer6->Add( bSizer8, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer7; - bSizer7 = new wxBoxSizer( wxVERTICAL ); - - wxFlexGridSizer* fgSizer2; - fgSizer2 = new wxFlexGridSizer( 8, 2, 0, 0 ); - fgSizer2->AddGrowableCol( 1 ); - fgSizer2->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText15 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 1"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText15->Wrap( -1 ); - fgSizer2->Add( m_staticText15, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName1 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName1->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName1, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText161 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 2"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText161->Wrap( -1 ); - fgSizer2->Add( m_staticText161, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName2 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName2->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName2, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText17 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 3"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText17->Wrap( -1 ); - fgSizer2->Add( m_staticText17, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName3 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName3->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName3, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText18 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 4"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText18->Wrap( -1 ); - fgSizer2->Add( m_staticText18, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName4 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName4->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName4, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText19 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 5"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText19->Wrap( -1 ); - fgSizer2->Add( m_staticText19, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName5 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName5->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName5, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText20 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 6"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText20->Wrap( -1 ); - fgSizer2->Add( m_staticText20, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName6 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName6->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName6, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText21 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 7"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - fgSizer2->Add( m_staticText21, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName7 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName7->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName7, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - m_staticText22 = new wxStaticText( m_panel2, wxID_ANY, _("Custom field 8"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText22->Wrap( -1 ); - fgSizer2->Add( m_staticText22, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 3 ); - - m_fieldName8 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldName8->SetMaxLength( 0 ); - fgSizer2->Add( m_fieldName8, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - - bSizer7->Add( fgSizer2, 1, wxALIGN_CENTER|wxEXPAND, 5 ); - - - bSizer6->Add( bSizer7, 1, wxALL|wxEXPAND, 12 ); - - wxBoxSizer* bSizer9; - bSizer9 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer10; - bSizer10 = new wxBoxSizer( wxVERTICAL ); - - templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); + templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); templateFieldListCtrl->SetMinSize( wxSize( 220,-1 ) ); - bSizer10->Add( templateFieldListCtrl, 0, wxALL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); + bSizer6->Add( templateFieldListCtrl, 1, wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); - addFieldButton = new wxButton( m_panel2, wxID_ANY, _("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer10->Add( addFieldButton, 0, wxALL, 5 ); + addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer6->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 ); - deleteFieldButton = new wxButton( m_panel2, wxID_ANY, _("MyButton"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer10->Add( deleteFieldButton, 0, wxALL, 5 ); - - - bSizer9->Add( bSizer10, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer11; - bSizer11 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer12; - bSizer12 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText27 = new wxStaticText( m_panel2, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText27->Wrap( -1 ); - bSizer12->Add( m_staticText27, 0, wxALL, 5 ); - - fieldName = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fieldName->SetMinSize( wxSize( 220,-1 ) ); - - bSizer12->Add( fieldName, 0, wxALL, 5 ); - - - bSizer11->Add( bSizer12, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); - - wxBoxSizer* bSizer13; - bSizer13 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText28 = new wxStaticText( m_panel2, wxID_ANY, _("Default Value"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText28->Wrap( -1 ); - bSizer13->Add( m_staticText28, 0, wxALL, 5 ); - - fieldDefault = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fieldDefault->SetMinSize( wxSize( 220,-1 ) ); - - bSizer13->Add( fieldDefault, 0, wxALL, 5 ); - - - bSizer11->Add( bSizer13, 1, wxEXPAND, 5 ); - - - bSizer9->Add( bSizer11, 1, wxEXPAND, 5 ); - - - bSizer6->Add( bSizer9, 1, wxEXPAND, 5 ); + deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer6->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 ); m_panel2->SetSizer( bSizer6 ); @@ -366,7 +231,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx bSizer6->Fit( m_panel2 ); m_notebook1->AddPage( m_panel2, _("Template Field Names"), true ); - bOptionsSizer->Add( m_notebook1, 1, wxEXPAND, 0 ); + bOptionsSizer->Add( m_notebook1, 1, wxALL|wxEXPAND, 5 ); m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); @@ -375,7 +240,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - bOptionsSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 6 ); + bOptionsSizer->Add( m_sdbSizer1, 0, wxALIGN_BOTTOM|wxALL|wxEXPAND, 6 ); mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 ); @@ -383,6 +248,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx this->SetSizer( mainSizer ); this->Layout(); + mainSizer->Fit( this ); this->Centre( wxBOTH ); } diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 892de3e244..78a506a726 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -42,7 +42,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE - 508,560 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Schematic Editor Options @@ -101,8 +101,8 @@ wxVERTICAL none - 0 - wxEXPAND + 5 + wxALL|wxEXPAND 1 1 @@ -186,7 +186,7 @@ General Options 0 - + 1 1 1 @@ -260,16 +260,16 @@ - + p1mainSizer wxHORIZONTAL none - + 6 wxALL|wxEXPAND 1 - + bSizer3 wxVERTICAL @@ -2606,7 +2606,7 @@ - + 0 wxEXPAND 0 @@ -3490,688 +3490,285 @@ bSizer6 wxVERTICAL none - + + 8 + wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + 220,-1 + 1 + templateFieldListCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxLC_HRULES|wxLC_REPORT|wxLC_VRULES + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL|wxEXPAND - 1 - + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ADD_FIELD + Add + + 0 + + + 0 - bSizer9 - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bSizer10 - wxVERTICAL - none - - 8 - wxALL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP - 3 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 220,-1 - 1 - templateFieldListCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxLC_HRULES|wxLC_VRULES - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - MyButton - - 0 - - - 0 - - 1 - addFieldButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - MyButton - - 0 - - - 0 - - 1 - deleteFieldButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bSizer11 - wxVERTICAL - none - - 5 - wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer12 - wxHORIZONTAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Name - - 0 - - - 0 - - 1 - m_staticText27 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 220,-1 - 1 - fieldName - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 1 - - - bSizer13 - wxHORIZONTAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default Value - - 0 - - - 0 - - 1 - m_staticText28 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 220,-1 - 1 - fieldDefault - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 1 + addFieldButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_DELETE_FIELD + Delete + + 0 + + + 0 + + 1 + deleteFieldButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnDeleteButtonClick + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 2ad172523f..d9bb8cee08 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -29,7 +29,6 @@ class DIALOG_SHIM; #include #include #include -#include #include #include #include @@ -48,13 +47,17 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM // Private event handlers void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } + void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } + void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } protected: enum { ID_M_SPINAUTOSAVEINTERVAL = 1000, - xwID_ANY + xwID_ANY, + wxID_ADD_FIELD, + wxID_DELETE_FIELD }; wxNotebook* m_notebook1; @@ -96,30 +99,9 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkHVOrientation; wxCheckBox* m_checkPageLimits; wxPanel* m_panel2; - wxStaticText* m_staticText211; - wxStaticText* m_staticText15; - wxTextCtrl* m_fieldName1; - wxStaticText* m_staticText161; - wxTextCtrl* m_fieldName2; - wxStaticText* m_staticText17; - wxTextCtrl* m_fieldName3; - wxStaticText* m_staticText18; - wxTextCtrl* m_fieldName4; - wxStaticText* m_staticText19; - wxTextCtrl* m_fieldName5; - wxStaticText* m_staticText20; - wxTextCtrl* m_fieldName6; - wxStaticText* m_staticText21; - wxTextCtrl* m_fieldName7; - wxStaticText* m_staticText22; - wxTextCtrl* m_fieldName8; wxListCtrl* templateFieldListCtrl; wxButton* addFieldButton; wxButton* deleteFieldButton; - wxStaticText* m_staticText27; - wxTextCtrl* fieldName; - wxStaticText* m_staticText28; - wxTextCtrl* fieldDefault; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; @@ -127,11 +109,13 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 508,560 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_EESCHEMA_OPTIONS_BASE(); }; diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 43e5ec21e3..511832cc00 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -287,7 +287,8 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) dlg.Layout(); dlg.Fit(); dlg.SetMinSize( dlg.GetSize() ); - + dlg.SetTemplateFields( m_TemplateFieldNames.GetTemplateFieldNames() ); +/* const TEMPLATE_FIELDNAMES& tfnames = m_TemplateFieldNames.GetTemplateFieldNames(); for( unsigned i=0; iRefresh( true ); } From 24aa7aa580163b7e1f71e4d381e1edc0a79de345 Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Tue, 16 Sep 2014 20:34:52 +0100 Subject: [PATCH 2/8] Temporary changes --- eeschema/dialogs/dialog_eeschema_options.cpp | 93 +++- eeschema/dialogs/dialog_eeschema_options.h | 8 +- .../dialogs/dialog_eeschema_options_base.cpp | 184 ++++--- .../dialogs/dialog_eeschema_options_base.fbp | 456 +++++++++++++++++- .../dialogs/dialog_eeschema_options_base.h | 15 +- eeschema/eeschema_config.cpp | 12 +- eeschema/template_fieldnames.h | 7 + 7 files changed, 673 insertions(+), 102 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 3dce163983..99aab9511d 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -40,18 +40,18 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : wxListItem col0; col0.SetId( 0 ); - col0.SetText( _( "ID" ) ); - col0.SetWidth( 50 ); + col0.SetText( _( "Field Name" ) ); + col0.SetWidth( 150 ); wxListItem col1; col1.SetId( 1 ); - col1.SetText( _( "Name" ) ); - col1.SetWidth( 150 ); + col1.SetText( _( "Default Value" ) ); + col1.SetWidth( 250 ); wxListItem col2; col2.SetId( 2 ); - col2.SetText( _( "Default Value" ) ); - col2.SetWidth( 250 ); + col2.SetText( _( "Visible" ) ); + col2.SetWidth( 100 ); templateFieldListCtrl->InsertColumn( 0, col0 ); templateFieldListCtrl->InsertColumn( 1, col1 ); @@ -142,29 +142,92 @@ void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) { - long itemindex = templateFieldListCtrl->InsertItem( 0, wxT( "ID" ) ); - templateFieldListCtrl->SetItem( itemindex, 1, wxT( "Next Fieldname" ) ); - templateFieldListCtrl->SetItem( itemindex, 2, wxT( "A Default value" ) ); + long itemindex = templateFieldListCtrl->InsertItem( templateFieldListCtrl->GetItemCount(), wxT( "New Fieldname" ) ); + templateFieldListCtrl->SetItem( itemindex, 1, wxT( "Default Value" ) ); + templateFieldListCtrl->SetItem( itemindex, 2, wxT( "Hidden" ) ); event.Skip(); } +void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) +{ + wxListItem iteminfo; + iteminfo.m_itemId = selectedField; + iteminfo.m_mask = wxLIST_MASK_TEXT; + + iteminfo.m_col = 0; + iteminfo.m_text = fieldNameTextCtrl->GetValue(); + templateFieldListCtrl->SetItem( iteminfo ); + + iteminfo.m_col = 1; + iteminfo.m_text = fieldDefaultValueTextCtrl->GetValue(); + templateFieldListCtrl->SetItem( iteminfo ); + + /* TODO: Fixme! */ + iteminfo.m_col = 2; + iteminfo.m_text = fieldNameTextCtrl->GetValue(); + templateFieldListCtrl->SetItem( iteminfo ); +} + +void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void ) +{ + wxListItem iteminfo; + iteminfo.m_itemId = selectedField; + iteminfo.m_mask = wxLIST_MASK_TEXT; + + iteminfo.m_col = 0; + if( !templateFieldListCtrl->GetItem( iteminfo ) ) + return; + fieldNameTextCtrl->SetValue( iteminfo.m_text ); + + iteminfo.m_col = 1; + if( !templateFieldListCtrl->GetItem( iteminfo ) ) + return; + fieldDefaultValueTextCtrl->SetValue( iteminfo.m_text ); + + iteminfo.m_col = 2; + if( !templateFieldListCtrl->GetItem( iteminfo ) ) + return; + + if( iteminfo.m_text == wxT( "Hidden" ) ) + fieldVisibleCheckbox->SetValue( false ); + else + fieldVisibleCheckbox->SetValue( true ); +} + + +void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) +{ + selectedField = event.GetIndex(); + printf( "selectedField = %d\n", selectedField ); + copySelectedToPanel(); + event.Skip(); +} + + +void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldDeselected( wxListEvent& event ) +{ + event.Skip(); +} + + void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ) { - printf( "SetTemplateFields %d\n", aFields.size() ); + templateFields = aFields; - for( size_t i = 0; i < aFields.size(); i++ ) + for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin(); fld != templateFields.end(); ++fld ) { long itemindex = templateFieldListCtrl->InsertItem( 0, wxT( "?" ) ); - templateFieldListCtrl->SetItem( itemindex, 1, aFields[i].m_Name ); - templateFieldListCtrl->SetItem( itemindex, 2, aFields[i].m_Value ); + templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Name ); + templateFieldListCtrl->SetItem( itemindex, 2, fld->m_Value ); + printf( "Parsed new templateField\n" ); } } -TEMPLATE_FIELDNAMES* DIALOG_EESCHEMA_OPTIONS::GetTemplateFields( void ) +TEMPLATE_FIELDNAMES DIALOG_EESCHEMA_OPTIONS::GetTemplateFields( void ) { - return &templateFields; + return templateFields; } diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index e04f5d14f7..f7020108c5 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -38,9 +38,11 @@ class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE { protected: TEMPLATE_FIELDNAMES templateFields; - + int selectedField; void OnAddButtonClick( wxCommandEvent& event ); - + void copySelectedToPanel( void ); + void OnTemplateFieldSelected( wxListEvent& event ); + void OnTemplateFieldDeselected( wxListEvent& event ); public: DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ); @@ -131,7 +133,7 @@ public: bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); } void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields ); - TEMPLATE_FIELDNAMES* GetTemplateFields( void ); + TEMPLATE_FIELDNAMES GetTemplateFields( void ); private: void OnMiddleBtnPanEnbl( wxCommandEvent& event ) diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index 11d704513d..38c623d8f6 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -12,6 +12,8 @@ BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM ) EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits ) EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl ) + EVT_LIST_ITEM_DESELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldDeselected ) + EVT_LIST_ITEM_SELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldSelected ) EVT_BUTTON( wxID_ADD_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnAddButtonClick ) EVT_BUTTON( wxID_DELETE_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnDeleteButtonClick ) END_EVENT_TABLE() @@ -19,23 +21,23 @@ END_EVENT_TABLE() DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_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 ); - + wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bOptionsSizer; bOptionsSizer = new wxBoxSizer( wxVERTICAL ); - + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_notebook1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - + m_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* p1mainSizer; p1mainSizer = new wxBoxSizer( wxHORIZONTAL ); - + wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxVERTICAL ); - + wxFlexGridSizer* fgSizer1; fgSizer1 = new wxFlexGridSizer( 11, 3, 0, 0 ); fgSizer1->AddGrowableCol( 0 ); @@ -43,223 +45,247 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx fgSizer1->AddGrowableCol( 2 ); fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - + m_staticText2 = new wxStaticText( m_panel1, wxID_ANY, _("Measurement &units:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); fgSizer1->Add( m_staticText2, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + wxArrayString m_choiceUnitsChoices; m_choiceUnits = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitsChoices, 0 ); m_choiceUnits->SetSelection( 0 ); fgSizer1->Add( m_choiceUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - + + fgSizer1->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 ); - + m_staticText3 = new wxStaticText( m_panel1, wxID_ANY, _("&Grid size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3->Wrap( -1 ); fgSizer1->Add( m_staticText3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + wxArrayString m_choiceGridSizeChoices; m_choiceGridSize = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceGridSizeChoices, 0 ); m_choiceGridSize->SetSelection( 0 ); fgSizer1->Add( m_choiceGridSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 3 ); - + m_staticGridUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticGridUnits->Wrap( -1 ); fgSizer1->Add( m_staticGridUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText51 = new wxStaticText( m_panel1, wxID_ANY, _("Default &bus width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText51->Wrap( -1 ); fgSizer1->Add( m_staticText51, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinBusWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 ); fgSizer1->Add( m_spinBusWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticBusWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticBusWidthUnits->Wrap( -1 ); fgSizer1->Add( m_staticBusWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText5 = new wxStaticText( m_panel1, wxID_ANY, _("Default &line width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText5->Wrap( -1 ); fgSizer1->Add( m_staticText5, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinLineWidth = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 1, 100, 1 ); fgSizer1->Add( m_spinLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticLineWidthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticLineWidthUnits->Wrap( -1 ); fgSizer1->Add( m_staticLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText52 = new wxStaticText( m_panel1, wxID_ANY, _("Default pin length:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText52->Wrap( -1 ); fgSizer1->Add( m_staticText52, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - + m_spinPinLength = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 50, 1000, 100 ); fgSizer1->Add( m_spinPinLength, 0, wxALIGN_CENTER|wxALL|wxEXPAND, 3 ); - + m_staticPinLengthUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticPinLengthUnits->Wrap( -1 ); fgSizer1->Add( m_staticPinLengthUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 3 ); - + m_staticText7 = new wxStaticText( m_panel1, wxID_ANY, _("Default text &size:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText7->Wrap( -1 ); fgSizer1->Add( m_staticText7, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinTextSize = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 1000, 0 ); fgSizer1->Add( m_spinTextSize, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticTextSizeUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSizeUnits->Wrap( -1 ); fgSizer1->Add( m_staticTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText9 = new wxStaticText( m_panel1, wxID_ANY, _("Repeat draw item &horizontal displacement:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText9->Wrap( -1 ); fgSizer1->Add( m_staticText9, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinRepeatHorizontal = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 0 ); fgSizer1->Add( m_spinRepeatHorizontal, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticRepeatXUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticRepeatXUnits->Wrap( -1 ); fgSizer1->Add( m_staticRepeatXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText12 = new wxStaticText( m_panel1, wxID_ANY, _("Repeat draw item &vertical displacement:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText12->Wrap( -1 ); fgSizer1->Add( m_staticText12, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinRepeatVertical = new wxSpinCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, -5000, 5000, 100 ); fgSizer1->Add( m_spinRepeatVertical, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticRepeatYUnits = new wxStaticText( m_panel1, wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticRepeatYUnits->Wrap( -1 ); fgSizer1->Add( m_staticRepeatYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText16 = new wxStaticText( m_panel1, wxID_ANY, _("&Repeat label increment:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText16->Wrap( -1 ); fgSizer1->Add( m_staticText16, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinRepeatLabel = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 10, 1 ); fgSizer1->Add( m_spinRepeatLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - - + + fgSizer1->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 ); - + m_staticText221 = new wxStaticText( m_panel1, wxID_ANY, _("Auto save &time interval:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText221->Wrap( -1 ); fgSizer1->Add( m_staticText221, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_spinAutoSaveInterval = new wxSpinCtrl( m_panel1, ID_M_SPINAUTOSAVEINTERVAL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000, 10 ); fgSizer1->Add( m_spinAutoSaveInterval, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 3 ); - + m_staticText23 = new wxStaticText( m_panel1, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText23->Wrap( -1 ); fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - + m_staticText26 = new wxStaticText( m_panel1, wxID_ANY, _("Part id notation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText26->Wrap( -1 ); fgSizer1->Add( m_staticText26, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - + wxString m_choiceSeparatorRefIdChoices[] = { _("A"), _(".A"), _("-A"), _("_A"), _(".1"), _("-1"), _("_1") }; int m_choiceSeparatorRefIdNChoices = sizeof( m_choiceSeparatorRefIdChoices ) / sizeof( wxString ); m_choiceSeparatorRefId = new wxChoice( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceSeparatorRefIdNChoices, m_choiceSeparatorRefIdChoices, 0 ); m_choiceSeparatorRefId->SetSelection( 0 ); fgSizer1->Add( m_choiceSeparatorRefId, 0, wxALL|wxEXPAND, 5 ); - - + + fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); - - + + bSizer3->Add( fgSizer1, 0, wxALIGN_CENTER|wxEXPAND, 0 ); - + wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxVERTICAL ); - + m_staticline1 = new wxStaticLine( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer2->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - + m_checkShowGrid = new wxCheckBox( m_panel1, wxID_ANY, _("Show gr&id"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkShowGrid, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkShowHiddenPins = new wxCheckBox( m_panel1, wxID_ANY, _("Show hi&dden pins"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkEnableZoomNoCenter = new wxCheckBox( m_panel1, wxID_ANY, _("Do not center and &warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableZoomNoCenter->SetToolTip( _("Keep the cursor at its current location when zooming") ); - + bSizer2->Add( m_checkEnableZoomNoCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkEnableMiddleButtonPan = new wxCheckBox( m_panel1, xwID_ANY, _("Use &middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") ); - + bSizer2->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkMiddleButtonPanLimited = new wxCheckBox( m_panel1, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") ); - + bSizer2->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkAutoPan = new wxCheckBox( m_panel1, wxID_ANY, _("Pan while moving ob&ject"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkHVOrientation = new wxCheckBox( m_panel1, wxID_ANY, _("Allow buses and wires to be placed in H or V &orientation only"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkHVOrientation, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - + m_checkPageLimits = new wxCheckBox( m_panel1, wxID_ANY, _("Show p&age limits"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer2->Add( m_checkPageLimits, 0, wxALL|wxEXPAND, 3 ); - - + + bSizer3->Add( bSizer2, 0, wxEXPAND, 0 ); - - + + p1mainSizer->Add( bSizer3, 1, wxALL|wxEXPAND, 6 ); - - + + m_panel1->SetSizer( p1mainSizer ); m_panel1->Layout(); p1mainSizer->Fit( m_panel1 ); m_notebook1->AddPage( m_panel1, _("General Options"), false ); m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); - + wxBoxSizer* bSizer6; bSizer6 = new wxBoxSizer( wxVERTICAL ); - - templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_VRULES ); + + templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); templateFieldListCtrl->SetMinSize( wxSize( 220,-1 ) ); - + bSizer6->Add( templateFieldListCtrl, 1, wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); - + + wxStaticBoxSizer* fieldSizer; + fieldSizer = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Field") ), wxVERTICAL ); + + fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); + fieldNameLabel->Wrap( -1 ); + fieldSizer->Add( fieldNameLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + fieldNameTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fieldSizer->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + fieldDefaultValueLabel = new wxStaticText( m_panel2, wxID_ANY, _("Default Value"), wxDefaultPosition, wxDefaultSize, 0 ); + fieldDefaultValueLabel->Wrap( -1 ); + fieldSizer->Add( fieldDefaultValueLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + fieldDefaultValueTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fieldSizer->Add( fieldDefaultValueTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 ); + fieldSizer->Add( fieldVisibleCheckbox, 0, wxALL, 5 ); + + + bSizer6->Add( fieldSizer, 1, wxEXPAND, 5 ); + addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer6->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 ); - + deleteFieldButton = new wxButton( m_panel2, wxID_DELETE_FIELD, _("Delete"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer6->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 ); - + + m_panel2->SetSizer( bSizer6 ); m_panel2->Layout(); bSizer6->Fit( m_panel2 ); m_notebook1->AddPage( m_panel2, _("Template Field Names"), true ); - + bOptionsSizer->Add( m_notebook1, 1, wxALL|wxEXPAND, 5 ); - + m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - + bOptionsSizer->Add( m_sdbSizer1, 0, wxALIGN_BOTTOM|wxALL|wxEXPAND, 6 ); - - + + mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 ); - - + + this->SetSizer( mainSizer ); this->Layout(); mainSizer->Fit( this ); - + this->Centre( wxBOTH ); } diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 35f3c1b4c5..49caa4e840 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -3792,7 +3792,7 @@ Resizable 1 - wxLC_HRULES|wxLC_REPORT|wxLC_VRULES + wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES 0 @@ -3827,11 +3827,11 @@ - + OnTemplateFieldDeselected - + OnTemplateFieldSelected @@ -3848,6 +3848,456 @@ + + 5 + wxEXPAND + 1 + + wxID_ANY + Field + + fieldSizer + wxVERTICAL + none + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Name + + 0 + + + 0 + + 1 + fieldNameLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + fieldNameTextCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Default Value + + 0 + + + 0 + + 1 + fieldDefaultValueLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + fieldDefaultValueTextCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Visible + + 0 + + + 0 + + 1 + fieldVisibleCheckbox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL|wxEXPAND diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 614a11f721..05a7d509ad 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -28,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -45,6 +49,8 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM // Private event handlers void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } + void _wxFB_OnTemplateFieldDeselected( wxListEvent& event ){ OnTemplateFieldDeselected( event ); } + void _wxFB_OnTemplateFieldSelected( wxListEvent& event ){ OnTemplateFieldSelected( event ); } void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } @@ -101,6 +107,11 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkPageLimits; wxPanel* m_panel2; wxListCtrl* templateFieldListCtrl; + wxStaticText* fieldNameLabel; + wxTextCtrl* fieldNameTextCtrl; + wxStaticText* fieldDefaultValueLabel; + wxTextCtrl* fieldDefaultValueTextCtrl; + wxCheckBox* fieldVisibleCheckbox; wxButton* addFieldButton; wxButton* deleteFieldButton; wxStdDialogButtonSizer* m_sdbSizer1; @@ -110,6 +121,8 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTemplateFieldDeselected( wxListEvent& event ) { event.Skip(); } + virtual void OnTemplateFieldSelected( wxListEvent& event ) { event.Skip(); } virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 53e54fc10e..67ae363987 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -366,6 +366,16 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) // look like the component field property editor, showing visibility and value also DeleteAllTemplateFieldNames(); + TEMPLATE_FIELDNAMES newFieldNames = dlg.GetTemplateFields(); + + for( TEMPLATE_FIELDNAMES::iterator dlgfld = newFieldNames.begin(); dlgfld != newFieldNames.end(); ++dlgfld ) + { + TEMPLATE_FIELDNAME fld = *dlgfld; +/* fld.m_Name = dlgfld->m_Name; + fld.m_Value = dlgfld->m_Value; + fld.m_Visible = dlgfld->m_Visible; */ + AddTemplateFieldName( fld ); + } /* for( int i=0; i<8; ++i ) // no. fields in this dialog window { @@ -786,7 +796,7 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg ) m_TemplateFieldNames.Format( &sf, 0 ); - DBG(printf("saving formatted template fieldnames:'%s'\n", sf.GetString().c_str() );) + printf("saving formatted template fieldnames:'%s'\n", sf.GetString().c_str() ); wxString record = FROM_UTF8( sf.GetString().c_str() ); record.Replace( wxT("\n"), wxT(""), true ); // strip all newlines diff --git a/eeschema/template_fieldnames.h b/eeschema/template_fieldnames.h index 4b74c1ba35..2aff99855d 100644 --- a/eeschema/template_fieldnames.h +++ b/eeschema/template_fieldnames.h @@ -62,6 +62,13 @@ struct TEMPLATE_FIELDNAME { } + TEMPLATE_FIELDNAME( const TEMPLATE_FIELDNAME& ref ) + { + m_Name = ref.m_Name; + m_Value = ref.m_Value; + m_Visible = ref.m_Visible; + } + /** * Function Format * serializes this object out as text into the given OUTPUTFORMATTER. From f13edb6ab96639dbd63e4a36dce514682d7caaf7 Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Mon, 29 Sep 2014 20:47:25 +0100 Subject: [PATCH 3/8] * Intermediate changes before TRUNK merge --- eeschema/dialogs/dialog_eeschema_options.cpp | 95 ++++++++++++++------ eeschema/dialogs/dialog_eeschema_options.h | 5 +- 2 files changed, 70 insertions(+), 30 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 2382c1f59b..062333c15a 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -153,17 +153,20 @@ void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void ) { long itemindex = templateFieldListCtrl->InsertItem( templateFieldListCtrl->GetItemCount(), fld->m_Name ); templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Value ); - templateFieldListCtrl->SetItem( itemindex, 2, ( fld->m_Visible == true ) ? wxT( "Visible" ) : wxT( "Hidden" ) ); + templateFieldListCtrl->SetItem( itemindex, 2, ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" ) ); } +} - // If an item was selected, make sure we re-select it, or at least the - // same position in the grid and then copy the data to the edit panel in - // case it has changed - if( ( selectedField >= 0 ) && ( selectedField < templateFields.size() ) ) - { - templateFieldListCtrl->SetItemState( selectedField, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - copySelectedToPanel(); - } + +void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int item ) +{ + // Only select valid items! + if( ( item < 0 ) || ( item >= templateFieldListCtrl->GetItemCount() ) ) + return; + + // Make sure we select the new item + ignoreSelection = true; + templateFieldListCtrl->SetItemState( item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); } @@ -175,37 +178,59 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) copyPanelToSelected(); // Add a new fieldname to the fieldname list - TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "New Fieldname" ); - newFieldname.m_Value = wxString::Format( wxT( "Default Value %d" ), templateFields.size() ); + TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" ); + newFieldname.m_Value = wxT( "Value" ); newFieldname.m_Visible = false; templateFields.push_back( newFieldname ); - // Update the display to reflect the new data - RefreshTemplateFieldView(); - // Select the newly added field and then copy that data to the edit panel. // Make sure any previously selected state is cleared and then select the // new field - long selected = templateFieldListCtrl->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - - if( selected >= 0 ) - templateFieldListCtrl->SetItemState( selected, 0, wxLIST_STATE_SELECTED ); - - templateFieldListCtrl->SetItemState( templateFieldListCtrl->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - selectedField = templateFieldListCtrl->GetItemCount() - 1; + selectedField = templateFields.size() - 1; + // Update the display to reflect the new data + RefreshTemplateFieldView(); copySelectedToPanel(); + // Make sure we select the new item + SelectTemplateField( selectedField ); + event.Skip(); } +void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event ) +{ + // If there is currently a valid selection, delete the template field from + // the template field list + if( ( selectedField >= 0 ) && ( selectedField < templateFields.size() ) ) + { + // Delete the fieldname from the fieldname list + templateFields.erase( templateFields.begin() + selectedField ); + + // If the selectedField is still not in the templateField range now, + // make sure we stay in range and when there are no fields present + // move to -1 + if( selectedField >= templateFields.size() ) + selectedField = templateFields.size() - 1; + + // Update the display to reflect the new data + RefreshTemplateFieldView(); + copySelectedToPanel(); + + // Make sure after the refresh that the selected item is correct + SelectTemplateField( selectedField ); + } + + event.Skip(); +} + void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) { if( ( selectedField < 0 ) || ( selectedField >= templateFields.size() ) ) return; - // Update the template field data + // Update the template field from the edit panel templateFields[selectedField].m_Name = fieldNameTextCtrl->GetValue(); templateFields[selectedField].m_Value = fieldDefaultValueTextCtrl->GetValue(); templateFields[selectedField].m_Visible = fieldVisibleCheckbox->GetValue(); @@ -217,27 +242,39 @@ void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void ) if( ( selectedField < 0 ) || ( selectedField >= templateFields.size() ) ) return; + // Update the panel data from the selected template field fieldNameTextCtrl->SetValue( templateFields[selectedField].m_Name ); fieldDefaultValueTextCtrl->SetValue( templateFields[selectedField].m_Value ); - - if( templateFields[selectedField].m_Visible == true ) - fieldVisibleCheckbox->SetValue( false ); - else - fieldVisibleCheckbox->SetValue( true ); + fieldVisibleCheckbox->SetValue( templateFields[selectedField].m_Visible ); } void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) { + if( ignoreSelection ) + { + ignoreSelection = false; + return; + } + // Before getting the new field data, make sure we save the old! - if( selectedField >= 0 ) - copyPanelToSelected(); + copyPanelToSelected(); // Now update the selected field and copy the data from the field to the // edit panel selectedField = event.GetIndex(); copySelectedToPanel(); + // Refresh the template field view - this deletes all fields and then + // re-fills the entire data grid. It then re-selects the currently + // selected field. This will be recursive, so disable this event while + // we refresh the view + RefreshTemplateFieldView(); + + // If an item was selected, make sure we re-select it, or at least the + // same position in the grid + SelectTemplateField( selectedField ); + event.Skip(); } diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index c233e69d6f..fff03c4c52 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -38,13 +38,16 @@ class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE { protected: TEMPLATE_FIELDNAMES templateFields; - int selectedField; + int selectedField = -1; + bool ignoreSelection = false; void OnAddButtonClick( wxCommandEvent& event ); + void OnDeleteButtonClick( wxCommandEvent& event ); void copyPanelToSelected( void ); void copySelectedToPanel( void ); void OnTemplateFieldSelected( wxListEvent& event ); void OnTemplateFieldDeselected( wxListEvent& event ); void RefreshTemplateFieldView( void ); + void SelectTemplateField( int item ); public: DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ); From d4b94b9be206b3afa7be53a57f501413691848e7 Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Tue, 30 Sep 2014 20:55:18 +0100 Subject: [PATCH 4/8] * Intermediate changes --- eeschema/dialogs/dialog_eeschema_options.cpp | 68 +++++---- eeschema/dialogs/dialog_eeschema_options.h | 137 ++++++++++++++++-- .../dialogs/dialog_eeschema_options_base.cpp | 1 + .../dialogs/dialog_eeschema_options_base.fbp | 2 +- .../dialogs/dialog_eeschema_options_base.h | 22 +-- eeschema/eeschema_config.cpp | 31 +--- 6 files changed, 178 insertions(+), 83 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 062333c15a..308f51ff56 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -38,27 +38,44 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : m_choiceUnits->SetFocus(); m_sdbSizer1OK->SetDefault(); + // Setup the wxListCtrl for displaying the template fieldnames wxListItem col0; col0.SetId( 0 ); col0.SetText( _( "Field Name" ) ); - col0.SetWidth( 150 ); wxListItem col1; col1.SetId( 1 ); col1.SetText( _( "Default Value" ) ); - col1.SetWidth( 250 ); wxListItem col2; col2.SetId( 2 ); col2.SetText( _( "Visible" ) ); - col2.SetWidth( 100 ); templateFieldListCtrl->InsertColumn( 0, col0 ); templateFieldListCtrl->InsertColumn( 1, col1 ); templateFieldListCtrl->InsertColumn( 2, col2 ); + templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - // Invalid field selected... + // Invalid field selected and don't ignore selection events because + // they'll be from the user selectedField = -1; + ignoreSelection = false; + + // Make sure we select the first tab of the options tab page + m_notebook1->SetSelection( 0 ); +} + + +void DIALOG_EESCHEMA_OPTIONS::OnSize( wxSizeEvent& event ) +{ + templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + + /* We're just eves dropping on the event, pass it on... */ + event.Skip(); } @@ -71,6 +88,7 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) m_choiceUnits->SetSelection( select ); } + void DIALOG_EESCHEMA_OPTIONS::SetRefIdSeparator( wxChar aSep, wxChar aFirstId) { // m_choiceSeparatorRefId displays one of @@ -123,19 +141,19 @@ void DIALOG_EESCHEMA_OPTIONS::GetRefIdSeparator( int& aSep, int& aFirstId) } -void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id ) +void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& aGridSizes, int aGridId ) { - wxASSERT( grid_sizes.size() > 0 ); + wxASSERT( aGridSizes.size() > 0 ); int select = wxNOT_FOUND; - for( size_t i = 0; i < grid_sizes.size(); i++ ) + for( size_t i = 0; i < aGridSizes.size(); i++ ) { wxString tmp; - tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x ); + tmp.Printf( wxT( "%0.1f" ), aGridSizes[i].m_Size.x ); m_choiceGridSize->Append( tmp ); - if( grid_sizes[i].m_Id == grid_id ) + if( aGridSizes[i].m_Id == aGridId ) select = (int) i; } @@ -149,24 +167,30 @@ void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void ) // current template fields templateFieldListCtrl->DeleteAllItems(); - for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin(); fld != templateFields.end(); ++fld ) + // Loop through the template fieldnames and add then to the list control + for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin(); + fld != templateFields.end(); ++fld ) { - long itemindex = templateFieldListCtrl->InsertItem( templateFieldListCtrl->GetItemCount(), fld->m_Name ); + long itemindex = templateFieldListCtrl->InsertItem( + templateFieldListCtrl->GetItemCount(), fld->m_Name ); + templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Value ); - templateFieldListCtrl->SetItem( itemindex, 2, ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" ) ); + + templateFieldListCtrl->SetItem( itemindex, 2, + ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" ) ); } } -void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int item ) +void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem ) { // Only select valid items! - if( ( item < 0 ) || ( item >= templateFieldListCtrl->GetItemCount() ) ) + if( ( aItem < 0 ) || ( aItem >= templateFieldListCtrl->GetItemCount() ) ) return; // Make sure we select the new item ignoreSelection = true; - templateFieldListCtrl->SetItemState( item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); + templateFieldListCtrl->SetItemState( aItem, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); } @@ -194,8 +218,6 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) // Make sure we select the new item SelectTemplateField( selectedField ); - - event.Skip(); } @@ -221,8 +243,6 @@ void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event ) // Make sure after the refresh that the selected item is correct SelectTemplateField( selectedField ); } - - event.Skip(); } void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) @@ -251,6 +271,8 @@ void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void ) void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) { + // If the class has generated the event and asked to ignore it, honour that and reset the + // ignore flag for the next user event. if( ignoreSelection ) { ignoreSelection = false; @@ -274,14 +296,6 @@ void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) // If an item was selected, make sure we re-select it, or at least the // same position in the grid SelectTemplateField( selectedField ); - - event.Skip(); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldDeselected( wxListEvent& event ) -{ - event.Skip(); } diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index fff03c4c52..c1787b4f27 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -37,36 +37,143 @@ class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE { protected: + /** @brief The template fieldnames for this dialog */ TEMPLATE_FIELDNAMES templateFields; - int selectedField = -1; - bool ignoreSelection = false; + + /** @brief The current row selected in the template fieldname wxListCtrl which is also in the + edit panel */ + int selectedField; + + /** @brief Set to true internally when OnTemplateFieldSelected() an event needs to be + ignored */ + bool ignoreSelection; + + /** + * Function OnAddButtonClick + * Process the wxWidgets @a event produced when the user presses the Add buton for the + * template fieldnames control + * + * @param event The wxWidgets produced event information + * + * Adds a new template fieldname (with default values) to the template fieldnames data + */ + void OnAddButtonClick( wxCommandEvent& event ); + + /** + * Function OnDeleteButtonClick + * Process the wxWidgets @a event produced when the user presses the Delete button for the + * template fieldnames control + * + * @param event The wxWidgets produced event information + * + * Deletes the selected template fieldname from the template fieldnames data + */ void OnDeleteButtonClick( wxCommandEvent& event ); + + /** + * Function OnSize + * Resize any controls that are dynamically sized when the dialog is resized + */ + void OnSize( wxSizeEvent& event ); + + /** + * Function copyPanelToSelected + * Copies the data from the edit panel to the selected template fieldname + */ void copyPanelToSelected( void ); + + /** + * Function copySelectedToPanel + * Copies the data from the selected template fieldname and fills in the edit panel + */ void copySelectedToPanel( void ); + + /** + * Function OnTemplateFieldSelected + * Event handler for the wxListCtrl containing the template fieldnames + * + * @param event The event information provided by wxWidgets + * + * Processes data exchange between the edit panel and the selected template fieldname + */ void OnTemplateFieldSelected( wxListEvent& event ); - void OnTemplateFieldDeselected( wxListEvent& event ); + + /** + * Function RefreshTemplateFieldView + * Refresh the template fieldname wxListCtrl + * + * Deletes all data from the wxListCtrl and then re-polpulates the control with the data in + * the template fieldnames. + * + * Use any time the template field data has changed + */ void RefreshTemplateFieldView( void ); - void SelectTemplateField( int item ); + + /** + * Function SelectTemplateField + * Selects @a aItem from the wxListCtrl populated with the template fieldnames + * + * @param aItem The item index of the row to be selected + * + * When RefreshTemplateFieldView() is used the selection is lost because all of the items are + * removed from the wxListCtrl and then the control is re-populated. This function can be used + * to re-select an item that was previously selected so that the selection is not lost. + * + * NOTE: This function first sets the ignoreSelection flag before making the selection. + * This means the class can select something in the wxListCtrl without causing further + * selection events. + */ + void SelectTemplateField( int aItem ); + public: DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ); - void SetUnits( const wxArrayString& units, int select = 0 ); + /** + * Function GetUnitsSelection + * Returns the currently selected grid size in the dialog + */ int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); } - void SetGridSelection( int select ) { m_choiceGridSize->SetSelection( select ); } + /** + * Function SetUnits + * Set the unit options + * + * @param units The array of strings representing the unit options + * @param select The unit to select from the unit options + * + * Appends the @a units options to the list of unit options and selects the @a aSelect option + */ + void SetUnits( const wxArrayString& units, int aSelect = 0 ); + + /** + * Function GetGridSelection + * Returns the curent grid size selected in the dialog + */ int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); } - void SetGridSizes( const GRIDS& grid_sizes, int grid_id ); - void SetBusWidth( int aWidth ) - { - m_spinBusWidth->SetValue( aWidth ); - } + /** + * Function SetGridSizes + * Sets the available grid size choices @a aGridSizes and selectd the current option @a aGridId + * + * @param aGridSizes The grid sizes that are able to be chosen from + * @param aGridId The grid size to select from the grid size options + */ + void SetGridSizes( const GRIDS& aGridSizes, int aGridId ); - int GetBusWidth( void ) - { - return m_spinBusWidth->GetValue(); - } + /** + * Function GetBusWidth + * Get the current bus width setting from the dialog + */ + int GetBusWidth( void ) { return m_spinBusWidth->GetValue(); } + + /** + * Function SetBusWidth + * Sets the bus width setting in the dialog + * + * @param aWidth The bus width to set the dialog edit spinbox with + */ + void SetBusWidth( int aWidth ) { m_spinBusWidth->SetValue( aWidth ); } void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); } int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); } diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index b8f6a2ae4e..e9fe31c14d 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -10,6 +10,7 @@ /////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM ) + EVT_SIZE( DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnSize ) EVT_CHOICE( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnChooseUnits ) EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl ) EVT_LIST_ITEM_DESELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldDeselected ) diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 75dd865ec8..f65d30dabf 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -86,7 +86,7 @@ - + OnSize diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 6d7f7602d3..07e4c59367 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -45,16 +45,17 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM { DECLARE_EVENT_TABLE() private: - + // Private event handlers + void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); } void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } void _wxFB_OnTemplateFieldDeselected( wxListEvent& event ){ OnTemplateFieldDeselected( event ); } void _wxFB_OnTemplateFieldSelected( wxListEvent& event ){ OnTemplateFieldSelected( event ); } void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } - - + + protected: enum { @@ -63,7 +64,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxID_ADD_FIELD, wxID_DELETE_FIELD }; - + wxNotebook* m_notebook1; wxPanel* m_panel1; wxStaticText* m_staticText2; @@ -114,21 +115,22 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - + // Virtual event handlers, overide them in your derived class + virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } virtual void OnTemplateFieldDeselected( wxListEvent& event ) { event.Skip(); } virtual void OnTemplateFieldSelected( wxListEvent& event ) { event.Skip(); } virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_EESCHEMA_OPTIONS_BASE(); - + }; #endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 3f78ba30a2..64de5fcce0 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -323,7 +323,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) dlg.SetRepeatVertical( g_RepeatStep.y ); dlg.SetRepeatLabel( g_RepeatDeltaLabel ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); - dlg.SetRefIdSeparator( LIB_PART::GetSubpartIdSeparator( ), + dlg.SetRefIdSeparator( LIB_PART::GetSubpartIdSeparator(), LIB_PART::GetSubpartFirstId() ); dlg.SetShowGrid( IsGridVisible() ); @@ -338,16 +338,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event ) dlg.Fit(); dlg.SetMinSize( dlg.GetSize() ); dlg.SetTemplateFields( m_TemplateFieldNames.GetTemplateFieldNames() ); -/* - const TEMPLATE_FIELDNAMES& tfnames = m_TemplateFieldNames.GetTemplateFieldNames(); - for( unsigned i=0; im_Name; - fld.m_Value = dlgfld->m_Value; - fld.m_Visible = dlgfld->m_Visible; */ AddTemplateFieldName( fld ); } -/* - for( int i=0; i<8; ++i ) // no. fields in this dialog window - { - templateFieldName = dlg.GetFieldName( i ); - - if( !templateFieldName.IsEmpty() ) - { - TEMPLATE_FIELDNAME fld( dlg.GetFieldName( i ) ); - - // @todo set visibility and value also from a better editor - - AddTemplateFieldName( fld ); - } - } -*/ SaveSettings( config() ); // save values shared by eeschema applications. From 9f811aaaa04d288b165e45d5a907e39afbe3f087 Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Wed, 8 Oct 2014 21:47:42 +0100 Subject: [PATCH 5/8] * Changes before merge --- ...ialog_edit_libentry_fields_in_lib_base.fbp | 2514 ++++++++--------- eeschema/dialogs/dialog_eeschema_options.cpp | 35 +- eeschema/dialogs/dialog_eeschema_options.h | 7 +- .../dialogs/dialog_eeschema_options_base.cpp | 3 + .../dialogs/dialog_eeschema_options_base.fbp | 86 +- .../dialogs/dialog_eeschema_options_base.h | 22 +- 6 files changed, 1378 insertions(+), 1289 deletions(-) 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 647cfd8e2f..692687dc31 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp @@ -1,6 +1,6 @@ - + ; C++ @@ -16,9 +16,9 @@ none 1 DialogEditLibentryFields_in_lib_base - + . - + 1 1 1 @@ -29,67 +29,67 @@ 0 wxAUI_MGR_DEFAULT - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE - + -1,-1 wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Field Properties - - - - - - - - - - - - - + + + + + + + + + + + + + OnCloseDialog - - - - - + + + + + OnInitDialog - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + mainSizer wxVERTICAL none @@ -98,7 +98,7 @@ wxEXPAND 1 - + bSizerFieldsSetup wxHORIZONTAL none @@ -107,7 +107,7 @@ wxEXPAND 3 - + bSizerFiledsList wxVERTICAL none @@ -120,100 +120,100 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 220,-1 1 fieldListCtrl 1 - - + + protected 1 - + Resizable 1 - + wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnListItemDeselected - - - + + + OnListItemSelected - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -225,17 +225,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -243,65 +243,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Add Field - + 0 - - + + 0 - + 1 addFieldButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Add a new custom field - + wxFILTER_NONE wxDefaultValidator - - - - + + + + addFieldButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -313,17 +313,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -331,65 +331,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Delete Field - + 0 - - + + 0 - + 1 deleteFieldButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Delete one of the optional fields - + wxFILTER_NONE wxDefaultValidator - - - - + + + + deleteFieldButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -401,17 +401,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -419,65 +419,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Move Up - + 0 - - + + 0 - + 1 moveUpButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Move the selected optional fields up one position - + wxFILTER_NONE wxDefaultValidator - - - - + + + + moveUpButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -487,7 +487,7 @@ wxEXPAND 2 - + fieldEditBoxSizer wxVERTICAL none @@ -496,7 +496,7 @@ wxEXPAND|wxBOTTOM 0 - + bSizerJustify wxHORIZONTAL none @@ -509,85 +509,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Left" "Center" "Right" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Horiz. Justify 1 - + 0 - - + + 0 - + 1 m_FieldHJustifyCtrl 1 - - + + protected 1 - + Resizable 1 1 - + wxRA_SPECIFY_COLS - + 0 Select if the component is to be rotated when drawn - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -599,85 +599,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Bottom" "Center" "Top" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Vert. Justify 1 - + 0 - - + + 0 - + 1 m_FieldVJustifyCtrl 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 Pick the graphical transformation to be used when displaying the component, if any - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -687,7 +687,7 @@ wxEXPAND|wxTOP 0 - + bSizerAspect wxHORIZONTAL none @@ -698,11 +698,11 @@ wxID_ANY Visibility - + visibilitySizer wxVERTICAL none - + 5 wxALL @@ -712,83 +712,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Show - + 0 - - + + 0 - + 1 showCheckBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Check if you want this field visible - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -800,83 +800,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Rotate - + 0 - - + + 0 - + 1 rotateCheckBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Check if you want this field's text rotated 90 degrees - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -890,85 +890,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Normal" "Italic" "Bold" "Bold Italic" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Style: 1 - + 0 - - + + 0 - + 1 m_StyleRadioBox 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -978,91 +978,91 @@ wxALL|wxEXPAND 0 - + fieldNameBoxSizer wxVERTICAL none 5 - + 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Field Name - + 0 - - + + 0 - + 1 fieldNameLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1074,86 +1074,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 fieldNameTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The text (or value) of the currently selected field - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1165,78 +1165,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Field Value - + 0 - - + + 0 - + 1 fieldValueLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1248,86 +1248,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 fieldValueTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The text (or value) of the currently selected field - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1339,17 +1339,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1357,65 +1357,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Show in Browser - + 0 - - + + 0 - + 1 m_show_datasheet_button 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 If your datasheet is given as an http:// link, then pressing this button should bring it up in your webbrowser. - + wxFILTER_NONE wxDefaultValidator - - - - + + + + showButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1428,9 +1428,9 @@ 3 wxBOTH 1 - + 0 - + fgSizerPosSize wxFLEX_GROWMODE_SPECIFIED none @@ -1445,78 +1445,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Size - + 0 - - + + 0 - + 1 textSizeLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1528,86 +1528,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 textSizeTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The vertical height of the currently selected field's text in the schematic - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1619,78 +1619,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitSize 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1702,78 +1702,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY PosX - + 0 - - + + 0 - + 1 posXLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1785,86 +1785,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 posXTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1876,78 +1876,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitPosX 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1959,78 +1959,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY PosY - + 0 - - + + 0 - + 1 posYLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2042,86 +2042,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 posYTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The Y coordinate of the text relative to the component - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2133,78 +2133,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitPosY 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2222,76 +2222,76 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline1 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2307,17 +2307,17 @@ 1 0 0 - + stdDialogButtonSizer protected - + OnCancelButtonClick - - - + + + OnOKButtonClick - - + + diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 308f51ff56..2dddd1ac78 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -31,6 +31,7 @@ #include +#include "wx/settings.h" DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : DIALOG_EESCHEMA_OPTIONS_BASE( parent ) @@ -38,7 +39,14 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : m_choiceUnits->SetFocus(); m_sdbSizer1OK->SetDefault(); - // Setup the wxListCtrl for displaying the template fieldnames + // Dialog should not shrink beyond it's minimal size. + GetSizer()->SetSizeHints( this ); + + // The width returned by GetSize includes the amount taken up by the scroll bar, remove the + // scrollbar width + int listWidth = templateFieldListCtrl->GetSize().GetWidth() - 1; +// - wxSystemSettings::GetMetric( wxSYS_HSCROLL_Y ); + wxListItem col0; col0.SetId( 0 ); col0.SetText( _( "Field Name" ) ); @@ -54,31 +62,28 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : templateFieldListCtrl->InsertColumn( 0, col0 ); templateFieldListCtrl->InsertColumn( 1, col1 ); templateFieldListCtrl->InsertColumn( 2, col2 ); - templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); + + templateFieldListCtrl->SetColumnWidth( 0, 200 ); + templateFieldListCtrl->SetColumnWidth( 1, 200 ); + templateFieldListCtrl->SetColumnWidth( 2, 75 ); // Invalid field selected and don't ignore selection events because // they'll be from the user selectedField = -1; ignoreSelection = false; + // Set the html help for th template editor + m_htmlWin2->SetPage( + _( "Template Field Names
" + "

Field names must be unique, and should be alpha-numeric only

" + "

Some field names are reserved and cannot be used. The following fieldnames are " + "reserved:

" ) ); + // Make sure we select the first tab of the options tab page m_notebook1->SetSelection( 0 ); } -void DIALOG_EESCHEMA_OPTIONS::OnSize( wxSizeEvent& event ) -{ - templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetViewRect().GetWidth() / 3 ); - - /* We're just eves dropping on the event, pass it on... */ - event.Skip(); -} - - void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) { wxASSERT( units.GetCount() > 0 diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index c1787b4f27..2876d21f21 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -70,12 +70,7 @@ protected: * Deletes the selected template fieldname from the template fieldnames data */ void OnDeleteButtonClick( wxCommandEvent& event ); - - /** - * Function OnSize - * Resize any controls that are dynamically sized when the dialog is resized - */ - void OnSize( wxSizeEvent& event ); + void OnInitDialog( wxInitDialogEvent& event ); /** * Function copyPanelToSelected diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index e9fe31c14d..b834a98e6a 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -242,6 +242,9 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 ); fieldSizer->Add( fieldVisibleCheckbox, 0, wxALL, 5 ); + m_htmlWin2 = new wxHtmlWindow( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO ); + fieldSizer->Add( m_htmlWin2, 1, wxALL|wxEXPAND, 5 ); + bSizer6->Add( fieldSizer, 1, wxEXPAND, 5 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index f65d30dabf..4ce88cd812 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -45,7 +45,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + wxDEFAULT_DIALOG_STYLE DIALOG_SHIM; dialog_shim.h Schematic Editor Options @@ -4052,6 +4052,90 @@ + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_htmlWin2 + 1 + + + protected + 1 + + Resizable + 1 + + wxHW_SCROLLBAR_AUTO + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 07e4c59367..9e91572fc6 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -31,6 +31,7 @@ class DIALOG_SHIM; #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM { DECLARE_EVENT_TABLE() private: - + // Private event handlers void _wxFB_OnSize( wxSizeEvent& event ){ OnSize( event ); } void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } @@ -54,8 +55,8 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM void _wxFB_OnTemplateFieldSelected( wxListEvent& event ){ OnTemplateFieldSelected( event ); } void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } - - + + protected: enum { @@ -64,7 +65,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxID_ADD_FIELD, wxID_DELETE_FIELD }; - + wxNotebook* m_notebook1; wxPanel* m_panel1; wxStaticText* m_staticText2; @@ -110,12 +111,13 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxStaticText* fieldDefaultValueLabel; wxTextCtrl* fieldDefaultValueTextCtrl; wxCheckBox* fieldVisibleCheckbox; + wxHtmlWindow* m_htmlWin2; wxButton* addFieldButton; wxButton* deleteFieldButton; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - + // Virtual event handlers, overide them in your derived class virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } @@ -124,13 +126,13 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM virtual void OnTemplateFieldSelected( wxListEvent& event ) { event.Skip(); } virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~DIALOG_EESCHEMA_OPTIONS_BASE(); - + }; #endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__ From 40c276605e368c2871689838892466c85729adcd Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Tue, 14 Oct 2014 19:52:31 +0100 Subject: [PATCH 6/8] * Commit before merge --- eeschema/dialogs/dialog_eeschema_options.cpp | 22 +++-- eeschema/dialogs/dialog_eeschema_options.h | 1 + .../dialogs/dialog_eeschema_options_base.cpp | 7 +- .../dialogs/dialog_eeschema_options_base.fbp | 90 +------------------ .../dialogs/dialog_eeschema_options_base.h | 2 - 5 files changed, 21 insertions(+), 101 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 2dddd1ac78..8fa5e10eb4 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -72,15 +72,15 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : selectedField = -1; ignoreSelection = false; - // Set the html help for th template editor - m_htmlWin2->SetPage( - _( "Template Field Names
" - "

Field names must be unique, and should be alpha-numeric only

" - "

Some field names are reserved and cannot be used. The following fieldnames are " - "reserved:

" ) ); - // Make sure we select the first tab of the options tab page m_notebook1->SetSelection( 0 ); + + // Connect the edit controls for the template field names to the kill focus event which + // doesn't propogate, hence the need to connect it here. + + fieldNameTextCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this ); + fieldDefaultValueTextCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this ); + fieldVisibleCheckbox->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this ); } @@ -262,6 +262,14 @@ void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) } +void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event ) +{ + // Update the data + UI + copyPanelToSelected(); + RefreshTemplateFieldView(); +} + + void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void ) { if( ( selectedField < 0 ) || ( selectedField >= templateFields.size() ) ) diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index 2876d21f21..3319258737 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -71,6 +71,7 @@ protected: */ void OnDeleteButtonClick( wxCommandEvent& event ); void OnInitDialog( wxInitDialogEvent& event ); + void OnEditControlKillFocus( wxFocusEvent& event ); /** * Function copyPanelToSelected diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index b834a98e6a..1600c43ed3 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -223,7 +223,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx bSizer6->Add( templateFieldListCtrl, 1, wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); wxStaticBoxSizer* fieldSizer; - fieldSizer = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Field") ), wxVERTICAL ); + fieldSizer = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Field Settings") ), wxVERTICAL ); fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 ); fieldNameLabel->Wrap( -1 ); @@ -242,11 +242,8 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("Visible"), wxDefaultPosition, wxDefaultSize, 0 ); fieldSizer->Add( fieldVisibleCheckbox, 0, wxALL, 5 ); - m_htmlWin2 = new wxHtmlWindow( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO ); - fieldSizer->Add( m_htmlWin2, 1, wxALL|wxEXPAND, 5 ); - - bSizer6->Add( fieldSizer, 1, wxEXPAND, 5 ); + bSizer6->Add( fieldSizer, 0, wxEXPAND, 5 ); addFieldButton = new wxButton( m_panel2, wxID_ADD_FIELD, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer6->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 4ce88cd812..a8db4f6c6f 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -1961,7 +1961,7 @@ protected 1 - Resizable + Fixed 1 @@ -3607,10 +3607,10 @@ 5 wxEXPAND - 1 + 0 wxID_ANY - Field + Field Settings fieldSizer wxVERTICAL @@ -4052,90 +4052,6 @@ - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_htmlWin2 - 1 - - - protected - 1 - - Resizable - 1 - - wxHW_SCROLLBAR_AUTO - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 9e91572fc6..53381bd668 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -31,7 +31,6 @@ class DIALOG_SHIM; #include #include #include -#include #include #include #include @@ -111,7 +110,6 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxStaticText* fieldDefaultValueLabel; wxTextCtrl* fieldDefaultValueTextCtrl; wxCheckBox* fieldVisibleCheckbox; - wxHtmlWindow* m_htmlWin2; wxButton* addFieldButton; wxButton* deleteFieldButton; wxStdDialogButtonSizer* m_sdbSizer1; From 11919da62183794ed19fda53b482d69f5754593e Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Tue, 14 Oct 2014 23:50:47 +0100 Subject: [PATCH 7/8] * Fix issues mainly for windows --- eeschema/dialogs/dialog_eeschema_options.cpp | 18 ++++++++++++++---- .../dialogs/dialog_eeschema_options_base.cpp | 2 +- .../dialogs/dialog_eeschema_options_base.fbp | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 21e14ddc8e..10d2df9a31 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -58,9 +58,9 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : templateFieldListCtrl->InsertColumn( 1, col1 ); templateFieldListCtrl->InsertColumn( 2, col2 ); - templateFieldListCtrl->SetColumnWidth( 0, 200 ); - templateFieldListCtrl->SetColumnWidth( 1, 200 ); - templateFieldListCtrl->SetColumnWidth( 2, 75 ); + templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetSize().GetWidth() / 3.5 ); + templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetSize().GetWidth() / 3.5 ); + templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetSize().GetWidth() / 3.5 ); // Invalid field selected and don't ignore selection events because // they'll be from the user @@ -191,7 +191,7 @@ void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void ) void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem ) { // Only select valid items! - if( ( aItem < 0 ) || ( aItem >= templateFieldListCtrl->GetItemCount() ) ) + if( !selectionValid || ( aItem >= templateFieldListCtrl->GetItemCount() ) ) return; // Make sure we select the new item @@ -225,6 +225,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) // Make sure we select the new item SelectTemplateField( selectedField ); + + event.Skip(); } @@ -250,6 +252,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event ) // Make sure after the refresh that the selected item is correct SelectTemplateField( selectedField ); } + + event.Skip(); } void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) @@ -269,6 +273,9 @@ void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event ) // Update the data + UI copyPanelToSelected(); RefreshTemplateFieldView(); + SelectTemplateField( selectedField ); + + event.Skip(); } @@ -291,6 +298,7 @@ void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) if( ignoreSelection ) { ignoreSelection = false; + event.Skip(); return; } @@ -312,6 +320,8 @@ void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) // If an item was selected, make sure we re-select it, or at least the // same position in the grid SelectTemplateField( selectedField ); + + event.Skip(); } diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index 1600c43ed3..cbe1dbe6dc 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -218,7 +218,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx bSizer6 = new wxBoxSizer( wxVERTICAL ); templateFieldListCtrl = new wxListCtrl( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); - templateFieldListCtrl->SetMinSize( wxSize( 220,-1 ) ); + templateFieldListCtrl->SetMinSize( wxSize( 500,-1 ) ); bSizer6->Add( templateFieldListCtrl, 1, wxALIGN_TOP|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index a8db4f6c6f..493e01eed1 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -3536,7 +3536,7 @@ 0 - 220,-1 + 500,-1 1 templateFieldListCtrl 1 From b554a22176f129a80ac2f792ba979d9df4bdf027 Mon Sep 17 00:00:00 2001 From: Brian Sidebotham Date: Tue, 14 Oct 2014 23:55:42 +0100 Subject: [PATCH 8/8] * Fix unedited dialog --- ...ialog_edit_libentry_fields_in_lib_base.fbp | 2514 ++++++++--------- 1 file changed, 1257 insertions(+), 1257 deletions(-) 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 692687dc31..647cfd8e2f 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib_base.fbp @@ -1,6 +1,6 @@ - + ; C++ @@ -16,9 +16,9 @@ none 1 DialogEditLibentryFields_in_lib_base - + . - + 1 1 1 @@ -29,67 +29,67 @@ 0 wxAUI_MGR_DEFAULT - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE - + -1,-1 wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Field Properties - - - - - - - - - - - - - + + + + + + + + + + + + + OnCloseDialog - - - - - + + + + + OnInitDialog - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + mainSizer wxVERTICAL none @@ -98,7 +98,7 @@ wxEXPAND 1 - + bSizerFieldsSetup wxHORIZONTAL none @@ -107,7 +107,7 @@ wxEXPAND 3 - + bSizerFiledsList wxVERTICAL none @@ -120,100 +120,100 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 220,-1 1 fieldListCtrl 1 - - + + protected 1 - + Resizable 1 - + wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnListItemDeselected - - - + + + OnListItemSelected - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -225,17 +225,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -243,65 +243,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Add Field - + 0 - - + + 0 - + 1 addFieldButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Add a new custom field - + wxFILTER_NONE wxDefaultValidator - - - - + + + + addFieldButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -313,17 +313,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -331,65 +331,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Delete Field - + 0 - - + + 0 - + 1 deleteFieldButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Delete one of the optional fields - + wxFILTER_NONE wxDefaultValidator - - - - + + + + deleteFieldButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -401,17 +401,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -419,65 +419,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Move Up - + 0 - - + + 0 - + 1 moveUpButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Move the selected optional fields up one position - + wxFILTER_NONE wxDefaultValidator - - - - + + + + moveUpButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -487,7 +487,7 @@ wxEXPAND 2 - + fieldEditBoxSizer wxVERTICAL none @@ -496,7 +496,7 @@ wxEXPAND|wxBOTTOM 0 - + bSizerJustify wxHORIZONTAL none @@ -509,85 +509,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Left" "Center" "Right" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Horiz. Justify 1 - + 0 - - + + 0 - + 1 m_FieldHJustifyCtrl 1 - - + + protected 1 - + Resizable 1 1 - + wxRA_SPECIFY_COLS - + 0 Select if the component is to be rotated when drawn - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -599,85 +599,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Bottom" "Center" "Top" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Vert. Justify 1 - + 0 - - + + 0 - + 1 m_FieldVJustifyCtrl 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 Pick the graphical transformation to be used when displaying the component, if any - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -687,7 +687,7 @@ wxEXPAND|wxTOP 0 - + bSizerAspect wxHORIZONTAL none @@ -698,11 +698,11 @@ wxID_ANY Visibility - + visibilitySizer wxVERTICAL none - + 5 wxALL @@ -712,83 +712,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Show - + 0 - - + + 0 - + 1 showCheckBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Check if you want this field visible - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -800,83 +800,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Rotate - + 0 - - + + 0 - + 1 rotateCheckBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Check if you want this field's text rotated 90 degrees - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -890,85 +890,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Normal" "Italic" "Bold" "Bold Italic" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Style: 1 - + 0 - - + + 0 - + 1 m_StyleRadioBox 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -978,91 +978,91 @@ wxALL|wxEXPAND 0 - + fieldNameBoxSizer wxVERTICAL none 5 - + 0 1 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Field Name - + 0 - - + + 0 - + 1 fieldNameLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1074,86 +1074,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 fieldNameTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The text (or value) of the currently selected field - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1165,78 +1165,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Field Value - + 0 - - + + 0 - + 1 fieldValueLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1248,86 +1248,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 fieldValueTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The text (or value) of the currently selected field - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1339,17 +1339,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1357,65 +1357,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Show in Browser - + 0 - - + + 0 - + 1 m_show_datasheet_button 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 If your datasheet is given as an http:// link, then pressing this button should bring it up in your webbrowser. - + wxFILTER_NONE wxDefaultValidator - - - - + + + + showButtonHandler - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1428,9 +1428,9 @@ 3 wxBOTH 1 - + 0 - + fgSizerPosSize wxFLEX_GROWMODE_SPECIFIED none @@ -1445,78 +1445,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Size - + 0 - - + + 0 - + 1 textSizeLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1528,86 +1528,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 textSizeTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The vertical height of the currently selected field's text in the schematic - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1619,78 +1619,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitSize 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1702,78 +1702,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY PosX - + 0 - - + + 0 - + 1 posXLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1785,86 +1785,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 posXTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1876,78 +1876,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitPosX 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1959,78 +1959,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY PosY - + 0 - - + + 0 - + 1 posYLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2042,86 +2042,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 posYTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 The Y coordinate of the text relative to the component - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2133,78 +2133,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY unit - + 0 - - + + 0 - + 1 m_staticTextUnitPosY 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2222,76 +2222,76 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline1 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2307,17 +2307,17 @@ 1 0 0 - + stdDialogButtonSizer protected - + OnCancelButtonClick - - - + + + OnOKButtonClick - - + +