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