18DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_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 )
20 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
22 wxBoxSizer* bMainSizer;
23 bMainSizer =
new wxBoxSizer( wxVERTICAL );
31 m_labelSingleLine =
new wxStaticText(
this, wxID_ANY,
_(
"Label:"), wxDefaultPosition, wxDefaultSize, 0 );
40 m_labelCombo =
new wxStaticText(
this, wxID_ANY,
_(
"Label:"), wxDefaultPosition, wxDefaultSize, 0 );
44 m_valueCombo =
new wxComboBox(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
50 m_syntaxHelp =
new wxHyperlinkCtrl(
this, wxID_ANY,
_(
"Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
58 wxStaticBoxSizer* sbFields;
59 sbFields =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Fields") ), wxVERTICAL );
61 m_grid =
new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
64 m_grid->CreateGrid( 4, 14 );
65 m_grid->EnableEditing(
true );
66 m_grid->EnableGridLines(
true );
67 m_grid->EnableDragGridSize(
false );
68 m_grid->SetMargins( 0, 0 );
71 m_grid->SetColSize( 0, 72 );
72 m_grid->SetColSize( 1, 84 );
73 m_grid->SetColSize( 2, 48 );
74 m_grid->SetColSize( 3, 48 );
75 m_grid->SetColSize( 4, 70 );
76 m_grid->SetColSize( 5, 70 );
77 m_grid->SetColSize( 6, 48 );
78 m_grid->SetColSize( 7, 48 );
79 m_grid->SetColSize( 8, 80 );
80 m_grid->SetColSize( 9, 48 );
81 m_grid->SetColSize( 10, 80 );
82 m_grid->SetColSize( 11, 80 );
83 m_grid->SetColSize( 12, 100 );
84 m_grid->SetColSize( 13, 48 );
85 m_grid->EnableDragColMove(
false );
86 m_grid->EnableDragColSize(
true );
87 m_grid->SetColLabelValue( 0,
_(
"Name") );
88 m_grid->SetColLabelValue( 1,
_(
"Value") );
89 m_grid->SetColLabelValue( 2,
_(
"Show") );
90 m_grid->SetColLabelValue( 3,
_(
"Show Name") );
91 m_grid->SetColLabelValue( 4,
_(
"H Align") );
92 m_grid->SetColLabelValue( 5,
_(
"V Align") );
93 m_grid->SetColLabelValue( 6,
_(
"Italic") );
94 m_grid->SetColLabelValue( 7,
_(
"Bold") );
95 m_grid->SetColLabelValue( 8,
_(
"Text Size") );
96 m_grid->SetColLabelValue( 9,
_(
"Orientation") );
97 m_grid->SetColLabelValue( 10,
_(
"X Position") );
98 m_grid->SetColLabelValue( 11,
_(
"Y Position") );
99 m_grid->SetColLabelValue( 12,
_(
"Font") );
100 m_grid->SetColLabelValue( 13,
_(
"Color") );
102 m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
105 m_grid->EnableDragRowSize(
true );
106 m_grid->SetRowLabelSize( 0 );
107 m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
112 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
113 m_grid->SetMinSize( wxSize( -1,100 ) );
115 sbFields->Add(
m_grid, 1, wxALL|wxEXPAND, 5 );
117 wxBoxSizer* bButtonSize;
118 bButtonSize =
new wxBoxSizer( wxHORIZONTAL );
120 m_bpAdd =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
121 m_bpAdd->SetToolTip(
_(
"Add field") );
123 bButtonSize->Add(
m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
125 m_bpMoveUp =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
128 bButtonSize->Add(
m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
133 bButtonSize->Add(
m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
136 bButtonSize->Add( 20, 0, 0, wxEXPAND, 10 );
138 m_bpDelete =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
141 bButtonSize->Add(
m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
144 sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
147 bMainSizer->Add( sbFields, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
149 wxBoxSizer* optionsSizer;
150 optionsSizer =
new wxBoxSizer( wxHORIZONTAL );
152 m_shapeSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Shape") ), wxVERTICAL );
154 m_input =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Input"), wxDefaultPosition, wxDefaultSize, 0 );
157 m_output =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Output"), wxDefaultPosition, wxDefaultSize, 0 );
163 m_triState =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Tri-state"), wxDefaultPosition, wxDefaultSize, 0 );
166 m_passive =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Passive"), wxDefaultPosition, wxDefaultSize, 0 );
169 m_dot =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Dot"), wxDefaultPosition, wxDefaultSize, 0 );
172 m_circle =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Circle"), wxDefaultPosition, wxDefaultSize, 0 );
175 m_diamond =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Diamond"), wxDefaultPosition, wxDefaultSize, 0 );
178 m_rectangle =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Rectangle"), wxDefaultPosition, wxDefaultSize, 0 );
182 optionsSizer->Add(
m_shapeSizer, 0, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
184 wxStaticBoxSizer* formatting;
185 formatting =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Formatting") ), wxVERTICAL );
189 m_formattingGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
191 m_fontLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Font:"), wxDefaultPosition, wxDefaultSize, 0 );
195 wxString m_fontCtrlChoices[] = {
_(
"Default Font"),
_(
"KiCad Font") };
196 int m_fontCtrlNChoices =
sizeof( m_fontCtrlChoices ) /
sizeof( wxString );
197 m_fontCtrl =
new FONT_CHOICE( formatting->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 );
201 m_iconBar =
new wxBoxSizer( wxHORIZONTAL );
203 m_separator1 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
208 m_bold =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
209 m_bold->SetToolTip(
_(
"Bold") );
213 m_italic =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
218 m_separator2 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
223 m_spin0 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
226 m_spin1 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
229 m_spin2 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
232 m_spin3 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
235 m_autoRotate =
new wxCheckBox( formatting->GetStaticBox(), wxID_ANY,
_(
"Auto"), wxDefaultPosition, wxDefaultSize, 0 );
238 m_separator3 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
246 m_textSizeLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
250 wxBoxSizer* bSizer71;
251 bSizer71 =
new wxBoxSizer( wxHORIZONTAL );
253 m_textSizeCtrl =
new wxTextCtrl( formatting->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
256 m_textSizeUnits =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
258 bSizer71->Add(
m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
260 m_textColorLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Color:"), wxDefaultPosition, wxDefaultSize, 0 );
265 bSizer71->Add( 5, 0, 0, 0, 5 );
267 m_panelBorderColor1 =
new wxPanel( formatting->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
268 wxBoxSizer* bSizer22;
269 bSizer22 =
new wxBoxSizer( wxVERTICAL );
272 bSizer22->Add(
m_textColorSwatch, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
281 m_formattingGB->Add( bSizer71, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
287 optionsSizer->Add( formatting, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
290 bMainSizer->Add( optionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
299 bMainSizer->Add(
m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
302 this->SetSizer( bMainSizer );
304 bMainSizer->Fit(
this );
A simple color swatch of the kind used to set layer colors.
virtual void OnEnterKey(wxCommandEvent &event)
wxStaticText * m_textSizeLabel
wxPanel * m_panelBorderColor1
wxStaticText * m_textColorLabel
virtual void OnMoveDown(wxCommandEvent &event)
wxRadioButton * m_triState
COLOR_SWATCH * m_textColorSwatch
STD_BITMAP_BUTTON * m_bpMoveUp
wxFlexGridSizer * m_textEntrySizer
wxStaticBoxSizer * m_shapeSizer
wxRadioButton * m_diamond
BITMAP_BUTTON * m_separator3
STD_BITMAP_BUTTON * m_bpAdd
wxHyperlinkCtrl * m_syntaxHelp
wxButton * m_sdbSizer1Cancel
~DIALOG_LABEL_PROPERTIES_BASE()
wxRadioButton * m_rectangle
wxStaticText * m_labelCombo
virtual void OnMoveUp(wxCommandEvent &event)
wxComboBox * m_valueCombo
wxStaticText * m_labelSingleLine
virtual void OnFormattingHelp(wxHyperlinkEvent &event)
wxRadioButton * m_passive
DIALOG_LABEL_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Label Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
STD_BITMAP_BUTTON * m_bpMoveDown
STD_BITMAP_BUTTON * m_bpDelete
wxStdDialogButtonSizer * m_sdbSizer1
BITMAP_BUTTON * m_separator1
wxTextCtrl * m_textSizeCtrl
virtual void OnAddField(wxCommandEvent &event)
virtual void OnSizeGrid(wxSizeEvent &event)
wxCheckBox * m_autoRotate
virtual void OnUpdateUI(wxUpdateUIEvent &event)
virtual void OnValueCharHook(wxKeyEvent &event)
wxGridBagSizer * m_formattingGB
wxRadioButton * m_bidirectional
BITMAP_BUTTON * m_separator2
wxStaticText * m_fontLabel
virtual void OnDeleteField(wxCommandEvent &event)
wxTextCtrl * m_valueSingleLine
wxStaticText * m_textSizeUnits
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...