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 );
47 m_labelMultiLine =
new wxStaticText(
this, wxID_ANY,
_(
"Label:"), wxDefaultPosition, wxDefaultSize, 0 );
49 m_labelMultiLine->SetToolTip(
_(
"Enter the text to be used within the schematic") );
53 m_valueMultiLine =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
60 bSizer7 =
new wxBoxSizer( wxHORIZONTAL );
62 m_cbMultiLine =
new wxCheckBox(
this, wxID_ANY,
_(
"Multiple label input"), wxDefaultPosition, wxDefaultSize, 0 );
66 bSizer7->Add( 0, 0, 1, wxEXPAND, 5 );
68 m_syntaxHelp =
new wxHyperlinkCtrl(
this, wxID_ANY,
_(
"Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_ALIGN_RIGHT|wxHL_CONTEXTMENU );
71 bSizer7->Add(
m_syntaxHelp, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
79 wxStaticBoxSizer* sbFields;
80 sbFields =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Fields") ), wxVERTICAL );
82 m_grid =
new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
85 m_grid->CreateGrid( 4, 14 );
86 m_grid->EnableEditing(
true );
87 m_grid->EnableGridLines(
true );
88 m_grid->EnableDragGridSize(
false );
89 m_grid->SetMargins( 0, 0 );
92 m_grid->SetColSize( 0, 72 );
93 m_grid->SetColSize( 1, 84 );
94 m_grid->SetColSize( 2, 48 );
95 m_grid->SetColSize( 3, 48 );
96 m_grid->SetColSize( 4, 70 );
97 m_grid->SetColSize( 5, 70 );
98 m_grid->SetColSize( 6, 48 );
99 m_grid->SetColSize( 7, 48 );
100 m_grid->SetColSize( 8, 80 );
101 m_grid->SetColSize( 9, 48 );
102 m_grid->SetColSize( 10, 80 );
103 m_grid->SetColSize( 11, 80 );
104 m_grid->SetColSize( 12, 100 );
105 m_grid->SetColSize( 13, 48 );
106 m_grid->EnableDragColMove(
false );
107 m_grid->EnableDragColSize(
true );
108 m_grid->SetColLabelValue( 0,
_(
"Name") );
109 m_grid->SetColLabelValue( 1,
_(
"Value") );
110 m_grid->SetColLabelValue( 2,
_(
"Show") );
111 m_grid->SetColLabelValue( 3,
_(
"Show Name") );
112 m_grid->SetColLabelValue( 4,
_(
"H Align") );
113 m_grid->SetColLabelValue( 5,
_(
"V Align") );
114 m_grid->SetColLabelValue( 6,
_(
"Italic") );
115 m_grid->SetColLabelValue( 7,
_(
"Bold") );
116 m_grid->SetColLabelValue( 8,
_(
"Text Size") );
117 m_grid->SetColLabelValue( 9,
_(
"Orientation") );
118 m_grid->SetColLabelValue( 10,
_(
"X Position") );
119 m_grid->SetColLabelValue( 11,
_(
"Y Position") );
120 m_grid->SetColLabelValue( 12,
_(
"Font") );
121 m_grid->SetColLabelValue( 13,
_(
"Color") );
123 m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
126 m_grid->EnableDragRowSize(
true );
127 m_grid->SetRowLabelSize( 0 );
128 m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
133 m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
134 m_grid->SetMinSize( wxSize( -1,100 ) );
136 sbFields->Add(
m_grid, 1, wxALL|wxEXPAND, 5 );
138 wxBoxSizer* bButtonSize;
139 bButtonSize =
new wxBoxSizer( wxHORIZONTAL );
141 m_bpAdd =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
142 m_bpAdd->SetToolTip(
_(
"Add field") );
144 bButtonSize->Add(
m_bpAdd, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
146 m_bpMoveUp =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
149 bButtonSize->Add(
m_bpMoveUp, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
154 bButtonSize->Add(
m_bpMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
157 bButtonSize->Add( 20, 0, 0, wxEXPAND, 10 );
159 m_bpDelete =
new STD_BITMAP_BUTTON( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
162 bButtonSize->Add(
m_bpDelete, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
165 sbFields->Add( bButtonSize, 0, wxALL|wxEXPAND, 5 );
168 bMainSizer->Add( sbFields, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
170 wxBoxSizer* optionsSizer;
171 optionsSizer =
new wxBoxSizer( wxHORIZONTAL );
173 m_shapeSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Shape") ), wxVERTICAL );
175 m_input =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Input"), wxDefaultPosition, wxDefaultSize, 0 );
178 m_output =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Output"), wxDefaultPosition, wxDefaultSize, 0 );
184 m_triState =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Tri-state"), wxDefaultPosition, wxDefaultSize, 0 );
187 m_passive =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Passive"), wxDefaultPosition, wxDefaultSize, 0 );
190 m_dot =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Dot"), wxDefaultPosition, wxDefaultSize, 0 );
193 m_circle =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Circle"), wxDefaultPosition, wxDefaultSize, 0 );
196 m_diamond =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Diamond"), wxDefaultPosition, wxDefaultSize, 0 );
199 m_rectangle =
new wxRadioButton(
m_shapeSizer->GetStaticBox(), wxID_ANY,
_(
"Rectangle"), wxDefaultPosition, wxDefaultSize, 0 );
203 optionsSizer->Add(
m_shapeSizer, 0, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
205 wxStaticBoxSizer* formatting;
206 formatting =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Formatting") ), wxVERTICAL );
210 m_formattingGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
212 m_fontLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Font:"), wxDefaultPosition, wxDefaultSize, 0 );
216 wxString m_fontCtrlChoices[] = {
_(
"Default Font"),
_(
"KiCad Font") };
217 int m_fontCtrlNChoices =
sizeof( m_fontCtrlChoices ) /
sizeof( wxString );
218 m_fontCtrl =
new FONT_CHOICE( formatting->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fontCtrlNChoices, m_fontCtrlChoices, 0 );
222 m_iconBar =
new wxBoxSizer( wxHORIZONTAL );
224 m_separator1 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
229 m_bold =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
230 m_bold->SetToolTip(
_(
"Bold") );
234 m_italic =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
239 m_separator2 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
244 m_spin0 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
247 m_spin1 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
250 m_spin2 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
253 m_spin3 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
256 m_autoRotate =
new wxCheckBox( formatting->GetStaticBox(), wxID_ANY,
_(
"Auto"), wxDefaultPosition, wxDefaultSize, 0 );
259 m_separator3 =
new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBORDER_NONE );
267 m_textSizeLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
271 wxBoxSizer* bSizer71;
272 bSizer71 =
new wxBoxSizer( wxHORIZONTAL );
274 m_textSizeCtrl =
new wxTextCtrl( formatting->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 );
277 m_textSizeUnits =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
279 bSizer71->Add(
m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 );
281 m_textColorLabel =
new wxStaticText( formatting->GetStaticBox(), wxID_ANY,
_(
"Color:"), wxDefaultPosition, wxDefaultSize, 0 );
286 bSizer71->Add( 5, 0, 0, 0, 5 );
288 m_panelBorderColor1 =
new wxPanel( formatting->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxTAB_TRAVERSAL );
289 wxBoxSizer* bSizer22;
290 bSizer22 =
new wxBoxSizer( wxVERTICAL );
302 m_formattingGB->Add( bSizer71, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
308 optionsSizer->Add( formatting, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
311 bMainSizer->Add( optionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
320 bMainSizer->Add(
m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
323 this->SetSizer( bMainSizer );
325 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
wxStaticText * m_labelMultiLine
wxStaticBoxSizer * m_shapeSizer
wxRadioButton * m_diamond
BITMAP_BUTTON * m_separator3
wxTextCtrl * m_valueMultiLine
virtual void onMultiLabelCheck(wxCommandEvent &event)
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
wxCheckBox * m_cbMultiLine
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...