KiCad PCB EDA Suite
dialog_symbol_fields_table_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Oct 26 2018)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
15 {
16  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
17 
18  wxBoxSizer* bMainSizer;
19  bMainSizer = new wxBoxSizer( wxVERTICAL );
20 
21  m_splitterMainWindow = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME );
22  m_splitterMainWindow->SetMinimumPaneSize( 200 );
23 
24  m_leftPanel = new wxPanel( m_splitterMainWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
25  wxBoxSizer* bLeftSizer;
26  bLeftSizer = new wxBoxSizer( wxVERTICAL );
27 
28  wxBoxSizer* bGroupSizer;
29  bGroupSizer = new wxBoxSizer( wxHORIZONTAL );
30 
31  m_groupSymbolsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 );
32  m_groupSymbolsBox->SetValue(true);
33  m_groupSymbolsBox->SetToolTip( _("Group symbols together based on common properties") );
34 
35  bGroupSizer->Add( m_groupSymbolsBox, 0, wxALL|wxEXPAND, 5 );
36 
37 
38  bGroupSizer->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
39 
40  m_bRefresh = new wxBitmapButton( m_leftPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
41  m_bRefresh->SetMinSize( wxSize( 30,30 ) );
42 
43  bGroupSizer->Add( m_bRefresh, 0, wxALIGN_CENTER_VERTICAL, 5 );
44 
45 
46  bLeftSizer->Add( bGroupSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 2 );
47 
48  m_fieldsCtrl = new wxDataViewListCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
49  m_fieldsCtrl->SetMinSize( wxSize( -1,220 ) );
50 
51  bLeftSizer->Add( m_fieldsCtrl, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
52 
53  m_addFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Add Field..."), wxDefaultPosition, wxDefaultSize, 0 );
54  bLeftSizer->Add( m_addFieldButton, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
55 
56 
57  m_leftPanel->SetSizer( bLeftSizer );
58  m_leftPanel->Layout();
59  bLeftSizer->Fit( m_leftPanel );
60  m_rightPanel = new wxPanel( m_splitterMainWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
61  wxBoxSizer* bRightSizer;
62  bRightSizer = new wxBoxSizer( wxVERTICAL );
63 
64  m_grid = new WX_GRID( m_rightPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
65 
66  // Grid
67  m_grid->CreateGrid( 5, 5 );
68  m_grid->EnableEditing( true );
69  m_grid->EnableGridLines( true );
70  m_grid->EnableDragGridSize( false );
71  m_grid->SetMargins( 0, 0 );
72 
73  // Columns
74  m_grid->EnableDragColMove( true );
75  m_grid->EnableDragColSize( true );
76  m_grid->SetColLabelSize( 20 );
77  m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
78 
79  // Rows
80  m_grid->EnableDragRowSize( false );
81  m_grid->SetRowLabelSize( 0 );
82  m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
83 
84  // Label Appearance
85 
86  // Cell Defaults
87  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
88  m_grid->SetMinSize( wxSize( 400,240 ) );
89 
90  bRightSizer->Add( m_grid, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
91 
92 
93  m_rightPanel->SetSizer( bRightSizer );
94  m_rightPanel->Layout();
95  bRightSizer->Fit( m_rightPanel );
96  m_splitterMainWindow->SplitVertically( m_leftPanel, m_rightPanel, -1 );
97  bMainSizer->Add( m_splitterMainWindow, 1, wxALL|wxEXPAND, 5 );
98 
99  wxBoxSizer* bButtonsSizer;
100  bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
101 
102 
103  bButtonsSizer->Add( 0, 0, 1, wxEXPAND, 5 );
104 
105  m_buttonApply = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 );
106  bButtonsSizer->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
107 
108  m_sdbSizer = new wxStdDialogButtonSizer();
109  m_sdbSizerOK = new wxButton( this, wxID_OK );
110  m_sdbSizer->AddButton( m_sdbSizerOK );
111  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
112  m_sdbSizer->AddButton( m_sdbSizerCancel );
113  m_sdbSizer->Realize();
114 
115  bButtonsSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
116 
117 
118  bMainSizer->Add( bButtonsSizer, 0, wxEXPAND, 5 );
119 
120 
121  this->SetSizer( bMainSizer );
122  this->Layout();
123  bMainSizer->Fit( this );
124 
125  this->Centre( wxBOTH );
126 
127  // Connect Events
128  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnClose ) );
129  m_groupSymbolsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnGroupSymbolsToggled ), NULL, this );
130  m_bRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this );
131  m_fieldsCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnColumnItemToggled ), NULL, this );
132  m_fieldsCtrl->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSizeFieldList ), NULL, this );
133  m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnAddField ), NULL, this );
134  m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableValueChanged ), NULL, this );
135  m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableCellClick ), NULL, this );
136  m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableCellClick ), NULL, this );
137  m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableItemContextMenu ), NULL, this );
138  m_grid->Connect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableColSize ), NULL, this );
139  m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this );
140  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this );
141 }
142 
144 {
145  // Disconnect Events
146  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnClose ) );
147  m_groupSymbolsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnGroupSymbolsToggled ), NULL, this );
148  m_bRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnRegroupSymbols ), NULL, this );
149  m_fieldsCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnColumnItemToggled ), NULL, this );
150  m_fieldsCtrl->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSizeFieldList ), NULL, this );
151  m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnAddField ), NULL, this );
152  m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableValueChanged ), NULL, this );
153  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableCellClick ), NULL, this );
154  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableCellClick ), NULL, this );
155  m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableItemContextMenu ), NULL, this );
156  m_grid->Disconnect( wxEVT_GRID_COL_SIZE, wxGridSizeEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnTableColSize ), NULL, this );
157  m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnSaveAndContinue ), NULL, this );
158  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SYMBOL_FIELDS_TABLE_BASE::OnCancel ), NULL, this );
159 
160 }
virtual void OnAddField(wxCommandEvent &event)
virtual void OnSaveAndContinue(wxCommandEvent &event)
virtual void OnColumnItemToggled(wxDataViewEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
virtual void OnGroupSymbolsToggled(wxCommandEvent &event)
virtual void OnSizeFieldList(wxSizeEvent &event)
virtual void OnTableValueChanged(wxGridEvent &event)
#define NULL
#define OPT_GROUP_COMPONENTS
#define _(s)
virtual void OnCancel(wxCommandEvent &event)
virtual void OnRegroupSymbols(wxCommandEvent &event)
virtual void OnTableColSize(wxGridSizeEvent &event)
DIALOG_SYMBOL_FIELDS_TABLE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Symbol Fields Table"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER)
virtual void OnTableItemContextMenu(wxGridEvent &event)
virtual void OnClose(wxCloseEvent &event)
virtual void OnTableCellClick(wxGridEvent &event)
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
Definition: wx_grid.cpp:53