From dcf02f5f673cdd8671de10cb46366a80f5db50e7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 26 Apr 2018 11:09:41 +0100 Subject: [PATCH] Use a single calc-column-width-impl for Fields Editor. Also adds calculation of the initial splitter position based on the widths of the fields in the list. Fixes: lp:1737361 * https://bugs.launchpad.net/kicad/+bug/1737361 --- .../dialogs/dialog_fields_editor_global.cpp | 36 +- .../dialog_fields_editor_global_base.cpp | 295 ++- .../dialog_fields_editor_global_base.fbp | 1807 ++++++++--------- .../dialog_fields_editor_global_base.h | 158 +- 4 files changed, 1148 insertions(+), 1148 deletions(-) diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index c08e2dcebc..7993e9dad6 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -53,6 +53,12 @@ void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller ) #define SHOW_FIELD_COLUMN 1 #define GROUP_BY_COLUMN 2 +#ifdef __WXGTK__ +#define CHECKBOX_COLUMN_MARGIN 15 +#else +#define CHECKBOX_COLUMN_MARGIN 5 +#endif + #define QUANTITY_COLUMN ( GetNumberCols() - 1 ) @@ -382,20 +388,16 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent m_fieldsCtrl->AppendToggleColumn( _( "Show" ), wxDATAVIEW_CELL_ACTIVATABLE, 0, wxALIGN_CENTER, 0 ); m_fieldsCtrl->AppendToggleColumn( _( "Group By" ), wxDATAVIEW_CELL_ACTIVATABLE, 0, wxALIGN_CENTER, 0 ); -#ifdef __WXGTK__ - // GTK auto-sizing doesn't appear to take into account the column headers, which is - // where all the width is in this case. - // So calculate the title size and set the column width - m_showColWidth = GetTextSize( m_fieldsCtrl->GetColumn( 1 )->GetTitle(), m_fieldsCtrl ).x + 15; - m_groupByColWidth = GetTextSize( m_fieldsCtrl->GetColumn( 2 )->GetTitle(), m_fieldsCtrl ).x + 15; - m_fieldsCtrl->GetColumn( 1 )->SetWidth( m_showColWidth ); - m_fieldsCtrl->GetColumn( 2 )->SetWidth( m_groupByColWidth ); -#else - m_fieldsCtrl->GetColumn( 1 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); - m_fieldsCtrl->GetColumn( 2 )->SetWidth( wxCOL_WIDTH_AUTOSIZE ); - m_showColWidth = m_fieldsCtrl->GetColumn( 1 )->GetWidth(); - m_groupByColWidth = m_fieldsCtrl->GetColumn( 2 )->GetWidth(); -#endif + // GTK auto-sizing doesn't take into account the column headers, which is where all the + // width is in the checkbox column cases. So calculate the title sizes and set the column + // widths ourselves. + auto column = m_fieldsCtrl->GetColumn( SHOW_FIELD_COLUMN ); + m_showColWidth = GetTextSize( column->GetTitle(), m_fieldsCtrl ).x + CHECKBOX_COLUMN_MARGIN; + column->SetWidth( m_showColWidth ); + + column = m_fieldsCtrl->GetColumn( GROUP_BY_COLUMN ); + m_groupByColWidth = GetTextSize( column->GetTitle(), m_fieldsCtrl ).x + CHECKBOX_COLUMN_MARGIN; + column->SetWidth( m_groupByColWidth ); // The fact that we're a list should keep the control from reserving space for the // expander buttons... but it doesn't. Fix by forcing the indent to 0. @@ -405,6 +407,12 @@ DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL( SCH_EDIT_FRAME* parent LoadFieldNames(); // loads rows into m_fieldsCtrl and columns into m_dataModel + // Now that the fields are loaded we can set the initial location of the splitter + // based on the list width. + column = m_fieldsCtrl->GetColumn( FIELD_NAME_COLUMN ); + column->SetWidth( wxCOL_WIDTH_AUTOSIZE ); + m_splitter1->SetSashPosition( column->GetWidth() + m_showColWidth + m_groupByColWidth + 40 ); + m_dataModel->RebuildRows( m_groupComponentsBox, m_fieldsCtrl ); m_dataModel->Sort( 0, true ); diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.cpp b/eeschema/dialogs/dialog_fields_editor_global_base.cpp index b0c1cd46ba..44d7271ac9 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global_base.cpp @@ -1,148 +1,147 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 20 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_fields_editor_global_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_FIELDS_EDITOR_GLOBAL_BASE::DIALOG_FIELDS_EDITOR_GLOBAL_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( wxSize( -1,-1 ), wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE ); - m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::m_splitter1OnIdle ), NULL, this ); - m_splitter1->SetMinimumPaneSize( 230 ); - - m_leftPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bGroupSizer; - bGroupSizer = new wxBoxSizer( wxHORIZONTAL ); - - m_groupComponentsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 ); - m_groupComponentsBox->SetValue(true); - m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") ); - - bGroupSizer->Add( m_groupComponentsBox, 0, wxALL|wxEXPAND, 5 ); - - - bGroupSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); - m_bRefresh->SetMinSize( wxSize( 30,30 ) ); - - bGroupSizer->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bLeftSizer->Add( bGroupSizer, 0, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 2 ); - - m_fieldsCtrl = new wxDataViewListCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_fieldsCtrl->SetMinSize( wxSize( 220,220 ) ); - - bLeftSizer->Add( m_fieldsCtrl, 1, wxALL|wxEXPAND, 5 ); - - - m_leftPanel->SetSizer( bLeftSizer ); - m_leftPanel->Layout(); - bLeftSizer->Fit( m_leftPanel ); - m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - m_grid = new wxGrid( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_grid->CreateGrid( 5, 5 ); - m_grid->EnableEditing( true ); - m_grid->EnableGridLines( true ); - m_grid->EnableDragGridSize( false ); - m_grid->SetMargins( 0, 0 ); - - // Columns - m_grid->EnableDragColMove( false ); - m_grid->EnableDragColSize( true ); - m_grid->SetColLabelSize( 20 ); - m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Rows - m_grid->EnableDragRowSize( false ); - m_grid->SetRowLabelSize( 0 ); - m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - m_grid->SetMinSize( wxSize( 400,240 ) ); - - bRightSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 ); - - - m_panel4->SetSizer( bRightSizer ); - m_panel4->Layout(); - bRightSizer->Fit( m_panel4 ); - m_splitter1->SplitVertically( m_leftPanel, m_panel4, 230 ); - bMainSizer->Add( m_splitter1, 1, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bButtonsSizer; - bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - - - bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_button1 = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 ); - bButtonsSizer->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 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(); - - bButtonsSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); - - - bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 ); - - - this->SetSizer( bMainSizer ); - this->Layout(); - bMainSizer->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this ); - m_bRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this ); - m_fieldsCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this ); - m_fieldsCtrl->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this ); - m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this ); - m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); - m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); - m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); - m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnOK ), NULL, this ); -} - -DIALOG_FIELDS_EDITOR_GLOBAL_BASE::~DIALOG_FIELDS_EDITOR_GLOBAL_BASE() -{ - // Disconnect Events - m_groupComponentsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this ); - m_bRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this ); - m_fieldsCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this ); - m_fieldsCtrl->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this ); - m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this ); - m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); - m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); - m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); - m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnOK ), NULL, this ); - -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_fields_editor_global_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_FIELDS_EDITOR_GLOBAL_BASE::DIALOG_FIELDS_EDITOR_GLOBAL_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( wxSize( -1,-1 ), wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE ); + m_splitter1->SetMinimumPaneSize( 200 ); + + m_leftPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bGroupSizer; + bGroupSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_groupComponentsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 ); + m_groupComponentsBox->SetValue(true); + m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") ); + + bGroupSizer->Add( m_groupComponentsBox, 0, wxALL|wxEXPAND, 5 ); + + + bGroupSizer->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + + m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_bRefresh->SetMinSize( wxSize( 30,30 ) ); + + bGroupSizer->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bLeftSizer->Add( bGroupSizer, 0, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 2 ); + + m_fieldsCtrl = new wxDataViewListCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_fieldsCtrl->SetMinSize( wxSize( -1,220 ) ); + + bLeftSizer->Add( m_fieldsCtrl, 1, wxALL|wxEXPAND, 5 ); + + + m_leftPanel->SetSizer( bLeftSizer ); + m_leftPanel->Layout(); + bLeftSizer->Fit( m_leftPanel ); + m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + m_grid = new wxGrid( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_grid->CreateGrid( 5, 5 ); + m_grid->EnableEditing( true ); + m_grid->EnableGridLines( true ); + m_grid->EnableDragGridSize( false ); + m_grid->SetMargins( 0, 0 ); + + // Columns + m_grid->EnableDragColMove( false ); + m_grid->EnableDragColSize( true ); + m_grid->SetColLabelSize( 20 ); + m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_grid->EnableDragRowSize( false ); + m_grid->SetRowLabelSize( 0 ); + m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + m_grid->SetMinSize( wxSize( 400,240 ) ); + + bRightSizer->Add( m_grid, 1, wxALL|wxEXPAND, 5 ); + + + m_panel4->SetSizer( bRightSizer ); + m_panel4->Layout(); + bRightSizer->Fit( m_panel4 ); + m_splitter1->SplitVertically( m_leftPanel, m_panel4, -1 ); + bMainSizer->Add( m_splitter1, 1, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bButtonsSizer; + bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); + + + bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_button1 = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 ); + bButtonsSizer->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 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(); + + bButtonsSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 ); + + + bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 ); + + + this->SetSizer( bMainSizer ); + this->Layout(); + bMainSizer->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this ); + m_bRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this ); + m_fieldsCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this ); + m_fieldsCtrl->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this ); + m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this ); + m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); + m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); + m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); + m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnOK ), NULL, this ); +} + +DIALOG_FIELDS_EDITOR_GLOBAL_BASE::~DIALOG_FIELDS_EDITOR_GLOBAL_BASE() +{ + // Disconnect Events + m_groupComponentsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this ); + m_bRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this ); + m_fieldsCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this ); + m_fieldsCtrl->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this ); + m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this ); + m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this ); + m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this ); + m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this ); + m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnOK ), NULL, this ); + +} diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.fbp b/eeschema/dialogs/dialog_fields_editor_global_base.fbp index d0e82d140d..f34405a733 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.fbp +++ b/eeschema/dialogs/dialog_fields_editor_global_base.fbp @@ -1,904 +1,903 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_fields_editor_global_base - 1000 - none - - 1 - dialog_fields_editor_global_base - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_FIELDS_EDITOR_GLOBAL_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Symbol Fields - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1,-1 - bMainSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 230 - - 0 - -1,-1 - 1 - m_splitter1 - 1 - - - protected - 1 - - Resizable - 0.0 - 230 - -1 - 1 - - wxSPLIT_VERTICAL - wxSP_3DSASH|wxSP_LIVE_UPDATE - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_leftPanel - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bLeftSizer - wxVERTICAL - none - - 2 - wxALL|wxBOTTOM|wxEXPAND|wxTOP - 0 - - - bGroupSizer - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - OPT_GROUP_COMPONENTS - Group symbols - - 0 - - - 0 - - 1 - m_groupComponentsBox - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Group components together based on common properties - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnGroupComponentsToggled - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - - wxID_ANY - Refresh Grouping - - 0 - - - 0 - 30,30 - 1 - m_bRefresh - 1 - - - protected - 1 - - Resizable - - 1 - - wxBU_AUTODRAW - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRegroupComponents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - 220,220 - m_fieldsCtrl - protected - - - - - - - - - - - - - - - - - - - - - - - - - - OnColumnItemToggled - - - - - - - - - - - - - - - - - - - - - - OnSizeFieldList - - - - - - - - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_panel4 - 1 - - - protected - 1 - - Resizable - 1 - - - 0 - - - - wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - - - - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - 0 - 0 - - - - 1 - - - wxALIGN_LEFT - - wxALIGN_TOP - 0 - 1 - wxALIGN_CENTRE - 20 - - wxALIGN_CENTRE - 5 - - - 1 - 0 - Dock - 0 - Left - 0 - 1 - 0 - 0 - 1 - 1 - - 1 - - - 1 - 0 - 0 - wxID_ANY - - - - 0 - 0 - - 0 - - - 0 - 400,240 - 1 - m_grid - 1 - - - protected - 1 - - Resizable - wxALIGN_CENTRE - 0 - - wxALIGN_CENTRE - - 5 - 1 - - ; forward_declare - 0 - - - - - - - - OnTableValueChanged - - - OnTableItemContextMenu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bButtonsSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Apply, Save Schematic && Continue - - 0 - - - 0 - - 1 - m_button1 - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnSaveAndContinue - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancel - - - - OnOK - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_fields_editor_global_base + 1000 + none + 1 + dialog_fields_editor_global_base + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + -1,-1 + DIALOG_FIELDS_EDITOR_GLOBAL_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Symbol Fields + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1,-1 + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 200 + + 0 + -1,-1 + 1 + m_splitter1 + 1 + + + protected + 1 + + Resizable + 0.0 + -1 + -1 + 1 + + wxSPLIT_VERTICAL + wxSP_3DSASH|wxSP_LIVE_UPDATE + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_leftPanel + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bLeftSizer + wxVERTICAL + none + + 2 + wxALL|wxBOTTOM|wxEXPAND|wxTOP + 0 + + + bGroupSizer + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + OPT_GROUP_COMPONENTS + Group symbols + + 0 + + + 0 + + 1 + m_groupComponentsBox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Group components together based on common properties + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnGroupComponentsToggled + + + + + + + + + + + + + + + + + + + + + + + + + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + + wxID_ANY + Refresh Grouping + + 0 + + + 0 + 30,30 + 1 + m_bRefresh + 1 + + + protected + 1 + + Resizable + + 1 + + wxBU_AUTODRAW + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRegroupComponents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + + + 1 + 1 + + + 0 + wxID_ANY + + -1,220 + m_fieldsCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + OnColumnItemToggled + + + + + + + + + + + + + + + + + + + + + + OnSizeFieldList + + + + + + + + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panel4 + 1 + + + protected + 1 + + Resizable + 1 + + + 0 + + + + wxTAB_TRAVERSAL + + + + + + + + + + + + + + + + + + + + + + + + + + bRightSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTRE + 20 + + wxALIGN_CENTRE + 5 + + + 1 + 0 + Dock + 0 + Left + 0 + 1 + 0 + 0 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + 400,240 + 1 + m_grid + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTRE + 0 + + wxALIGN_CENTRE + + 5 + 1 + + ; forward_declare + 0 + + + + + + + + OnTableValueChanged + + + OnTableItemContextMenu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bButtonsSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Apply, Save Schematic && Continue + + 0 + + + 0 + + 1 + m_button1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnSaveAndContinue + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancel + + + + OnOK + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_fields_editor_global_base.h b/eeschema/dialogs/dialog_fields_editor_global_base.h index c7b95262cb..500248aba4 100644 --- a/eeschema/dialogs/dialog_fields_editor_global_base.h +++ b/eeschema/dialogs/dialog_fields_editor_global_base.h @@ -1,82 +1,76 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 20 2018) -// http://www.wxformbuilder.org/ -// -// PLEASE DO *NOT* EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ -#define __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ - -#include -#include -#include -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -#define OPT_GROUP_COMPONENTS 1000 - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_FIELDS_EDITOR_GLOBAL_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_FIELDS_EDITOR_GLOBAL_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxSplitterWindow* m_splitter1; - wxPanel* m_leftPanel; - wxCheckBox* m_groupComponentsBox; - wxBitmapButton* m_bRefresh; - wxDataViewListCtrl* m_fieldsCtrl; - wxPanel* m_panel4; - wxGrid* m_grid; - wxButton* m_button1; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - wxButton* m_sdbSizer1Cancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnGroupComponentsToggled( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRegroupComponents( wxCommandEvent& event ) { event.Skip(); } - virtual void OnColumnItemToggled( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnSizeFieldList( wxSizeEvent& event ) { event.Skip(); } - virtual void OnTableValueChanged( wxGridEvent& event ) { event.Skip(); } - virtual void OnTableItemContextMenu( wxGridEvent& event ) { event.Skip(); } - virtual void OnSaveAndContinue( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOK( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_FIELDS_EDITOR_GLOBAL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Fields"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); - ~DIALOG_FIELDS_EDITOR_GLOBAL_BASE(); - - void m_splitter1OnIdle( wxIdleEvent& ) - { - m_splitter1->SetSashPosition( 230 ); - m_splitter1->Disconnect( wxEVT_IDLE, wxIdleEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::m_splitter1OnIdle ), NULL, this ); - } - -}; - -#endif //__DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 30 2017) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ +#define __DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +#define OPT_GROUP_COMPONENTS 1000 + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_FIELDS_EDITOR_GLOBAL_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_FIELDS_EDITOR_GLOBAL_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxSplitterWindow* m_splitter1; + wxPanel* m_leftPanel; + wxCheckBox* m_groupComponentsBox; + wxBitmapButton* m_bRefresh; + wxDataViewListCtrl* m_fieldsCtrl; + wxPanel* m_panel4; + wxGrid* m_grid; + wxButton* m_button1; + wxStdDialogButtonSizer* m_sdbSizer1; + wxButton* m_sdbSizer1OK; + wxButton* m_sdbSizer1Cancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnGroupComponentsToggled( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRegroupComponents( wxCommandEvent& event ) { event.Skip(); } + virtual void OnColumnItemToggled( wxDataViewEvent& event ) { event.Skip(); } + virtual void OnSizeFieldList( wxSizeEvent& event ) { event.Skip(); } + virtual void OnTableValueChanged( wxGridEvent& event ) { event.Skip(); } + virtual void OnTableItemContextMenu( wxGridEvent& event ) { event.Skip(); } + virtual void OnSaveAndContinue( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOK( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_FIELDS_EDITOR_GLOBAL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Symbol Fields"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~DIALOG_FIELDS_EDITOR_GLOBAL_BASE(); + +}; + +#endif //__DIALOG_FIELDS_EDITOR_GLOBAL_BASE_H__