KiCad PCB EDA Suite
dialog_fields_editor_global_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 30 2017)
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_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 )
15 {
16  this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
17 
18  wxBoxSizer* bMainSizer;
19  bMainSizer = new wxBoxSizer( wxVERTICAL );
20 
21  m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE );
22  m_splitter1->SetMinimumPaneSize( 200 );
23 
24  m_leftPanel = new wxPanel( m_splitter1, 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_groupComponentsBox = new wxCheckBox( m_leftPanel, OPT_GROUP_COMPONENTS, _("Group symbols"), wxDefaultPosition, wxDefaultSize, 0 );
32  m_groupComponentsBox->SetValue(true);
33  m_groupComponentsBox->SetToolTip( _("Group components together based on common properties") );
34 
35  bGroupSizer->Add( m_groupComponentsBox, 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, 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, wxALL|wxBOTTOM|wxEXPAND|wxTOP, 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, wxALL|wxEXPAND, 5 );
52 
53  m_addFieldButton = new wxButton( m_leftPanel, wxID_ANY, _("Add Field..."), wxDefaultPosition, wxDefaultSize, 0 );
54  bLeftSizer->Add( m_addFieldButton, 0, wxALL|wxEXPAND, 5 );
55 
56 
57  m_leftPanel->SetSizer( bLeftSizer );
58  m_leftPanel->Layout();
59  bLeftSizer->Fit( m_leftPanel );
60  m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
61  wxBoxSizer* bRightSizer;
62  bRightSizer = new wxBoxSizer( wxVERTICAL );
63 
64  m_grid = new WX_GRID( m_panel4, 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_CENTRE, wxALIGN_CENTRE );
78 
79  // Rows
80  m_grid->EnableDragRowSize( false );
81  m_grid->SetRowLabelSize( 0 );
82  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
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, wxALL|wxEXPAND, 5 );
91 
92 
93  m_panel4->SetSizer( bRightSizer );
94  m_panel4->Layout();
95  bRightSizer->Fit( m_panel4 );
96  m_splitter1->SplitVertically( m_leftPanel, m_panel4, -1 );
97  bMainSizer->Add( m_splitter1, 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_button1 = new wxButton( this, wxID_ANY, _("Apply, Save Schematic && Continue"), wxDefaultPosition, wxDefaultSize, 0 );
106  bButtonsSizer->Add( m_button1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
107 
108  m_sdbSizer1 = new wxStdDialogButtonSizer();
109  m_sdbSizer1OK = new wxButton( this, wxID_OK );
110  m_sdbSizer1->AddButton( m_sdbSizer1OK );
111  m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
112  m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
113  m_sdbSizer1->Realize();
114 
115  bButtonsSizer->Add( m_sdbSizer1, 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_FIELDS_EDITOR_GLOBAL_BASE::OnClose ) );
129  m_groupComponentsBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this );
130  m_bRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this );
131  m_fieldsCtrl->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this );
132  m_fieldsCtrl->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this );
133  m_addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnAddField ), NULL, this );
134  m_grid->Connect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this );
135  m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
136  m_grid->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
137  m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this );
138  m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this );
139  m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this );
140 }
141 
143 {
144  // Disconnect Events
145  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnClose ) );
146  m_groupComponentsBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnGroupComponentsToggled ), NULL, this );
147  m_bRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnRegroupComponents ), NULL, this );
148  m_fieldsCtrl->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnColumnItemToggled ), NULL, this );
149  m_fieldsCtrl->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSizeFieldList ), NULL, this );
150  m_addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnAddField ), NULL, this );
151  m_grid->Disconnect( wxEVT_GRID_CELL_CHANGED, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableValueChanged ), NULL, this );
152  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
153  m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableCellClick ), NULL, this );
154  m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnTableItemContextMenu ), NULL, this );
155  m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnSaveAndContinue ), NULL, this );
156  m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIELDS_EDITOR_GLOBAL_BASE::OnCancel ), NULL, this );
157 
158 }
virtual void OnSaveAndContinue(wxCommandEvent &event)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:82
virtual void OnColumnItemToggled(wxDataViewEvent &event)
virtual void OnCancel(wxCommandEvent &event)
#define OPT_GROUP_COMPONENTS
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)
virtual void OnRegroupComponents(wxCommandEvent &event)
virtual void OnGroupComponentsToggled(wxCommandEvent &event)
virtual void OnAddField(wxCommandEvent &event)
virtual void OnTableItemContextMenu(wxGridEvent &event)
virtual void OnSizeFieldList(wxSizeEvent &event)
virtual void OnTableValueChanged(wxGridEvent &event)
virtual void OnTableCellClick(wxGridEvent &event)
virtual void OnClose(wxCloseEvent &event)