KiCad PCB EDA Suite
pcbnew/dialogs/dialog_set_grid_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 "dialog_set_grid_base.h"
9 
11 
12 DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_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* bUpperSizer;
20  bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
21 
22  wxStaticBoxSizer* sbLeftSizer;
23  sbLeftSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Grid Origin") ), wxVERTICAL );
24 
25  wxFlexGridSizer* fgSizerGridOrigin;
26  fgSizerGridOrigin = new wxFlexGridSizer( 2, 3, 0, 0 );
27  fgSizerGridOrigin->AddGrowableCol( 1 );
28  fgSizerGridOrigin->SetFlexibleDirection( wxBOTH );
29  fgSizerGridOrigin->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
30 
31  m_staticTextGridPosX = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
32  m_staticTextGridPosX->Wrap( -1 );
33  fgSizerGridOrigin->Add( m_staticTextGridPosX, 0, wxALIGN_CENTER_VERTICAL, 5 );
34 
35  m_GridOriginXCtrl = new wxTextCtrl( sbLeftSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
36  fgSizerGridOrigin->Add( m_GridOriginXCtrl, 0, wxEXPAND|wxLEFT, 5 );
37 
38  m_TextPosXUnits = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
39  m_TextPosXUnits->Wrap( -1 );
40  fgSizerGridOrigin->Add( m_TextPosXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
41 
42  m_staticTextGridPosY = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
43  m_staticTextGridPosY->Wrap( -1 );
44  fgSizerGridOrigin->Add( m_staticTextGridPosY, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
45 
46  m_GridOriginYCtrl = new wxTextCtrl( sbLeftSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
47  fgSizerGridOrigin->Add( m_GridOriginYCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
48 
49  m_TextPosYUnits = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
50  m_TextPosYUnits->Wrap( -1 );
51  fgSizerGridOrigin->Add( m_TextPosYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
52 
53 
54  sbLeftSizer->Add( fgSizerGridOrigin, 0, wxEXPAND|wxALL, 5 );
55 
56 
57  bUpperSizer->Add( sbLeftSizer, 1, wxEXPAND|wxALL, 5 );
58 
59  wxStaticBoxSizer* sbUserGridSizer;
60  sbUserGridSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Defined Grid") ), wxVERTICAL );
61 
62  wxFlexGridSizer* fgSizer31;
63  fgSizer31 = new wxFlexGridSizer( 2, 3, 0, 0 );
64  fgSizer31->AddGrowableCol( 1 );
65  fgSizer31->SetFlexibleDirection( wxBOTH );
66  fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
67 
68  m_staticTextSizeX = new wxStaticText( sbUserGridSizer->GetStaticBox(), wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
69  m_staticTextSizeX->Wrap( -1 );
70  fgSizer31->Add( m_staticTextSizeX, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
71 
72  m_OptGridSizeX = new wxTextCtrl( sbUserGridSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
73  fgSizer31->Add( m_OptGridSizeX, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
74 
75  m_TextSizeXUnits = new wxStaticText( sbUserGridSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
76  m_TextSizeXUnits->Wrap( -1 );
77  fgSizer31->Add( m_TextSizeXUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
78 
79  m_staticTextSizeY = new wxStaticText( sbUserGridSizer->GetStaticBox(), wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
80  m_staticTextSizeY->Wrap( -1 );
81  fgSizer31->Add( m_staticTextSizeY, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
82 
83  m_OptGridSizeY = new wxTextCtrl( sbUserGridSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
84  fgSizer31->Add( m_OptGridSizeY, 0, wxEXPAND|wxLEFT, 5 );
85 
86  m_TextSizeYUnits = new wxStaticText( sbUserGridSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
87  m_TextSizeYUnits->Wrap( -1 );
88  fgSizer31->Add( m_TextSizeYUnits, 0, wxALIGN_CENTER_VERTICAL, 5 );
89 
90 
91  sbUserGridSizer->Add( fgSizer31, 0, wxEXPAND|wxALL, 5 );
92 
93 
94  bUpperSizer->Add( sbUserGridSizer, 1, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
95 
96 
97  bSizerMain->Add( bUpperSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
98 
99  wxStaticBoxSizer* sbFastSwitchSizer;
100  sbFastSwitchSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fast Switching") ), wxVERTICAL );
101 
102  wxFlexGridSizer* fgSizer3;
103  fgSizer3 = new wxFlexGridSizer( 2, 3, 0, 5 );
104  fgSizer3->AddGrowableCol( 1 );
105  fgSizer3->SetFlexibleDirection( wxBOTH );
106  fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
107 
108  m_staticTextGrid1 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("Grid 1:"), wxDefaultPosition, wxDefaultSize, 0 );
109  m_staticTextGrid1->Wrap( -1 );
110  fgSizer3->Add( m_staticTextGrid1, 0, wxALIGN_CENTER_VERTICAL, 5 );
111 
112  wxArrayString m_grid1CtrlChoices;
113  m_grid1Ctrl = new wxChoice( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_grid1CtrlChoices, 0 );
114  m_grid1Ctrl->SetSelection( 0 );
115  m_grid1Ctrl->SetMinSize( wxSize( 240,-1 ) );
116 
117  fgSizer3->Add( m_grid1Ctrl, 1, wxALL, 5 );
118 
119  m_grid1HotKey = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 );
120  m_grid1HotKey->Wrap( -1 );
121  fgSizer3->Add( m_grid1HotKey, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
122 
123  m_staticTextGrid2 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("Grid 2:"), wxDefaultPosition, wxDefaultSize, 0 );
124  m_staticTextGrid2->Wrap( -1 );
125  fgSizer3->Add( m_staticTextGrid2, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
126 
127  wxArrayString m_grid2CtrlChoices;
128  m_grid2Ctrl = new wxChoice( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_grid2CtrlChoices, 0 );
129  m_grid2Ctrl->SetSelection( 0 );
130  m_grid2Ctrl->SetMinSize( wxSize( 240,-1 ) );
131 
132  fgSizer3->Add( m_grid2Ctrl, 1, wxALL, 5 );
133 
134  m_grid2HotKey = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 );
135  m_grid2HotKey->Wrap( -1 );
136  fgSizer3->Add( m_grid2HotKey, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
137 
138 
139  sbFastSwitchSizer->Add( fgSizer3, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
140 
141 
142  bSizerMain->Add( sbFastSwitchSizer, 0, wxEXPAND|wxALL, 10 );
143 
144  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
145  bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
146 
147  wxBoxSizer* bButtonSizer;
148  bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
149 
150  m_buttonReset = new wxButton( this, wxID_ANY, _("Reset Grid Origin"), wxDefaultPosition, wxDefaultSize, 0 );
151  bButtonSizer->Add( m_buttonReset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
152 
153 
154  bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 );
155 
156  m_sdbSizer = new wxStdDialogButtonSizer();
157  m_sdbSizerOK = new wxButton( this, wxID_OK );
158  m_sdbSizer->AddButton( m_sdbSizerOK );
159  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
160  m_sdbSizer->AddButton( m_sdbSizerCancel );
161  m_sdbSizer->Realize();
162 
163  bButtonSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
164 
165 
166  bSizerMain->Add( bButtonSizer, 0, wxEXPAND|wxLEFT, 10 );
167 
168 
169  this->SetSizer( bSizerMain );
170  this->Layout();
171  bSizerMain->Fit( this );
172 
173  // Connect Events
174  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SET_GRID_BASE::OnInitDlg ) );
175  m_buttonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnResetGridOrgClick ), NULL, this );
176  m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnCancelClick ), NULL, this );
177  m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnOkClick ), NULL, this );
178 }
179 
181 {
182  // Disconnect Events
183  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SET_GRID_BASE::OnInitDlg ) );
184  m_buttonReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnResetGridOrgClick ), NULL, this );
185  m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnCancelClick ), NULL, this );
186  m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SET_GRID_BASE::OnOkClick ), NULL, this );
187 
188 }
DIALOG_SET_GRID_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Grid Settings"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:83
virtual void OnInitDlg(wxInitDialogEvent &event)
#define _(s)
virtual void OnOkClick(wxCommandEvent &event)
virtual void OnCancelClick(wxCommandEvent &event)
virtual void OnResetGridOrgClick(wxCommandEvent &event)