diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index 6ee6480efa..c6b0f34c87 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -42,40 +42,17 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : // Dialog should not shrink beyond it's minimal size. GetSizer()->SetSizeHints( this ); - wxListItem col0; - col0.SetId( 0 ); - col0.SetText( _( "Field Name" ) ); - - wxListItem col1; - col1.SetId( 1 ); - col1.SetText( _( "Default Value" ) ); - - wxListItem col2; - col2.SetId( 2 ); - col2.SetText( _( "Visible" ) ); - - templateFieldListCtrl->InsertColumn( 0, col0 ); - templateFieldListCtrl->InsertColumn( 1, col1 ); - templateFieldListCtrl->InsertColumn( 2, col2 ); - - 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 - selectedField = -1; + // wxformbuilder doesn't seem to let us set minimal sizes. Copy the default + // sizes into the minimal sizes, then, and autosize: + for( int i = 0; i < m_fieldGrid->GetNumberCols(); ++i ) + { + m_fieldGrid->SetColMinimalWidth( i, m_fieldGrid->GetColSize( i ) ); + m_fieldGrid->AutoSizeColLabelSize( i ); + } // Make sure we select the first tab of the options tab page m_notebook->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 ); } @@ -161,86 +138,42 @@ void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& aGridSizes, int aGridId } -void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void ) -{ - // Loop through the template fieldnames and add them to the list control - // or just change texts if room exists - long itemindex = 0; - wxString tmp; - - for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin(); - fld != templateFields.end(); ++fld, itemindex++ ) - { - if( templateFieldListCtrl->GetItemCount() <= itemindex ) - { - templateFieldListCtrl->InsertItem( - templateFieldListCtrl->GetItemCount(), fld->m_Name ); - } - - wxListItem litem; - litem.SetId( itemindex ); - templateFieldListCtrl->GetItem( litem ); - - litem.SetColumn( 0 ); - if( litem.GetText() != fld->m_Name ) - templateFieldListCtrl->SetItem( itemindex, 0, fld->m_Name ); - - litem.SetColumn( 1 ); - if( litem.GetText() != fld->m_Value ) - templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Value ); - - tmp = ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" ); - - litem.SetColumn( 2 ); - if( litem.GetText() != tmp ) - templateFieldListCtrl->SetItem( itemindex, 2, tmp ); - } - - // Remove extra items: - while( templateFieldListCtrl->GetItemCount() > itemindex ) - { - templateFieldListCtrl->DeleteItem( itemindex ); - } - -} - - -void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem ) -{ - // Only select valid items! - if( ( aItem < 0 ) || ( aItem >= templateFieldListCtrl->GetItemCount() ) ) - return; - - // Make sure we select the new item in list control - if( templateFieldListCtrl->GetFirstSelected() != aItem ) - templateFieldListCtrl->Select( aItem, true ); -} - - void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) { - // If there is currently a valid selection, copy the edit panel to the - // selected field so as not to lose the data - if( fieldSelectionValid( selectedField ) ) - copyPanelToSelected(); + // If a single row is selected, insert after that row. + int selected_row = -1; + int n_found = 0; + + for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) + { + bool this_row_selected = false; + for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col ) + { + if( m_fieldGrid->IsInSelection( row, col ) ) + this_row_selected = true; + } + if( this_row_selected ) + { + selected_row = row; + ++n_found; + } + } + + TransferDataFromWindow(); + + TEMPLATE_FIELDNAMES::iterator pos; + + if( n_found == 1 ) + pos = templateFields.begin() + selected_row + 1; + else + pos = templateFields.end(); // Add a new fieldname to the fieldname list TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" ); newFieldname.m_Value = wxT( "Value" ); newFieldname.m_Visible = false; - templateFields.push_back( newFieldname ); - - // 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 - selectedField = templateFields.size() - 1; - - // Update the display to reflect the new data - RefreshTemplateFieldView(); - copySelectedToPanel(); - - // Make sure we select the new item - SelectTemplateField( selectedField ); + templateFields.insert( pos, newFieldname ); + TransferDataToWindow(); event.Skip(); } @@ -248,97 +181,79 @@ void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event ) { - // If there is currently a valid selection, delete the template field from - // the template field list - if( fieldSelectionValid( selectedField ) ) + // wxGrid has a somewhat complex way of detemining selection. + // This is pretty much the easiest way to do it, here. + + std::vector rows_to_delete( templateFields.size(), false ); + + for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) { - // 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 >= int( 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 ); + for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col ) + { + if( m_fieldGrid->IsInSelection( row, col ) ) + rows_to_delete[row] = true; + } } + + TransferDataFromWindow(); + + int n_rows = m_fieldGrid->GetNumberRows(); + for( int count = 0; count < n_rows; ++count ) + { + // Iterate backwards, unsigned-friendly way for future + int row = n_rows - count - 1; + if( rows_to_delete[row] ) + { + templateFields.erase( templateFields.begin() + row ); + } + } + + TransferDataToWindow(); } -void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void ) +bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow() { - if( !fieldSelectionValid( selectedField ) ) - return; + if( !wxDialog::TransferDataToWindow() ) + return false; - // 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(); + m_fieldGrid->Freeze(); + if( m_fieldGrid->GetNumberRows() ) + m_fieldGrid->DeleteRows( 0, m_fieldGrid->GetNumberRows() ); + m_fieldGrid->AppendRows( templateFields.size() ); + + for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) + { + m_fieldGrid->SetCellValue( row, 0, templateFields[row].m_Name ); + m_fieldGrid->SetCellValue( row, 1, templateFields[row].m_Value ); + m_fieldGrid->SetCellValue( row, 2, + templateFields[row].m_Visible ? wxT( "1" ) : wxEmptyString ); + + // Set cell properties + m_fieldGrid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE ); + m_fieldGrid->SetCellAlignment( row, 1, wxALIGN_LEFT, wxALIGN_CENTRE ); + + // Render the Visible column as a check box + m_fieldGrid->SetCellEditor( row, 2, new wxGridCellBoolEditor() ); + m_fieldGrid->SetCellRenderer( row, 2, new wxGridCellBoolRenderer() ); + m_fieldGrid->SetCellAlignment( row, 2, wxALIGN_CENTRE, wxALIGN_CENTRE ); + } + m_fieldGrid->AutoSizeRows(); + m_fieldGrid->Thaw(); + + return true; } -void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event ) +bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromWindow() { - // Update the data + UI - copyPanelToSelected(); - RefreshTemplateFieldView(); - SelectTemplateField( selectedField ); - - event.Skip(); -} - -void DIALOG_EESCHEMA_OPTIONS::OnEnterKey( wxCommandEvent& event ) -{ - // Process the event produced when the user presses enter key - // in template fieldname text control or template fieldvalue text control - // Validate the current name or value, and switch focus to the other param - // (value or name) - copyPanelToSelected(); - RefreshTemplateFieldView(); - - if( fieldNameTextCtrl->HasFocus() ) - fieldDefaultValueTextCtrl->SetFocus(); - else - fieldNameTextCtrl->SetFocus(); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnVisibleFieldClick( wxCommandEvent& event ) -{ - // Process the event produced when the user click on - // the check box which controls the field visibility - copyPanelToSelected(); - RefreshTemplateFieldView(); -} - -void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void ) -{ - if( !fieldSelectionValid( selectedField ) ) - return; - - // Update the panel data from the selected template field - fieldNameTextCtrl->SetValue( templateFields[selectedField].m_Name ); - fieldDefaultValueTextCtrl->SetValue( templateFields[selectedField].m_Value ); - fieldVisibleCheckbox->SetValue( templateFields[selectedField].m_Visible ); -} - - -void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event ) -{ - // Before getting the new field data, make sure we save the old! - copyPanelToSelected(); - - // Now update the selected field and copy the data from the field to the - // edit panel - selectedField = event.GetIndex(); - copySelectedToPanel(); + for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) + { + templateFields[row].m_Name = m_fieldGrid->GetCellValue( row, 0 ); + templateFields[row].m_Value = m_fieldGrid->GetCellValue( row, 1 ); + templateFields[row].m_Visible = ( m_fieldGrid->GetCellValue( row, 2 ) != wxEmptyString ); + } + return true; } @@ -347,18 +262,8 @@ void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFie // Set the template fields object templateFields = aFields; - // select the last field ( will set selectedField to -1 if no field ): - selectedField = templateFields.size()-1; - // Build and refresh the view - RefreshTemplateFieldView(); - - if( selectedField >= 0 ) - { - copySelectedToPanel(); - SelectTemplateField( selectedField ); - } - + TransferDataToWindow(); } diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index 71d575bcad..828d1b04bd 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -40,33 +40,6 @@ protected: /** @brief The template fieldnames for this dialog */ TEMPLATE_FIELDNAMES templateFields; - /** @brief The current row selected in the template fieldname wxListCtrl which is also in the - * edit panel - * selectedField = -1 when no valid item selected - */ - int selectedField; - - /** @brief return true if aFieldId is a valid field selection - */ - bool fieldSelectionValid( int aFieldId ) - { - return ( aFieldId >= 0 ) && ( aFieldId < int( templateFields.size() ) ); - } - - /** - * Function OnEnterKey (virtual) - * Process the wxWidgets @a event produced when the user presses enter key - * in template fieldname text control or template fieldvalue text control - */ - void OnEnterKey( wxCommandEvent& event ); - - /** - * Function OnVisibleFieldClick (virtual) - * Process the wxWidgets @a event produced when the user click on - * the check box which controls the field visibility - */ - void OnVisibleFieldClick( wxCommandEvent& event ); - /** * Function OnAddButtonClick * Process the wxWidgets @a event produced when the user presses the Add buton for the @@ -90,65 +63,16 @@ protected: void OnDeleteButtonClick( wxCommandEvent& event ); /** - * Function OnEditControlKillFocus - * This Focus Event Handler should be connected to any controls in the template field edit box - * so that any loss of focus results in the data being saved to the currently selected template - * field - * - * @param event The wxWidgets produced event information - * - * Copies data from the edit box to the selected field template + * Function TransferDataToWindow + * Transfer data into the GUI. */ - void OnEditControlKillFocus( wxFocusEvent& event ); + bool TransferDataToWindow(); /** - * Function copyPanelToSelected - * Copies the data from the edit panel to the selected template fieldname + * Function TransferDataFromWindow + * Transfer data out of the GUI. */ - 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 ); - - /** - * 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 ); - - /** - * 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 ); + bool TransferDataFromWindow(); public: /** diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index 0a9ffe2ac8..2e6bf12272 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -13,11 +13,6 @@ 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 ) - EVT_LIST_ITEM_SELECTED( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnTemplateFieldSelected ) - EVT_TEXT_ENTER( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnEnterKey ) - EVT_TEXT_ENTER( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnEnterKey ) - EVT_CHECKBOX( wxID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnVisibleFieldClick ) 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() @@ -292,39 +287,39 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx wxBoxSizer* bSizer11; bSizer11 = new wxBoxSizer( wxVERTICAL ); - templateFieldListCtrl = new wxListView( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); - templateFieldListCtrl->SetMinSize( wxSize( 500,-1 ) ); + m_fieldGrid = new wxGrid( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer11->Add( templateFieldListCtrl, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); + // Grid + m_fieldGrid->CreateGrid( 0, 3 ); + m_fieldGrid->EnableEditing( true ); + m_fieldGrid->EnableGridLines( true ); + m_fieldGrid->EnableDragGridSize( false ); + m_fieldGrid->SetMargins( 0, 0 ); - wxFlexGridSizer* fgSizer4; - fgSizer4 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer4->AddGrowableCol( 1 ); - fgSizer4->SetFlexibleDirection( wxBOTH ); - fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + // Columns + m_fieldGrid->SetColSize( 0, 150 ); + m_fieldGrid->SetColSize( 1, 150 ); + m_fieldGrid->SetColSize( 2, 75 ); + m_fieldGrid->EnableDragColMove( false ); + m_fieldGrid->EnableDragColSize( true ); + m_fieldGrid->SetColLabelSize( 30 ); + m_fieldGrid->SetColLabelValue( 0, _("Name") ); + m_fieldGrid->SetColLabelValue( 1, _("Default Value") ); + m_fieldGrid->SetColLabelValue( 2, _("Visible") ); + m_fieldGrid->SetColLabelValue( 3, _("Name") ); + m_fieldGrid->SetColLabelValue( 4, wxEmptyString ); + m_fieldGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - fieldNameLabel = new wxStaticText( m_panel2, wxID_ANY, _("Na&me"), wxDefaultPosition, wxDefaultSize, 0 ); - fieldNameLabel->Wrap( -1 ); - fgSizer4->Add( fieldNameLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + // Rows + m_fieldGrid->EnableDragRowSize( true ); + m_fieldGrid->SetRowLabelSize( 80 ); + m_fieldGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - fieldNameTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); - fgSizer4->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + // Label Appearance - fieldDefaultValueLabel = new wxStaticText( m_panel2, wxID_ANY, _("Defa&ult Value"), wxDefaultPosition, wxDefaultSize, 0 ); - fieldDefaultValueLabel->Wrap( -1 ); - fgSizer4->Add( fieldDefaultValueLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - - fieldDefaultValueTextCtrl = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); - fgSizer4->Add( fieldDefaultValueTextCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - fieldVisibleCheckbox = new wxCheckBox( m_panel2, wxID_ANY, _("&Visible"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer4->Add( fieldVisibleCheckbox, 0, wxALL, 5 ); - - - fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer11->Add( fgSizer4, 0, wxEXPAND, 5 ); + // Cell Defaults + m_fieldGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + bSizer11->Add( m_fieldGrid, 1, wxALL|wxEXPAND, 5 ); bSizer6->Add( bSizer11, 1, wxEXPAND, 5 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 7184f15632..fbbb3fc5d5 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -4326,11 +4326,11 @@ bSizer11 wxVERTICAL none - - 8 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP + + 5 + wxALL|wxEXPAND 1 - + 1 1 1 @@ -4339,33 +4339,58 @@ + 0 + 0 1 + + + wxALIGN_LEFT + + wxALIGN_TOP 0 1 + wxALIGN_CENTRE + 30 + "Name" "Default Value" "Visible" "Name" "" + wxALIGN_CENTRE + 3 + 150,150,75 1 0 Dock 0 Left + 0 + 1 + 0 + 1 + 1 1 1 + + 1 0 0 wxID_ANY + + + + 0 + 0 0 0 - 500,-1 + 1 - templateFieldListCtrl + m_fieldGrid 1 @@ -4373,22 +4398,55 @@ 1 Resizable + wxALIGN_CENTRE + 80 + + wxALIGN_CENTRE + + 0 1 - wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES - wxListView; + 0 - - wxFILTER_NONE - wxDefaultValidator - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4396,26 +4454,6 @@ - - - - - - - - - - - - - - - OnTemplateFieldDeselected - - - - OnTemplateFieldSelected - @@ -4431,470 +4469,6 @@ - - 5 - wxEXPAND - 0 - - 2 - wxBOTH - 1 - - 0 - - fgSizer4 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Na&me - - 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 - - wxTE_PROCESS_ENTER - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnEnterKey - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Defa&ult 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 - - wxTE_PROCESS_ENTER - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnEnterKey - - - - - - - 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 - - - - - - OnVisibleFieldClick - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index b4a2663265..2cd29b6b7d 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -12,7 +12,6 @@ #include #include class DIALOG_SHIM; -class wxListView; #include "dialog_shim.h" #include @@ -30,8 +29,7 @@ class wxListView; #include #include #include -#include -#include +#include #include #include #include @@ -50,10 +48,6 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM 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_OnEnterKey( wxCommandEvent& event ){ OnEnterKey( event ); } - void _wxFB_OnVisibleFieldClick( wxCommandEvent& event ){ OnVisibleFieldClick( event ); } void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } @@ -115,12 +109,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkMiddleButtonPanLimited; wxCheckBox* m_checkAutoPan; wxPanel* m_panel2; - wxListView* templateFieldListCtrl; - wxStaticText* fieldNameLabel; - wxTextCtrl* fieldNameTextCtrl; - wxStaticText* fieldDefaultValueLabel; - wxTextCtrl* fieldDefaultValueTextCtrl; - wxCheckBox* fieldVisibleCheckbox; + wxGrid* m_fieldGrid; wxButton* addFieldButton; wxButton* deleteFieldButton; wxStdDialogButtonSizer* m_sdbSizer; @@ -131,10 +120,6 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM 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 OnEnterKey( wxCommandEvent& event ) { event.Skip(); } - virtual void OnVisibleFieldClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); }