KiCad PCB EDA Suite
dialog_layer_selection_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.9.0 Apr 22 2021)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 DIALOG_LAYER_SELECTION_BASE::DIALOG_LAYER_SELECTION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bSizerUpper;
20  bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
21 
22  m_leftGridLayers = new wxGrid( this, ID_LEFT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
23 
24  // Grid
25  m_leftGridLayers->CreateGrid( 1, 3 );
26  m_leftGridLayers->EnableEditing( false );
27  m_leftGridLayers->EnableGridLines( false );
28  m_leftGridLayers->EnableDragGridSize( false );
29  m_leftGridLayers->SetMargins( 5, 3 );
30 
31  // Columns
32  m_leftGridLayers->SetColSize( 0, 24 );
33  m_leftGridLayers->SetColSize( 1, 20 );
34  m_leftGridLayers->SetColSize( 2, 72 );
35  m_leftGridLayers->EnableDragColMove( false );
36  m_leftGridLayers->EnableDragColSize( false );
37  m_leftGridLayers->SetColLabelSize( 0 );
38  m_leftGridLayers->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
39 
40  // Rows
41  m_leftGridLayers->EnableDragRowSize( false );
42  m_leftGridLayers->SetRowLabelSize( 0 );
43  m_leftGridLayers->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
44 
45  // Label Appearance
46 
47  // Cell Defaults
48  m_leftGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
49  bSizerUpper->Add( m_leftGridLayers, 1, wxALL|wxEXPAND, 5 );
50 
51  m_rightGridLayers = new wxGrid( this, ID_RIGHT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
52 
53  // Grid
54  m_rightGridLayers->CreateGrid( 1, 3 );
55  m_rightGridLayers->EnableEditing( false );
56  m_rightGridLayers->EnableGridLines( false );
57  m_rightGridLayers->EnableDragGridSize( false );
58  m_rightGridLayers->SetMargins( 5, 3 );
59 
60  // Columns
61  m_rightGridLayers->SetColSize( 0, 24 );
62  m_rightGridLayers->SetColSize( 1, 20 );
63  m_rightGridLayers->SetColSize( 2, 72 );
64  m_rightGridLayers->EnableDragColMove( false );
65  m_rightGridLayers->EnableDragColSize( false );
66  m_rightGridLayers->SetColLabelSize( 0 );
67  m_rightGridLayers->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
68 
69  // Rows
70  m_rightGridLayers->EnableDragRowSize( false );
71  m_rightGridLayers->SetRowLabelSize( 0 );
72  m_rightGridLayers->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
73 
74  // Label Appearance
75 
76  // Cell Defaults
77  m_rightGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
78  bSizerUpper->Add( m_rightGridLayers, 1, wxALL|wxEXPAND, 5 );
79 
80 
81  bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 10 );
82 
83 
84  this->SetSizer( bSizerMain );
85  this->Layout();
86  bSizerMain->Fit( this );
87 
88  this->Centre( wxBOTH );
89 
90  // Connect Events
91  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LAYER_SELECTION_BASE::OnMouseMove ) );
92  m_leftGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
93  m_leftGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
94  m_rightGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
95  m_rightGridLayers->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
96 }
97 
99 {
100  // Disconnect Events
101  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LAYER_SELECTION_BASE::OnMouseMove ) );
102  m_leftGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
103  m_leftGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
104  m_rightGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_LAYER_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
105  m_rightGridLayers->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_LAYER_SELECTION_BASE::OnLeftButtonReleased ), NULL, this );
106 
107 }
108 
109 DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
110 {
111  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
112 
113  wxBoxSizer* bSizerMain;
114  bSizerMain = new wxBoxSizer( wxVERTICAL );
115 
116  wxBoxSizer* bSizerUpper;
117  bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
118 
119  wxBoxSizer* bSizerLeft;
120  bSizerLeft = new wxBoxSizer( wxVERTICAL );
121 
122  m_staticTextTopLayer = new wxStaticText( this, wxID_ANY, _("Top/Front layer:"), wxDefaultPosition, wxDefaultSize, 0 );
123  m_staticTextTopLayer->Wrap( -1 );
124  bSizerLeft->Add( m_staticTextTopLayer, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
125 
126  m_leftGridLayers = new wxGrid( this, ID_LEFT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
127 
128  // Grid
129  m_leftGridLayers->CreateGrid( 1, 3 );
130  m_leftGridLayers->EnableEditing( false );
131  m_leftGridLayers->EnableGridLines( false );
132  m_leftGridLayers->EnableDragGridSize( false );
133  m_leftGridLayers->SetMargins( 3, 3 );
134 
135  // Columns
136  m_leftGridLayers->SetColSize( 0, 24 );
137  m_leftGridLayers->SetColSize( 1, 20 );
138  m_leftGridLayers->SetColSize( 2, 72 );
139  m_leftGridLayers->EnableDragColMove( false );
140  m_leftGridLayers->EnableDragColSize( false );
141  m_leftGridLayers->SetColLabelSize( 0 );
142  m_leftGridLayers->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
143 
144  // Rows
145  m_leftGridLayers->EnableDragRowSize( false );
146  m_leftGridLayers->SetRowLabelSize( 0 );
147  m_leftGridLayers->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
148 
149  // Label Appearance
150 
151  // Cell Defaults
152  m_leftGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
153  bSizerLeft->Add( m_leftGridLayers, 0, wxALL|wxEXPAND, 5 );
154 
155 
156  bSizerUpper->Add( bSizerLeft, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
157 
158  wxBoxSizer* bSizerRight;
159  bSizerRight = new wxBoxSizer( wxVERTICAL );
160 
161  m_staticTextBottomLayer = new wxStaticText( this, wxID_ANY, _("Bottom/Back layer:"), wxDefaultPosition, wxDefaultSize, 0 );
162  m_staticTextBottomLayer->Wrap( -1 );
163  bSizerRight->Add( m_staticTextBottomLayer, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
164 
165  m_rightGridLayers = new wxGrid( this, ID_RIGHT_LIST, wxDefaultPosition, wxDefaultSize, 0 );
166 
167  // Grid
168  m_rightGridLayers->CreateGrid( 1, 3 );
169  m_rightGridLayers->EnableEditing( false );
170  m_rightGridLayers->EnableGridLines( false );
171  m_rightGridLayers->EnableDragGridSize( false );
172  m_rightGridLayers->SetMargins( 3, 3 );
173 
174  // Columns
175  m_rightGridLayers->SetColSize( 0, 24 );
176  m_rightGridLayers->SetColSize( 1, 20 );
177  m_rightGridLayers->SetColSize( 2, 72 );
178  m_rightGridLayers->EnableDragColMove( false );
179  m_rightGridLayers->EnableDragColSize( false );
180  m_rightGridLayers->SetColLabelSize( 0 );
181  m_rightGridLayers->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
182 
183  // Rows
184  m_rightGridLayers->EnableDragRowSize( false );
185  m_rightGridLayers->SetRowLabelSize( 0 );
186  m_rightGridLayers->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
187 
188  // Label Appearance
189 
190  // Cell Defaults
191  m_rightGridLayers->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
192  bSizerRight->Add( m_rightGridLayers, 0, wxALL|wxEXPAND, 5 );
193 
194 
195  bSizerUpper->Add( bSizerRight, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
196 
197 
198  bSizerMain->Add( bSizerUpper, 1, wxALL|wxEXPAND, 5 );
199 
200  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
201  bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 );
202 
203  m_sdbSizer = new wxStdDialogButtonSizer();
204  m_sdbSizerOK = new wxButton( this, wxID_OK );
205  m_sdbSizer->AddButton( m_sdbSizerOK );
206  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
207  m_sdbSizer->AddButton( m_sdbSizerCancel );
208  m_sdbSizer->Realize();
209 
210  bSizerMain->Add( m_sdbSizer, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_RIGHT, 5 );
211 
212 
213  this->SetSizer( bSizerMain );
214  this->Layout();
215  bSizerMain->Fit( this );
216 
217  this->Centre( wxBOTH );
218 
219  // Connect Events
220  m_leftGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
221  m_rightGridLayers->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
222 }
223 
225 {
226  // Disconnect Events
227  m_leftGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::OnLeftGridCellClick ), NULL, this );
228  m_rightGridLayers->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::OnRightGridCellClick ), NULL, this );
229 
230 }
DIALOG_LAYER_SELECTION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Select Layer"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnRightGridCellClick(wxGridEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
#define ID_RIGHT_LIST
virtual void OnMouseMove(wxUpdateUIEvent &event)
virtual void OnLeftButtonReleased(wxMouseEvent &event)
#define ID_LEFT_LIST
virtual void OnRightGridCellClick(wxGridEvent &event)
virtual void OnLeftGridCellClick(wxGridEvent &event)
#define _(s)
DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Select Copper Layer Pair"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnLeftGridCellClick(wxGridEvent &event)