15DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
17 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
19 wxBoxSizer* bMainSizer;
20 bMainSizer =
new wxBoxSizer( wxVERTICAL );
22 wxBoxSizer* bSizerTop;
23 bSizerTop =
new wxBoxSizer( wxHORIZONTAL );
25 wxStaticBoxSizer* sbScope;
26 sbScope =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Scope") ), wxVERTICAL );
28 m_references =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Reference designators"), wxDefaultPosition, wxDefaultSize, 0 );
29 sbScope->Add( m_references, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
31 m_values =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Values"), wxDefaultPosition, wxDefaultSize, 0 );
32 sbScope->Add( m_values, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
34 m_footprintFields =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Footprint fields"), wxDefaultPosition, wxDefaultSize, 0 );
35 m_footprintFields->SetToolTip(
_(
"Footprint fields that are not the reference designator or value field") );
37 sbScope->Add( m_footprintFields, 0, wxALL, 4 );
39 m_footprintGraphics =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Footprint graphic items"), wxDefaultPosition, wxDefaultSize, 0 );
40 sbScope->Add( m_footprintGraphics, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
42 m_footprintDimensions =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Footprint dimension items"), wxDefaultPosition, wxDefaultSize, 0 );
43 sbScope->Add( m_footprintDimensions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
45 m_otherFootprintTexts =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"Other footprint text items"), wxDefaultPosition, wxDefaultSize, 0 );
46 m_otherFootprintTexts->SetToolTip(
_(
"Footprint text items not associated with a field") );
48 sbScope->Add( m_otherFootprintTexts, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
51 sbScope->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
53 m_boardGraphics =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"PCB graphic items"), wxDefaultPosition, wxDefaultSize, 0 );
54 sbScope->Add( m_boardGraphics, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
56 m_boardText =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"PCB text items"), wxDefaultPosition, wxDefaultSize, 0 );
57 sbScope->Add( m_boardText, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
59 m_boardDimensions =
new wxCheckBox( sbScope->GetStaticBox(), wxID_ANY,
_(
"PCB dimension items"), wxDefaultPosition, wxDefaultSize, 0 );
60 sbScope->Add( m_boardDimensions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 4 );
63 bSizerTop->Add( sbScope, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
65 wxStaticBoxSizer* sbFilters;
66 sbFilters =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Filters") ), wxVERTICAL );
68 wxFlexGridSizer* fgSizer2;
69 fgSizer2 =
new wxFlexGridSizer( 0, 2, 4, 0 );
70 fgSizer2->AddGrowableCol( 1 );
71 fgSizer2->SetFlexibleDirection( wxBOTH );
72 fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
74 m_layerFilterOpt =
new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY,
_(
"Filter items by layer:"), wxDefaultPosition, wxDefaultSize, 0 );
75 fgSizer2->Add( m_layerFilterOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
77 m_layerFilter =
new PCB_LAYER_BOX_SELECTOR( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
78 fgSizer2->Add( m_layerFilter, 0, wxEXPAND|wxLEFT, 5 );
81 fgSizer2->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 3 );
84 fgSizer2->Add( 0, 0, 1, wxEXPAND|wxTOP|wxBOTTOM, 3 );
86 m_referenceFilterOpt =
new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY,
_(
"Filter items by parent reference designator:"), wxDefaultPosition, wxDefaultSize, 0 );
87 fgSizer2->Add( m_referenceFilterOpt, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
89 m_referenceFilter =
new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
90 fgSizer2->Add( m_referenceFilter, 0, wxEXPAND|wxLEFT, 5 );
92 m_footprintFilterOpt =
new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY,
_(
"Filter items by parent footprint library id:"), wxDefaultPosition, wxDefaultSize, 0 );
93 fgSizer2->Add( m_footprintFilterOpt, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
95 m_footprintFilter =
new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
96 fgSizer2->Add( m_footprintFilter, 0, wxBOTTOM|wxEXPAND|wxLEFT, 5 );
98 m_selectedItemsFilter =
new wxCheckBox( sbFilters->GetStaticBox(), wxID_ANY,
_(
"Selected items only"), wxDefaultPosition, wxDefaultSize, 0 );
99 fgSizer2->Add( m_selectedItemsFilter, 0, wxALL, 5 );
102 sbFilters->Add( fgSizer2, 1, wxEXPAND|wxRIGHT, 5 );
105 bSizerTop->Add( sbFilters, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
108 bMainSizer->Add( bSizerTop, 1, wxEXPAND, 5 );
111 bMainSizer->Add( 0, 0, 0, wxTOP, 5 );
114 bMainSizer->Add( 0, 0, 0, wxTOP, 5 );
116 wxStaticBoxSizer* sbAction;
117 sbAction =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Action") ), wxVERTICAL );
119 m_setToSpecifiedValues =
new wxRadioButton( sbAction->GetStaticBox(), wxID_ANY,
_(
"Set to specified values:"), wxDefaultPosition, wxDefaultSize, 0 );
120 m_setToSpecifiedValues->SetValue(
true );
121 sbAction->Add( m_setToSpecifiedValues, 0, wxRIGHT, 5 );
123 m_specifiedValues =
new wxPanel( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
125 bSizer2 =
new wxBoxSizer( wxVERTICAL );
127 wxFlexGridSizer* fgSizer1;
128 fgSizer1 =
new wxFlexGridSizer( 0, 5, 2, 0 );
129 fgSizer1->AddGrowableCol( 1 );
130 fgSizer1->AddGrowableCol( 4 );
131 fgSizer1->SetFlexibleDirection( wxBOTH );
132 fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
134 m_LayerLabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
135 m_LayerLabel->Wrap( -1 );
136 fgSizer1->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
138 m_LayerCtrl =
new PCB_LAYER_BOX_SELECTOR( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
139 fgSizer1->Add( m_LayerCtrl, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
142 fgSizer1->Add( 0, 0, 0, wxEXPAND, 5 );
145 fgSizer1->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
147 m_visible =
new wxCheckBox( m_specifiedValues, wxID_ANY,
_(
"Visible (text only)"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
148 m_visible->SetValue(
true);
149 fgSizer1->Add( m_visible, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 120 );
151 m_lineWidthLabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
152 m_lineWidthLabel->Wrap( -1 );
153 fgSizer1->Add( m_lineWidthLabel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
155 m_LineWidthCtrl =
new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
156 fgSizer1->Add( m_LineWidthCtrl, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
158 m_lineWidthUnits =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
159 m_lineWidthUnits->Wrap( -1 );
160 fgSizer1->Add( m_lineWidthUnits, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
163 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
166 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
169 fgSizer1->Add( 0, 0, 1, wxEXPAND|wxTOP, 5 );
172 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
175 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
178 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
181 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
183 m_fontLabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Font:"), wxDefaultPosition, wxDefaultSize, 0 );
184 m_fontLabel->Wrap( -1 );
185 fgSizer1->Add( m_fontLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
187 wxString m_fontCtrlChoices[] = {
_(
"KiCad Font") };
188 int m_fontCtrlNChoices =
sizeof( m_fontCtrlChoices ) /
sizeof( wxString );
189 m_fontCtrl =
new FONT_CHOICE( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 );
190 m_fontCtrl->SetSelection( 0 );
191 fgSizer1->Add( m_fontCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
194 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
197 fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
199 m_bold =
new wxCheckBox( m_specifiedValues, wxID_ANY,
_(
"Bold"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
200 fgSizer1->Add( m_bold, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 120 );
202 m_SizeXlabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Text width:"), wxDefaultPosition, wxDefaultSize, 0 );
203 m_SizeXlabel->Wrap( -1 );
204 fgSizer1->Add( m_SizeXlabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
206 m_SizeXCtrl =
new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
207 m_SizeXCtrl->SetMinSize( wxSize( 120,-1 ) );
209 fgSizer1->Add( m_SizeXCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
211 m_SizeXunit =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
212 m_SizeXunit->Wrap( -1 );
213 fgSizer1->Add( m_SizeXunit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
216 fgSizer1->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 20 );
218 m_italic =
new wxCheckBox( m_specifiedValues, wxID_ANY,
_(
"Italic"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
219 fgSizer1->Add( m_italic, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 120 );
221 m_SizeYlabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Text height:"), wxDefaultPosition, wxDefaultSize, 0 );
222 m_SizeYlabel->Wrap( -1 );
223 fgSizer1->Add( m_SizeYlabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
225 m_SizeYCtrl =
new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
226 fgSizer1->Add( m_SizeYCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
228 m_SizeYunit =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
229 m_SizeYunit->Wrap( -1 );
230 fgSizer1->Add( m_SizeYunit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
233 fgSizer1->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 20 );
235 m_keepUpright =
new wxCheckBox( m_specifiedValues, wxID_ANY,
_(
"Keep upright"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE|wxCHK_ALLOW_3RD_STATE_FOR_USER );
236 m_keepUpright->SetValue(
true);
237 fgSizer1->Add( m_keepUpright, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 120 );
239 m_ThicknessLabel =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"Text thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
240 m_ThicknessLabel->Wrap( -1 );
241 fgSizer1->Add( m_ThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
243 m_ThicknessCtrl =
new wxTextCtrl( m_specifiedValues, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
244 fgSizer1->Add( m_ThicknessCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
246 m_ThicknessUnit =
new wxStaticText( m_specifiedValues, wxID_ANY,
_(
"unit"), wxDefaultPosition, wxDefaultSize, 0 );
247 m_ThicknessUnit->Wrap( -1 );
248 fgSizer1->Add( m_ThicknessUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
251 fgSizer1->Add( 0, 0, 0, wxEXPAND|wxLEFT|wxRIGHT, 20 );
253 m_centerOnFP =
new wxCheckBox( m_specifiedValues, wxID_ANY,
_(
"Center on footprint"), wxDefaultPosition, wxDefaultSize, 0 );
254 m_centerOnFP->SetToolTip(
_(
"Move footprint texts to the center of their parent") );
256 fgSizer1->Add( m_centerOnFP, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 120 );
259 bSizer2->Add( fgSizer1, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
262 m_specifiedValues->SetSizer( bSizer2 );
263 m_specifiedValues->Layout();
264 bSizer2->Fit( m_specifiedValues );
265 sbAction->Add( m_specifiedValues, 0, wxEXPAND|wxBOTTOM|wxLEFT, 18 );
267 m_setToLayerDefaults =
new wxRadioButton( sbAction->GetStaticBox(), wxID_ANY,
_(
"Set to layer default values:"), wxDefaultPosition, wxDefaultSize, 0 );
268 sbAction->Add( m_setToLayerDefaults, 0, wxTOP|wxBOTTOM|wxEXPAND, 5 );
270 m_grid =
new wxGrid( sbAction->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE );
273 m_grid->CreateGrid( 7, 7 );
274 m_grid->EnableEditing(
false );
275 m_grid->EnableGridLines(
true );
276 m_grid->EnableDragGridSize(
false );
277 m_grid->SetMargins( 0, 0 );
280 m_grid->SetColSize( 0, 132 );
281 m_grid->SetColSize( 1, 116 );
282 m_grid->SetColSize( 2, 116 );
283 m_grid->SetColSize( 3, 116 );
284 m_grid->SetColSize( 4, 116 );
285 m_grid->SetColSize( 5, 96 );
286 m_grid->SetColSize( 6, 96 );
287 m_grid->EnableDragColMove(
false );
288 m_grid->EnableDragColSize(
false );
289 m_grid->SetColLabelSize( 0 );
290 m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
293 m_grid->EnableDragRowSize(
false );
294 m_grid->SetRowLabelSize( 0 );
295 m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
300 m_grid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
301 m_grid->SetDefaultCellFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL,
false, wxEmptyString ) );
302 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
303 sbAction->Add( m_grid, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
306 sbAction->Add( 0, 0, 0, wxEXPAND|wxBOTTOM, 5 );
309 bMainSizer->Add( sbAction, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 );
311 m_sdbSizerButtons =
new wxStdDialogButtonSizer();
312 m_sdbSizerButtonsOK =
new wxButton(
this, wxID_OK );
313 m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
314 m_sdbSizerButtonsApply =
new wxButton(
this, wxID_APPLY );
315 m_sdbSizerButtons->AddButton( m_sdbSizerButtonsApply );
316 m_sdbSizerButtonsCancel =
new wxButton(
this, wxID_CANCEL );
317 m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
318 m_sdbSizerButtons->Realize();
320 bMainSizer->Add( m_sdbSizerButtons, 0, wxALL|wxEXPAND, 5 );
323 this->SetSizer( bMainSizer );
PCB_LAYER_BOX_SELECTOR * m_LayerCtrl
virtual void onFontSelected(wxCommandEvent &event)
wxCheckBox * m_footprintDimensions
wxStaticText * m_LayerLabel
DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Edit Text and Graphic Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnFootprintFilterText(wxCommandEvent &event)
virtual void onSpecifiedValueUpdateUI(wxUpdateUIEvent &event)
PCB_LAYER_BOX_SELECTOR * m_layerFilter
~DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE()
virtual void onActionButtonChange(wxCommandEvent &event)
virtual void OnReferenceFilterText(wxCommandEvent &event)
wxTextCtrl * m_referenceFilter
virtual void OnSizeNetclassGrid(wxSizeEvent &event)
wxCheckBox * m_keepUpright
virtual void OnLayerFilterSelect(wxCommandEvent &event)
wxRadioButton * m_setToSpecifiedValues
virtual void onDimensionItemCheckbox(wxCommandEvent &event)
wxTextCtrl * m_footprintFilter
wxCheckBox * m_boardDimensions
wxRadioButton * m_setToLayerDefaults
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Class to display a pcb layer list in a wxBitmapComboBox.