KiCad PCB EDA Suite
dialog_sch_sheet_props_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_SCH_SHEET_PROPS_BASE::DIALOG_SCH_SHEET_PROPS_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( wxDefaultSize, wxDefaultSize );
17 
18  wxBoxSizer* mainSizer;
19  mainSizer = new wxBoxSizer( wxVERTICAL );
20 
21  m_longForm = new wxBoxSizer( wxVERTICAL );
22 
23  wxStaticBoxSizer* sbFields;
24  sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxVERTICAL );
25 
26  m_grid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
27 
28  // Grid
29  m_grid->CreateGrid( 4, 11 );
30  m_grid->EnableEditing( true );
31  m_grid->EnableGridLines( true );
32  m_grid->EnableDragGridSize( false );
33  m_grid->SetMargins( 0, 0 );
34 
35  // Columns
36  m_grid->SetColSize( 0, 72 );
37  m_grid->SetColSize( 1, 120 );
38  m_grid->SetColSize( 2, 48 );
39  m_grid->SetColSize( 3, 72 );
40  m_grid->SetColSize( 4, 72 );
41  m_grid->SetColSize( 5, 48 );
42  m_grid->SetColSize( 6, 48 );
43  m_grid->SetColSize( 7, 84 );
44  m_grid->SetColSize( 8, 84 );
45  m_grid->SetColSize( 9, 84 );
46  m_grid->SetColSize( 10, 84 );
47  m_grid->EnableDragColMove( false );
48  m_grid->EnableDragColSize( true );
49  m_grid->SetColLabelSize( 22 );
50  m_grid->SetColLabelValue( 0, _("Name") );
51  m_grid->SetColLabelValue( 1, _("Value") );
52  m_grid->SetColLabelValue( 2, _("Show") );
53  m_grid->SetColLabelValue( 3, _("H Align") );
54  m_grid->SetColLabelValue( 4, _("V Align") );
55  m_grid->SetColLabelValue( 5, _("Italic") );
56  m_grid->SetColLabelValue( 6, _("Bold") );
57  m_grid->SetColLabelValue( 7, _("Text Size") );
58  m_grid->SetColLabelValue( 8, _("Orientation") );
59  m_grid->SetColLabelValue( 9, _("X Position") );
60  m_grid->SetColLabelValue( 10, _("Y Position") );
61  m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
62 
63  // Rows
64  m_grid->EnableDragRowSize( true );
65  m_grid->SetRowLabelSize( 0 );
66  m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
67 
68  // Label Appearance
69 
70  // Cell Defaults
71  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
72  m_grid->SetMinSize( wxSize( -1,180 ) );
73 
74  sbFields->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
75 
76  wxBoxSizer* bButtonSize;
77  bButtonSize = new wxBoxSizer( wxHORIZONTAL );
78 
79  m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
80  m_bpAdd->SetToolTip( _("Add field") );
81  m_bpAdd->SetMinSize( wxSize( 30,30 ) );
82 
83  bButtonSize->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
84 
85  m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
86  m_bpMoveUp->SetToolTip( _("Move up") );
87  m_bpMoveUp->SetMinSize( wxSize( 30,30 ) );
88 
89  bButtonSize->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
90 
91  m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
92  m_bpMoveDown->SetToolTip( _("Move down") );
93  m_bpMoveDown->SetMinSize( wxSize( 30,30 ) );
94 
95  bButtonSize->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
96 
97 
98  bButtonSize->Add( 0, 0, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 );
99 
100  m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
101  m_bpDelete->SetToolTip( _("Delete field") );
102  m_bpDelete->SetMinSize( wxSize( 30,30 ) );
103 
104  bButtonSize->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
105 
106 
107  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
108 
109 
110  sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
111 
112 
113  m_longForm->Add( sbFields, 1, wxALL|wxEXPAND, 5 );
114 
115  wxBoxSizer* bSizer5;
116  bSizer5 = new wxBoxSizer( wxHORIZONTAL );
117 
118  wxStaticBoxSizer* sbSizer2;
119  sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Style") ), wxHORIZONTAL );
120 
121  m_borderWidthLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Border width:"), wxDefaultPosition, wxDefaultSize, 0 );
122  m_borderWidthLabel->Wrap( -1 );
123  sbSizer2->Add( m_borderWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
124 
125  m_borderWidthCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
126  sbSizer2->Add( m_borderWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
127 
128  m_borderWidthUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
129  m_borderWidthUnits->Wrap( -1 );
130  sbSizer2->Add( m_borderWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
131 
132 
133  sbSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
134 
135  m_borderColorLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Border color:"), wxDefaultPosition, wxDefaultSize, 0 );
136  m_borderColorLabel->Wrap( -1 );
137  sbSizer2->Add( m_borderColorLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
138 
139  m_borderColorSwatch = new COLOR_SWATCH( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
140  m_borderColorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
141  m_borderColorSwatch->SetMinSize( wxSize( 48,24 ) );
142 
143  sbSizer2->Add( m_borderColorSwatch, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
144 
145 
146  sbSizer2->Add( 40, 0, 1, wxEXPAND, 5 );
147 
148  m_backgroundColorLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Background fill:"), wxDefaultPosition, wxDefaultSize, 0 );
149  m_backgroundColorLabel->Wrap( -1 );
150  sbSizer2->Add( m_backgroundColorLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
151 
152  m_backgroundColorSwatch = new COLOR_SWATCH( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
153  m_backgroundColorSwatch->SetMinSize( wxSize( 48,24 ) );
154 
155  sbSizer2->Add( m_backgroundColorSwatch, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
156 
157 
158  bSizer5->Add( sbSizer2, 1, wxEXPAND|wxBOTTOM, 5 );
159 
160 
161  m_longForm->Add( bSizer5, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
162 
163 
164  mainSizer->Add( m_longForm, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
165 
166  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
167  mainSizer->Add( m_staticline1, 0, wxEXPAND|wxALL, 5 );
168 
169  wxBoxSizer* bSizerBottom;
170  bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
171 
172  wxFlexGridSizer* fgSizer1;
173  fgSizer1 = new wxFlexGridSizer( 0, 2, 0, 0 );
174  fgSizer1->AddGrowableCol( 1 );
175  fgSizer1->SetFlexibleDirection( wxHORIZONTAL );
176  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
177 
178  m_hiearchicalPathLabel = new wxStaticText( this, wxID_ANY, _("Hierarchical Path:"), wxDefaultPosition, wxDefaultSize, 0 );
179  m_hiearchicalPathLabel->Wrap( -1 );
180  fgSizer1->Add( m_hiearchicalPathLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
181 
182  m_heirarchyPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
183  fgSizer1->Add( m_heirarchyPath, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
184 
185  m_timestampLabel = new wxStaticText( this, wxID_ANY, _("Unique ID:"), wxDefaultPosition, wxDefaultSize, 0 );
186  m_timestampLabel->Wrap( -1 );
187  fgSizer1->Add( m_timestampLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
188 
189  m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
190  m_textCtrlTimeStamp->SetToolTip( _("Unique ID that identifies the symbol") );
191 
192  fgSizer1->Add( m_textCtrlTimeStamp, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
193 
194 
195  bSizerBottom->Add( fgSizer1, 1, wxEXPAND|wxALL, 5 );
196 
197 
198  bSizerBottom->Add( 100, 0, 0, wxEXPAND, 5 );
199 
200  m_stdDialogButtonSizer = new wxStdDialogButtonSizer();
201  m_stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
203  m_stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
205  m_stdDialogButtonSizer->Realize();
206 
207  bSizerBottom->Add( m_stdDialogButtonSizer, 0, wxEXPAND|wxALL, 5 );
208 
209 
210  mainSizer->Add( bSizerBottom, 0, wxEXPAND|wxLEFT, 5 );
211 
212 
213  this->SetSizer( mainSizer );
214  this->Layout();
215 
216  // Connect Events
217  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnInitDlg ) );
218  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnUpdateUI ) );
219  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnSizeGrid ), NULL, this );
220  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnAddField ), NULL, this );
221  m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnMoveUp ), NULL, this );
222  m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnMoveDown ), NULL, this );
223  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnDeleteField ), NULL, this );
224 }
225 
227 {
228  // Disconnect Events
229  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnInitDlg ) );
230  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnUpdateUI ) );
231  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnSizeGrid ), NULL, this );
232  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnAddField ), NULL, this );
233  m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnMoveUp ), NULL, this );
234  m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnMoveDown ), NULL, this );
235  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_SHEET_PROPS_BASE::OnDeleteField ), NULL, this );
236 
237 }
virtual void OnInitDlg(wxInitDialogEvent &event)
virtual void OnSizeGrid(wxSizeEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:84
virtual void OnDeleteField(wxCommandEvent &event)
virtual void OnAddField(wxCommandEvent &event)
#define NULL
wxStdDialogButtonSizer * m_stdDialogButtonSizer
virtual void OnMoveDown(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &event)
#define _(s)
Definition: 3d_actions.cpp:33
Class representing a simple color swatch, of the kind used to set layer colors.
Definition: color_swatch.h:38
DIALOG_SCH_SHEET_PROPS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Sheet Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(864, 440), long style=wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU)
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:47
virtual void OnMoveUp(wxCommandEvent &event)