17DIALOG_FIELD_PROPERTIES_BASE::DIALOG_FIELD_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 )
19 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
21 wxBoxSizer* bMainSizer;
22 bMainSizer =
new wxBoxSizer( wxVERTICAL );
24 wxBoxSizer* bPropertiesSizer;
25 bPropertiesSizer =
new wxBoxSizer( wxVERTICAL );
27 wxBoxSizer* bUpperBoxSizer;
28 bUpperBoxSizer =
new wxBoxSizer( wxVERTICAL );
30 wxBoxSizer* bTextValueBoxSizer;
31 bTextValueBoxSizer =
new wxBoxSizer( wxHORIZONTAL );
33 m_textLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Text:"), wxDefaultPosition, wxDefaultSize, 0 );
35 bTextValueBoxSizer->Add(
m_textLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
37 m_TextCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
38 bTextValueBoxSizer->Add(
m_TextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
40 m_StyledTextCtrl =
new wxStyledTextCtrl(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
54 m_StyledTextCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT(
"BLACK") ) );
55 m_StyledTextCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT(
"WHITE") ) );
56 m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
57 m_StyledTextCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT(
"BLACK") ) );
58 m_StyledTextCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT(
"WHITE") ) );
60 m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
61 m_StyledTextCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT(
"BLACK") ) );
62 m_StyledTextCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT(
"WHITE") ) );
63 m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
64 m_StyledTextCtrl->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT(
"BLACK") ) );
65 m_StyledTextCtrl->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT(
"WHITE") ) );
66 m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
67 m_StyledTextCtrl->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
68 m_StyledTextCtrl->SetSelBackground(
true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
69 m_StyledTextCtrl->SetSelForeground(
true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
75 m_unitLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Unit:"), wxDefaultPosition, wxDefaultSize, 0 );
77 bTextValueBoxSizer->Add(
m_unitLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
79 wxArrayString m_unitChoiceChoices;
80 m_unitChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitChoiceChoices, 0 );
82 bTextValueBoxSizer->Add(
m_unitChoice, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
85 bUpperBoxSizer->Add( bTextValueBoxSizer, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
87 m_note =
new wxStaticText(
this, wxID_ANY,
_(
"(%s)"), wxDefaultPosition, wxDefaultSize, 0 );
89 bUpperBoxSizer->Add(
m_note, 0, wxBOTTOM|wxRIGHT|wxLEFT, 10 );
92 bPropertiesSizer->Add( bUpperBoxSizer, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
95 bSizer9 =
new wxBoxSizer( wxHORIZONTAL );
97 m_visible =
new wxCheckBox(
this, wxID_ANY,
_(
"Visible"), wxDefaultPosition, wxDefaultSize, 0 );
98 bSizer9->Add(
m_visible, 0, wxALIGN_LEFT|wxBOTTOM, 5 );
101 bSizer9->Add( 0, 0, 1, wxEXPAND, 5 );
103 m_nameVisible =
new wxCheckBox(
this, wxID_ANY,
_(
"Show field name"), wxDefaultPosition, wxDefaultSize, 0 );
105 m_nameVisible->SetToolTip(
_(
"Show the field name in addtion to its value") );
110 bSizer9->Add( 0, 0, 1, wxEXPAND, 5 );
112 m_cbAllowAutoPlace =
new wxCheckBox(
this, wxID_ANY,
_(
"Allow automatic placement"), wxDefaultPosition, wxDefaultSize, 0 );
115 m_cbAllowAutoPlace->SetToolTip(
_(
"Allow automatic placement of this field in the schematic") );
120 bPropertiesSizer->Add( bSizer9, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
122 wxGridBagSizer* gbSizer1;
123 gbSizer1 =
new wxGridBagSizer( 3, 0 );
124 gbSizer1->SetFlexibleDirection( wxBOTH );
125 gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
126 gbSizer1->SetEmptyCellSize( wxSize( -1,10 ) );
128 m_fontLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Font:"), wxDefaultPosition, wxDefaultSize, 0 );
130 gbSizer1->Add(
m_fontLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
132 wxString m_fontCtrlChoices[] = {
_(
"Default Font"),
_(
"KiCad Font") };
133 int m_fontCtrlNChoices =
sizeof( m_fontCtrlChoices ) /
sizeof( wxString );
134 m_fontCtrl =
new FONT_CHOICE(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 );
136 gbSizer1->Add(
m_fontCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxEXPAND, 5 );
138 wxBoxSizer* formattingSizer;
139 formattingSizer =
new wxBoxSizer( wxHORIZONTAL );
141 m_separator1 =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
144 formattingSizer->Add(
m_separator1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
146 m_bold =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
147 m_bold->SetToolTip(
_(
"Bold") );
149 formattingSizer->Add(
m_bold, 0, wxALIGN_CENTER_VERTICAL, 5 );
151 m_italic =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
154 formattingSizer->Add(
m_italic, 0, wxALIGN_CENTER_VERTICAL, 5 );
156 m_separator2 =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
159 formattingSizer->Add(
m_separator2, 0, wxALIGN_CENTER_VERTICAL, 5 );
161 m_hAlignLeft =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
164 formattingSizer->Add(
m_hAlignLeft, 0, wxALIGN_CENTER_VERTICAL, 5 );
169 formattingSizer->Add(
m_hAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
171 m_hAlignRight =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
174 formattingSizer->Add(
m_hAlignRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
176 m_separator3 =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
179 formattingSizer->Add(
m_separator3, 0, wxALIGN_CENTER_VERTICAL, 5 );
181 m_vAlignTop =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
184 formattingSizer->Add(
m_vAlignTop, 0, wxALIGN_CENTER_VERTICAL, 5 );
189 formattingSizer->Add(
m_vAlignCenter, 0, wxALIGN_CENTER_VERTICAL, 5 );
194 formattingSizer->Add(
m_vAlignBottom, 0, wxALIGN_CENTER_VERTICAL, 5 );
196 m_separator4 =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
199 formattingSizer->Add(
m_separator4, 0, wxALIGN_CENTER_VERTICAL, 5 );
201 m_horizontal =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
204 formattingSizer->Add(
m_horizontal, 0, wxALIGN_CENTER_VERTICAL, 5 );
206 m_vertical =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
209 formattingSizer->Add(
m_vertical, 0, wxALIGN_CENTER_VERTICAL, 5 );
211 m_separator5 =
new BITMAP_BUTTON(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
214 formattingSizer->Add(
m_separator5, 0, wxALIGN_CENTER_VERTICAL, 5 );
217 gbSizer1->Add( formattingSizer, wxGBPosition( 0, 3 ), wxGBSpan( 1, 2 ), wxEXPAND, 5 );
219 m_textSizeLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
221 gbSizer1->Add(
m_textSizeLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
223 wxBoxSizer* bSizer71;
224 bSizer71 =
new wxBoxSizer( wxHORIZONTAL );
226 m_textSizeCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
229 m_textSizeUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
231 bSizer71->Add(
m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
233 m_textColorLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Color:"), wxDefaultPosition, wxDefaultSize, 0 );
238 bSizer71->Add( 5, 0, 0, 0, 5 );
240 m_panelBorderColor1 =
new wxPanel(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
241 wxBoxSizer* bSizer22;
242 bSizer22 =
new wxBoxSizer( wxVERTICAL );
245 bSizer22->Add(
m_textColorSwatch, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
254 gbSizer1->Add( bSizer71, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxEXPAND, 5 );
256 m_xPosLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Position X:"), wxDefaultPosition, wxDefaultSize, 0 );
258 gbSizer1->Add(
m_xPosLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
260 m_xPosCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
261 gbSizer1->Add(
m_xPosCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
263 m_xPosUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
265 gbSizer1->Add(
m_xPosUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
267 m_yPosLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Position Y:"), wxDefaultPosition, wxDefaultSize, 0 );
269 gbSizer1->Add(
m_yPosLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
271 m_yPosCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
272 gbSizer1->Add(
m_yPosCtrl, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
274 m_yPosUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
276 gbSizer1->Add(
m_yPosUnits, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
278 m_commonToAllUnits =
new wxCheckBox(
this, wxID_ANY,
_(
"Common to all units"), wxDefaultPosition, wxDefaultSize, 0 );
279 gbSizer1->Add(
m_commonToAllUnits, wxGBPosition( 3, 4 ), wxGBSpan( 1, 1 ), wxRIGHT, 5 );
281 m_commonToAllBodyStyles =
new wxCheckBox(
this, wxID_ANY,
_(
"Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
285 bPropertiesSizer->Add( gbSizer1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
287 wxFlexGridSizer* fgSizer3;
288 fgSizer3 =
new wxFlexGridSizer( 5, 4, 3, 3 );
289 fgSizer3->SetFlexibleDirection( wxBOTH );
290 fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
293 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
296 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
299 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
302 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
305 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
308 bPropertiesSizer->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
310 wxBoxSizer* bBottomtBoxSizer;
311 bBottomtBoxSizer =
new wxBoxSizer( wxVERTICAL );
314 bPropertiesSizer->Add( bBottomtBoxSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
317 bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
329 this->SetSizer( bMainSizer );
331 bMainSizer->Fit(
this );
A simple color swatch of the kind used to set layer colors.
wxCheckBox * m_nameVisible
STD_BITMAP_BUTTON * m_TextValueSelectButton
BITMAP_BUTTON * m_separator5
BITMAP_BUTTON * m_separator2
wxStaticText * m_unitLabel
BITMAP_BUTTON * m_hAlignLeft
wxStaticText * m_fontLabel
virtual void OnSetFocusText(wxFocusEvent &event)
wxStaticText * m_yPosLabel
DIALOG_FIELD_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Text Item Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_vertical
wxStaticText * m_textSizeUnits
BITMAP_BUTTON * m_vAlignBottom
BITMAP_BUTTON * m_horizontal
BITMAP_BUTTON * m_separator1
wxStyledTextCtrl * m_StyledTextCtrl
BITMAP_BUTTON * m_hAlignRight
virtual void OnCloseDialog(wxCloseEvent &event)
wxButton * m_sdbSizerButtonsOK
~DIALOG_FIELD_PROPERTIES_BASE()
wxCheckBox * m_cbAllowAutoPlace
COLOR_SWATCH * m_textColorSwatch
wxStaticText * m_textSizeLabel
wxStaticText * m_xPosUnits
BITMAP_BUTTON * m_separator3
wxStaticText * m_textLabel
wxStdDialogButtonSizer * m_sdbSizerButtons
wxStaticText * m_yPosUnits
BITMAP_BUTTON * m_vAlignTop
wxCheckBox * m_commonToAllUnits
wxStaticText * m_xPosLabel
virtual void onMultiLineTCLostFocus(wxFocusEvent &event)
wxButton * m_sdbSizerButtonsCancel
wxTextCtrl * m_textSizeCtrl
virtual void OnTextValueSelectButtonClick(wxCommandEvent &event)
wxCheckBox * m_commonToAllBodyStyles
wxStaticText * m_textColorLabel
BITMAP_BUTTON * m_separator4
wxPanel * m_panelBorderColor1
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...