KiCad PCB EDA Suite
dialog_text_and_label_properties_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::DIALOG_TEXT_AND_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 )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bMainSizer;
17  bMainSizer = new wxBoxSizer( wxVERTICAL );
18 
19  m_textEntrySizer = new wxFlexGridSizer( 5, 2, 1, 3 );
20  m_textEntrySizer->AddGrowableCol( 1 );
21  m_textEntrySizer->AddGrowableRow( 1 );
22  m_textEntrySizer->SetFlexibleDirection( wxBOTH );
23  m_textEntrySizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
24 
25  m_textEntrySizer->SetMinSize( wxSize( 500,-1 ) );
26  m_labelSingleLine = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
27  m_labelSingleLine->Wrap( -1 );
28  m_labelSingleLine->SetToolTip( _("Enter the text to be used within the schematic") );
29 
30  m_textEntrySizer->Add( m_labelSingleLine, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
31 
32  m_valueSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
33  m_valueSingleLine->SetMinSize( wxSize( 360,-1 ) );
34 
35  m_textEntrySizer->Add( m_valueSingleLine, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 );
36 
37  m_labelMultiLine = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
38  m_labelMultiLine->Wrap( -1 );
39  m_textEntrySizer->Add( m_labelMultiLine, 0, wxTOP|wxRIGHT, 2 );
40 
41  m_valueMultiLine = new wxStyledTextCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN, wxEmptyString );
42  m_valueMultiLine->SetUseTabs( true );
43  m_valueMultiLine->SetTabWidth( 4 );
44  m_valueMultiLine->SetIndent( 4 );
45  m_valueMultiLine->SetTabIndents( false );
46  m_valueMultiLine->SetBackSpaceUnIndents( false );
47  m_valueMultiLine->SetViewEOL( false );
48  m_valueMultiLine->SetViewWhiteSpace( false );
49  m_valueMultiLine->SetMarginWidth( 2, 0 );
50  m_valueMultiLine->SetIndentationGuides( false );
51  m_valueMultiLine->SetReadOnly( false );
52  m_valueMultiLine->SetMarginWidth( 1, 0 );
53  m_valueMultiLine->SetMarginWidth( 0, 0 );
54  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS );
55  m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("BLACK") ) );
56  m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDER, wxColour( wxT("WHITE") ) );
57  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS );
58  m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("BLACK") ) );
59  m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPEN, wxColour( wxT("WHITE") ) );
60  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY );
61  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUS );
62  m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("BLACK") ) );
63  m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEREND, wxColour( wxT("WHITE") ) );
64  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUS );
65  m_valueMultiLine->MarkerSetBackground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("BLACK") ) );
66  m_valueMultiLine->MarkerSetForeground( wxSTC_MARKNUM_FOLDEROPENMID, wxColour( wxT("WHITE") ) );
67  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY );
68  m_valueMultiLine->MarkerDefine( wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY );
69  m_valueMultiLine->SetSelBackground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
70  m_valueMultiLine->SetSelForeground( true, wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
71  m_textEntrySizer->Add( m_valueMultiLine, 1, wxEXPAND|wxBOTTOM, 2 );
72 
73  m_labelCombo = new wxStaticText( this, wxID_ANY, _("Label:"), wxDefaultPosition, wxDefaultSize, 0 );
74  m_labelCombo->Wrap( -1 );
75  m_textEntrySizer->Add( m_labelCombo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
76 
77  m_valueCombo = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER );
78  m_valueCombo->SetMinSize( wxSize( 360,-1 ) );
79 
80  m_textEntrySizer->Add( m_valueCombo, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
81 
82  m_textSizeLabel = new wxStaticText( this, wxID_ANY, _("Text Size:"), wxDefaultPosition, wxDefaultSize, 0 );
83  m_textSizeLabel->Wrap( -1 );
84  m_textEntrySizer->Add( m_textSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 6 );
85 
86  wxBoxSizer* bSizeCtrlSizer;
87  bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
88 
89  m_textSizeCtrl = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
90  bSizeCtrlSizer->Add( m_textSizeCtrl, 0, wxBOTTOM|wxRIGHT|wxTOP, 6 );
91 
92  m_textSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
93  m_textSizeUnits->Wrap( -1 );
94  bSizeCtrlSizer->Add( m_textSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 6 );
95 
96 
97  bSizeCtrlSizer->Add( 0, 0, 1, wxEXPAND, 15 );
98 
99  m_formattingHelp = new wxHyperlinkCtrl( this, wxID_ANY, _("Syntax help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
100  m_formattingHelp->SetToolTip( _("Show syntax help window") );
101 
102  bSizeCtrlSizer->Add( m_formattingHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
103 
104 
105  m_textEntrySizer->Add( bSizeCtrlSizer, 1, wxEXPAND, 6 );
106 
107  m_note1 = new wxStaticText( this, wxID_ANY, _("Note:"), wxDefaultPosition, wxDefaultSize, 0 );
108  m_note1->Wrap( -1 );
109  m_textEntrySizer->Add( m_note1, 0, wxTOP|wxRIGHT, 2 );
110 
111  m_note2 = new wxStaticText( this, wxID_ANY, _("The margins around the text are controlled by the text offset ratio\nin Schematic Setup > General > Formatting."), wxDefaultPosition, wxDefaultSize, 0 );
112  m_note2->Wrap( -1 );
113  m_textEntrySizer->Add( m_note2, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 2 );
114 
115 
116  bMainSizer->Add( m_textEntrySizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 12 );
117 
118  wxBoxSizer* m_OptionsSizer;
119  m_OptionsSizer = new wxBoxSizer( wxHORIZONTAL );
120 
121  wxString m_TextOrientChoices[] = { _("Align right"), _("Align bottom"), _("Align left"), _("Align top") };
122  int m_TextOrientNChoices = sizeof( m_TextOrientChoices ) / sizeof( wxString );
123  m_TextOrient = new wxRadioBox( this, wxID_ANY, _("Justification"), wxDefaultPosition, wxDefaultSize, m_TextOrientNChoices, m_TextOrientChoices, 1, wxRA_SPECIFY_COLS );
124  m_TextOrient->SetSelection( 2 );
125  m_OptionsSizer->Add( m_TextOrient, 1, wxRIGHT|wxTOP|wxEXPAND, 3 );
126 
127  wxString m_TextStyleChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold and italic") };
128  int m_TextStyleNChoices = sizeof( m_TextStyleChoices ) / sizeof( wxString );
129  m_TextStyle = new wxRadioBox( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, m_TextStyleNChoices, m_TextStyleChoices, 1, wxRA_SPECIFY_COLS );
130  m_TextStyle->SetSelection( 0 );
131  m_OptionsSizer->Add( m_TextStyle, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 3 );
132 
133  wxString m_TextShapeChoices[] = { _("Input"), _("Output"), _("Bidirectional"), _("Tri-state"), _("Passive") };
134  int m_TextShapeNChoices = sizeof( m_TextShapeChoices ) / sizeof( wxString );
135  m_TextShape = new wxRadioBox( this, wxID_ANY, _("Shape"), wxDefaultPosition, wxDefaultSize, m_TextShapeNChoices, m_TextShapeChoices, 1, wxRA_SPECIFY_COLS );
136  m_TextShape->SetSelection( 0 );
137  m_OptionsSizer->Add( m_TextShape, 1, wxEXPAND|wxTOP|wxLEFT, 3 );
138 
139 
140  bMainSizer->Add( m_OptionsSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
141 
142  wxBoxSizer* bSizer4;
143  bSizer4 = new wxBoxSizer( wxHORIZONTAL );
144 
145  m_sdbSizer1 = new wxStdDialogButtonSizer();
146  m_sdbSizer1OK = new wxButton( this, wxID_OK );
147  m_sdbSizer1->AddButton( m_sdbSizer1OK );
148  m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
149  m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
150  m_sdbSizer1->Realize();
151 
152  bSizer4->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
153 
154 
155  bMainSizer->Add( bSizer4, 0, wxEXPAND|wxALL, 5 );
156 
157 
158  this->SetSizer( bMainSizer );
159  this->Layout();
160  bMainSizer->Fit( this );
161 
162  // Connect Events
163  m_valueSingleLine->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
164  m_valueMultiLine->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
165  m_valueCombo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
166  m_formattingHelp->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
167 }
168 
170 {
171  // Disconnect Events
172  m_valueSingleLine->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
173  m_valueMultiLine->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::onMultiLineTCLostFocus ), NULL, this );
174  m_valueCombo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnEnterKey ), NULL, this );
175  m_formattingHelp->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE::OnFormattingHelp ), NULL, this );
176 
177 }
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
#define _(s)
DIALOG_TEXT_AND_LABEL_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Text Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnFormattingHelp(wxHyperlinkEvent &event)