KiCad PCB EDA Suite
dialog_sheet_properties_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_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 )
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 
82  bButtonSize->Add( m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
83 
84  m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
85  m_bpMoveUp->SetToolTip( _("Move up") );
86 
87  bButtonSize->Add( m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
88 
89  m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
90  m_bpMoveDown->SetToolTip( _("Move down") );
91 
92  bButtonSize->Add( m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
93 
94 
95  bButtonSize->Add( 20, 0, 0, wxEXPAND, 10 );
96 
97  m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
98  m_bpDelete->SetToolTip( _("Delete field") );
99 
100  bButtonSize->Add( m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
101 
102 
103  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
104 
105 
106  sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
107 
108 
109  m_longForm->Add( sbFields, 1, wxALL|wxEXPAND, 5 );
110 
111  wxBoxSizer* bSizer5;
112  bSizer5 = new wxBoxSizer( wxHORIZONTAL );
113 
114  wxStaticBoxSizer* sbSizer2;
115  sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Style") ), wxHORIZONTAL );
116 
117  m_borderWidthLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Border width:"), wxDefaultPosition, wxDefaultSize, 0 );
118  m_borderWidthLabel->Wrap( -1 );
119  sbSizer2->Add( m_borderWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
120 
121  m_borderWidthCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
122  sbSizer2->Add( m_borderWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 );
123 
124  m_borderWidthUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
125  m_borderWidthUnits->Wrap( -1 );
126  sbSizer2->Add( m_borderWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
127 
128 
129  sbSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
130 
131  m_borderColorLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Border color:"), wxDefaultPosition, wxDefaultSize, 0 );
132  m_borderColorLabel->Wrap( -1 );
133  sbSizer2->Add( m_borderColorLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
134 
135  m_borderSwatch = new COLOR_SWATCH( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
136  m_borderSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
137  m_borderSwatch->SetMinSize( wxSize( 48,24 ) );
138 
139  sbSizer2->Add( m_borderSwatch, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
140 
141 
142  sbSizer2->Add( 40, 0, 1, wxEXPAND, 5 );
143 
144  m_backgroundColorLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Background fill:"), wxDefaultPosition, wxDefaultSize, 0 );
145  m_backgroundColorLabel->Wrap( -1 );
146  sbSizer2->Add( m_backgroundColorLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
147 
148  m_backgroundSwatch = new COLOR_SWATCH( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
149  m_backgroundSwatch->SetMinSize( wxSize( 48,24 ) );
150 
151  sbSizer2->Add( m_backgroundSwatch, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
152 
153 
154  bSizer5->Add( sbSizer2, 1, wxEXPAND|wxBOTTOM, 5 );
155 
156 
157  m_longForm->Add( bSizer5, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
158 
159 
160  mainSizer->Add( m_longForm, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
161 
162  wxBoxSizer* bSizer6;
163  bSizer6 = new wxBoxSizer( wxHORIZONTAL );
164 
165  m_pageNumberStaticText = new wxStaticText( this, wxID_ANY, _("Page number:"), wxDefaultPosition, wxDefaultSize, 0 );
166  m_pageNumberStaticText->Wrap( -1 );
167  bSizer6->Add( m_pageNumberStaticText, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
168 
169  m_pageNumberTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
170  bSizer6->Add( m_pageNumberTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
171 
172 
173  bSizer6->Add( 0, 0, 3, wxEXPAND, 5 );
174 
175 
176  mainSizer->Add( bSizer6, 0, wxALL|wxEXPAND, 5 );
177 
178  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
179  mainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
180 
181  wxBoxSizer* bSizerBottom;
182  bSizerBottom = new wxBoxSizer( wxHORIZONTAL );
183 
184  m_hierarchicalPathLabel = new wxStaticText( this, wxID_ANY, _("Hierarchical path:"), wxDefaultPosition, wxDefaultSize, 0 );
185  m_hierarchicalPathLabel->Wrap( -1 );
186  bSizerBottom->Add( m_hierarchicalPathLabel, 1, wxLEFT|wxALIGN_CENTER_VERTICAL, 10 );
187 
188  m_stdDialogButtonSizer = new wxStdDialogButtonSizer();
189  m_stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
191  m_stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
193  m_stdDialogButtonSizer->Realize();
194 
195  bSizerBottom->Add( m_stdDialogButtonSizer, 0, wxEXPAND, 5 );
196 
197 
198  mainSizer->Add( bSizerBottom, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
199 
200 
201  this->SetSizer( mainSizer );
202  this->Layout();
203  mainSizer->Fit( this );
204 
205  // Connect Events
206  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnInitDlg ) );
207  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnUpdateUI ) );
208  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
209  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnAddField ), NULL, this );
210  m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnMoveUp ), NULL, this );
211  m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnMoveDown ), NULL, this );
212  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnDeleteField ), NULL, this );
213 }
214 
216 {
217  // Disconnect Events
218  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnInitDlg ) );
219  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnUpdateUI ) );
220  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnSizeGrid ), NULL, this );
221  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnAddField ), NULL, this );
222  m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnMoveUp ), NULL, this );
223  m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnMoveDown ), NULL, this );
224  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SHEET_PROPERTIES_BASE::OnDeleteField ), NULL, this );
225 
226 }
virtual void OnInitDlg(wxInitDialogEvent &event)
virtual void OnMoveUp(wxCommandEvent &event)
virtual void OnAddField(wxCommandEvent &event)
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
virtual void OnSizeGrid(wxSizeEvent &event)
virtual void OnDeleteField(wxCommandEvent &event)
virtual void OnUpdateUI(wxUpdateUIEvent &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)
#define NULL
#define _(s)
wxStdDialogButtonSizer * m_stdDialogButtonSizer
virtual void OnMoveDown(wxCommandEvent &event)
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
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:53