KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew/dialogs/dialog_text_properties.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
22
23#include <wx/valnum.h>
24#include <wx/hyperlink.h>
25
27#include <widgets/font_choice.h>
29#include <confirm.h>
30#include <board_commit.h>
31#include <board.h>
32#include <pcb_barcode.h>
33#include <footprint.h>
34#include <pcb_text.h>
35#include <project.h>
36#include <pcb_edit_frame.h>
38#include <scintilla_tricks.h>
39#include <string_utils.h>
40
41
44 m_frame( aParent ),
45 m_item( aText ),
51 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr )
52{
53 wxString title;
54
55 // Configure display origin transforms
56 if( m_item->GetParentFootprint() )
57 {
58 m_posX.SetCoordType( ORIGIN_TRANSFORMS::REL_X_COORD );
59 m_posY.SetCoordType( ORIGIN_TRANSFORMS::REL_Y_COORD );
60 }
61 else
62 {
63 m_posX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD );
64 m_posY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD );
65 }
66
67 m_MultiLineText->SetEOLMode( wxSTC_EOL_LF );
68
69 // Wrapping is display-only and does not insert newlines into the stored text.
70 m_MultiLineText->SetWrapMode( wxSTC_WRAP_WORD );
71 m_MultiLineText->SetWrapVisualFlags( wxSTC_WRAPVISUALFLAG_END );
72 m_MultiLineText->SetWrapIndentMode( wxSTC_WRAPINDENT_INDENT );
73
74#ifdef _WIN32
75 // Without this setting, on Windows, some esoteric unicode chars create display issue
76 // in a wxStyledTextCtrl.
77 // for SetTechnology() info, see https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY
78 m_MultiLineText->SetTechnology( wxSTC_TECHNOLOGY_DIRECTWRITE );
79#endif
80
82 m_MultiLineText, wxT( "{}" ), false,
83 // onAcceptFn
84 [this]( wxKeyEvent& aEvent )
85 {
86 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
87 },
88 // onCharFn
89 [this]( wxStyledTextEvent& aEvent )
90 {
91 m_scintillaTricks->DoTextVarAutocomplete(
92 // getTokensFn
93 [this]( const wxString& xRef, wxArrayString* tokens )
94 {
95 m_frame->GetContextualTextVars( m_item, xRef, tokens );
96 } );
97 } );
98
99 // A hack which causes Scintilla to auto-size the text editor canvas
100 // See: https://github.com/jacobslusser/ScintillaNET/issues/216
101 m_MultiLineText->SetScrollWidth( 1 );
102 m_MultiLineText->SetScrollWidthTracking( true );
103
104 // Add syntax help hyperlink
105 m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _( "Syntax help" ), wxEmptyString, wxDefaultPosition,
106 wxDefaultSize, wxHL_DEFAULT_STYLE );
107 m_syntaxHelp->SetToolTip( _( "Show syntax help window" ) );
108 m_MultiLineSizer->Add( m_syntaxHelp, 0, wxBOTTOM | wxRIGHT | wxLEFT, 3 );
109
110 m_syntaxHelp->Bind( wxEVT_HYPERLINK, &DIALOG_TEXT_PROPERTIES::onSyntaxHelp, this );
111
112 m_helpWindow = nullptr;
113
114 if( m_item->GetParentFootprint() )
115 {
116 m_PositionXLabel->SetLabel( _( "Offset X:" ) );
117 m_PositionYLabel->SetLabel( _( "Offset Y:" ) );
118
119 if( m_item->Type() == PCB_FIELD_T )
120 {
121 PCB_FIELD* field = static_cast<PCB_FIELD*>( m_item );
122
123 if( field->IsReference() )
124 {
125 title = _( "Footprint Reference Properties" );
126 m_TextLabel->SetLabel( _( "Reference:" ) );
127 }
128 else if( field->IsValue() )
129 {
130 title = _( "Footprint Value Properties" );
131 m_TextLabel->SetLabel( _( "Value:" ) );
132 }
133 else
134 {
135 title = _( "Footprint Field Properties" );
136 m_TextLabel->SetLabel( _( "Text:" ) );
137 }
138 }
139 else
140 {
141 title = _( "Footprint Text Properties" );
142 m_TextLabel->SetLabel( _( "Text:" ) );
143 m_Visible->Show( false );
144 }
145
147 m_MultiLineSizer->Show( false );
148
149 // Do not allow locking items in the footprint editor
150 if( m_frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
151 m_cbLocked->Show( false );
152
156 }
157 else
158 {
159 title = _( "Text Properties" );
160
162 m_SingleLineSizer->Show( false );
163
164 m_Visible->Show( false );
165 m_KeepUpright->Show( false );
166 m_statusLine->Show( false );
167
171 }
172
173 m_bold->SetIsCheckButton();
175 m_italic->SetIsCheckButton();
177
178 m_separator1->SetIsSeparator();
179
180 m_alignLeft->SetIsRadioButton();
182 m_alignCenter->SetIsRadioButton();
184 m_alignRight->SetIsRadioButton();
186
187 m_separator2->SetIsSeparator();
188
189 m_valignBottom->SetIsRadioButton();
191 m_valignCenter->SetIsRadioButton();
193 m_valignTop->SetIsRadioButton();
195
196 m_separator3->SetIsSeparator();
197
198 m_mirrored->SetIsCheckButton();
200
201 m_autoTextThickness->SetIsCheckButton();
203
204 SetTitle( title );
205 m_hash_key = title;
206
207 // Configure the layers list selector. Note that footprints are built outside the current
208 // board and so we may need to show all layers if the text is on an unactivated layer.
209 if( !m_frame->GetBoard()->IsLayerEnabled( m_item->GetLayer() ) )
210 m_LayerSelectionCtrl->ShowNonActivatedLayers( true );
211
212 m_LayerSelectionCtrl->SetLayersHotkeys( false );
213 m_LayerSelectionCtrl->SetBoardFrame( m_frame );
214 m_LayerSelectionCtrl->Resync();
215
217 m_orientation.SetPrecision( 3 );
218
219 // Set predefined rotations in combo dropdown, according to the locale floating point
220 // separator notation
221 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
222
223 for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii )
224 m_OrientCtrl->SetString( ii, wxString::Format( wxT( "%.1f" ), rot_list[ii] ) );
225
226 // Set font sizes
227 m_statusLine->SetFont( KIUI::GetInfoFont( this ) );
228
230
231 // wxTextCtrls fail to generate wxEVT_CHAR events when the wxTE_MULTILINE flag is set,
232 // so we have to listen to wxEVT_CHAR_HOOK events instead.
233 Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
234
236}
237
238
240{
241 Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
242
243 delete m_scintillaTricks;
244 m_scintillaTricks = nullptr;
245
246 if( m_helpWindow )
247 m_helpWindow->Destroy();
248}
249
250
252{
253 DIALOG_TEXT_PROPERTIES dlg( this, aText );
254
255 // QuasiModal required for Scintilla auto-complete
256 dlg.ShowQuasiModal();
257}
258
259
260void DIALOG_TEXT_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
261{
262 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
263 {
264#ifdef __WXGTK__
265 // Force an update of the text control before setting the text selection
266 // This is needed because GTK seems to ignore the selection on first update
267 //
268 // Note that we can't do this on OSX as it tends to provoke Apple's
269 // "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
270 // bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
271 m_SingleLineText->Update();
272#endif
273 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
274 }
275 else
276 m_SingleLineText->SetSelection( -1, -1 );
277
278 event.Skip();
279}
280
281
283{
284 BOARD* board = m_frame->GetBoard();
285 FOOTPRINT* parentFP = m_item->GetParentFootprint();
286 wxString text = m_item->GetText();
287
288 // show text variable cross-references in a human-readable format
290
291 if( m_SingleLineText->IsShown() )
292 {
293 m_SingleLineText->SetValue( text );
294
295 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
296 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
297 else
298 m_SingleLineText->SetSelection( -1, -1 );
299 }
300 else if( m_MultiLineText->IsShown() )
301 {
302 m_MultiLineText->SetValue( text );
303 m_MultiLineText->SetSelection( -1, -1 );
304 m_MultiLineText->EmptyUndoBuffer();
305 }
306
307 if( parentFP )
308 {
309 m_statusLine->SetLabel( wxString::Format(
310 _( "Footprint %s (%s), %s, rotated %.1f deg" ), parentFP->GetReference(), parentFP->GetValue(),
311 parentFP->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ),
312 parentFP->GetOrientation().AsDegrees() ) );
313 }
314 else
315 {
316 m_statusLine->Show( false );
317 }
318
319 m_cbLocked->SetValue( m_item->IsLocked() );
320
321 m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
322 m_cbKnockout->SetValue( m_item->IsKnockout() );
323
324 m_fontCtrl->SetFontSelection( m_item->GetFont() );
325
326 m_textWidth.SetValue( m_item->GetTextSize().x );
327 m_textHeight.SetValue( m_item->GetTextSize().y );
328
329 if( m_item->GetAutoThickness() )
330 {
331 m_autoTextThickness->Check( m_item->GetAutoThickness() );
332 m_thickness.SetValue( m_item->GetEffectiveTextPenWidth() );
333 m_thickness.Enable( false );
334 }
335 else
336 {
337 m_thickness.SetValue( m_item->GetTextThickness() );
338 }
339
340 m_posX.SetValue( m_item->GetFPRelativePosition().x );
341 m_posY.SetValue( m_item->GetFPRelativePosition().y );
342
343 if( m_Visible->IsShown() )
344 m_Visible->SetValue( m_item->IsVisible() );
345
346 if( m_KeepUpright->IsShown() )
347 m_KeepUpright->SetValue( m_item->IsKeepUpright() );
348
349 m_bold->Check( m_item->IsBold() );
350 m_italic->Check( m_item->IsItalic() );
351
352 switch( m_item->GetHorizJustify() )
353 {
354 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check( true ); break;
355 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check( true ); break;
356 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check( true ); break;
358 }
359
360 switch( m_item->GetVertJustify() )
361 {
362 case GR_TEXT_V_ALIGN_BOTTOM: m_valignBottom->Check( true ); break;
363 case GR_TEXT_V_ALIGN_CENTER: m_valignCenter->Check( true ); break;
364 case GR_TEXT_V_ALIGN_TOP: m_valignTop->Check( true ); break;
366 }
367
368 m_mirrored->Check( m_item->IsMirrored() );
369
370 EDA_ANGLE orientation = m_item->GetTextAngle();
371 m_orientation.SetAngleValue( orientation.Normalize180() );
372
373 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
374}
375
376
377void DIALOG_TEXT_PROPERTIES::onFontSelected( wxCommandEvent& aEvent )
378{
379 if( KIFONT::FONT::IsStroke( aEvent.GetString() ) )
380 {
381 m_thickness.Show( true );
382 m_autoTextThickness->Show( true );
383
384 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
385 int thickness = m_thickness.GetValue();
386
387 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
388 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
389 }
390 else
391 {
392 m_thickness.Show( false );
393 m_autoTextThickness->Show( false );
394 }
395}
396
397
398void DIALOG_TEXT_PROPERTIES::onBoldToggle( wxCommandEvent& aEvent )
399{
400 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
401
402 if( aEvent.IsChecked() )
403 m_thickness.ChangeValue( GetPenSizeForBold( textSize ) );
404 else
405 m_thickness.ChangeValue( GetPenSizeForNormal( textSize ) );
406
407 aEvent.Skip();
408}
409
410
411void DIALOG_TEXT_PROPERTIES::onAlignButton( wxCommandEvent& aEvent )
412{
414 {
415 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
416 btn->Check( false );
417 }
418}
419
420
421void DIALOG_TEXT_PROPERTIES::onValignButton( wxCommandEvent& aEvent )
422{
424 {
425 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
426 btn->Check( false );
427 }
428}
429
430
431void DIALOG_TEXT_PROPERTIES::onThickness( wxCommandEvent& event )
432{
433 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
434 int thickness = m_thickness.GetValue();
435
436 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
437 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
438}
439
440
441void DIALOG_TEXT_PROPERTIES::onTextSize( wxCommandEvent& aEvent )
442{
443 if( m_autoTextThickness->IsChecked() )
444 {
445 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
446 int thickness;
447
448 // Calculate the "best" thickness from text size and bold option:
449 if( m_bold->IsChecked() )
450 thickness = GetPenSizeForBold( textSize );
451 else
452 thickness = GetPenSizeForNormal( textSize );
453
454 m_thickness.SetValue( thickness );
455 }
456}
457
458
460{
461 if( aEvent.IsChecked() )
462 {
463 m_autoTextThickness->Check( true );
464
465 wxCommandEvent dummy;
466 onTextSize( dummy );
467
468 m_thickness.Enable( false );
469 }
470 else
471 {
472 m_thickness.Enable( true );
473 }
474}
475
476
478{
479 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
480 return false;
481
482 int minSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
483 int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
484
485 if( !m_textWidth.Validate( minSize, maxSize ) || !m_textHeight.Validate( minSize, maxSize ) )
486 return false;
487
488 BOARD* board = m_frame->GetBoard();
489 BOARD_COMMIT commit( m_frame );
490 commit.Modify( m_item );
491
492 // If no other command in progress, prepare undo command
493 // (for a command in progress, will be made later, at the completion of command)
494 bool pushCommit = ( m_item->GetEditFlags() == 0 );
495
496 // Set IN_EDIT flag to force undo/redo/abort proper operation and avoid new calls to
497 // SaveCopyInUndoList for the same text if is moved, and then rotated, edited, etc....
498 if( !pushCommit )
500
501 // Set the new text content
502 if( m_SingleLineText->IsShown() )
503 {
504 if( !m_SingleLineText->GetValue().IsEmpty() )
505 {
506 // convert any text variable cross-references to their UUIDs
507 wxString txt = board->ConvertCrossReferencesToKIIDs( m_SingleLineText->GetValue() );
508
509 m_item->SetText( txt );
510 }
511 }
512 else if( m_MultiLineText->IsShown() )
513 {
514 if( !m_MultiLineText->GetValue().IsEmpty() )
515 {
516 // convert any text variable cross-references to their UUIDs
517 wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
518
519#ifdef __WXMAC__
520 // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting.
521 // Replace it now.
522 txt.Replace( wxT( "\r" ), wxT( "\n" ) );
523#elif defined( __WINDOWS__ )
524 // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in
525 // drawing routines so strip the \r char.
526 txt.Replace( wxT( "\r" ), wxT( "" ) );
527#endif
528 m_item->SetText( EscapeString( txt, CTX_QUOTED_STR ) );
529 }
530 }
531
532 m_item->SetLocked( m_cbLocked->GetValue() );
533
534 m_item->SetLayer( ToLAYER_ID( m_LayerSelectionCtrl->GetLayerSelection() ) );
535 m_item->SetIsKnockout( m_cbKnockout->GetValue() );
536
537 if( m_fontCtrl->HaveFontSelection() )
538 {
539 m_item->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) );
540 }
541
542 m_item->SetTextSize( VECTOR2I( m_textWidth.GetValue(), m_textHeight.GetValue() ) );
543
544 if( m_autoTextThickness->IsChecked() )
545 {
546 m_item->SetAutoThickness( true );
547 }
548 else
549 {
550 m_item->SetTextThickness( m_thickness.GetValue() );
551
552 // Test for acceptable values for thickness and size and clamp if fails
553 int maxPenWidth = ClampTextPenSize( m_item->GetTextThickness(), m_item->GetTextSize() );
554
555 if( m_item->GetTextThickness() > maxPenWidth )
556 {
557 DisplayError( this, _( "The text thickness is too large for the text size.\n"
558 "It will be clamped." ) );
559 m_item->SetTextThickness( maxPenWidth );
560 }
561 }
562
563 m_item->SetFPRelativePosition( VECTOR2I( m_posX.GetValue(), m_posY.GetValue() ) );
564 m_item->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
565
566 if( m_Visible->IsShown() )
567 m_item->SetVisible( m_Visible->GetValue() );
568
569 if( m_KeepUpright->IsShown() )
570 m_item->SetKeepUpright( m_KeepUpright->GetValue() );
571
572 m_item->SetBoldFlag( m_bold->IsChecked() );
573 m_item->SetItalicFlag( m_italic->IsChecked() );
574
575 if( m_alignLeft->IsChecked() )
576 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
577 else if( m_alignCenter->IsChecked() )
578 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
579 else
580 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
581
582 if( m_valignBottom->IsChecked() )
583 m_item->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
584 else if( m_valignCenter->IsChecked() )
585 m_item->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
586 else
587 m_item->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
588
589 m_item->SetMirrored( m_mirrored->IsChecked() );
590
591 if( pushCommit )
592 commit.Push( _( "Edit Text Properties" ) );
593
594 return true;
595}
596
597
598void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
599{
601 m_scintillaTricks->CancelAutocomplete();
602
603 event.Skip();
604}
605
606
607void DIALOG_TEXT_PROPERTIES::onSyntaxHelp( wxHyperlinkEvent& aEvent )
608{
610}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:121
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
@ text_align_right
@ text_valign_top
@ text_align_left
@ text_valign_center
@ text_align_center
@ text_valign_bottom
@ edit_cmp_symb_links
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:2340
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:2420
std::vector< wxWindow * > m_tabOrder
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition dialog_shim.h:94
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void OnCharHook(wxKeyEvent &aEvt)
DIALOG_TEXT_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 OnSetFocusText(wxFocusEvent &event) override
Used to select the variant part of some text fields (for instance, the question mark or number in a r...
void onSyntaxHelp(wxHyperlinkEvent &aEvent)
void onAutoTextThickness(wxCommandEvent &aEvent) override
void onMultiLineTCLostFocus(wxFocusEvent &event) override
void onTextSize(wxCommandEvent &aEvent) override
void onFontSelected(wxCommandEvent &aEvent) override
DIALOG_TEXT_PROPERTIES(SCH_BASE_FRAME *parent, SCH_ITEM *aTextItem)
void onBoldToggle(wxCommandEvent &aEvent) override
void onThickness(wxCommandEvent &aEvent) override
void onValignButton(wxCommandEvent &aEvent) override
void onAlignButton(wxCommandEvent &aEvent) override
double AsDegrees() const
Definition eda_angle.h:116
EDA_ANGLE Normalize180()
Definition eda_angle.h:268
EDA_ITEM_FLAGS GetEditFlags() const
Definition eda_item.h:158
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:152
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:110
virtual void SetText(const wxString &aText)
Definition eda_text.cpp:265
EDA_ANGLE GetOrientation() const
Definition footprint.h:409
bool IsFlipped() const
Definition footprint.h:617
const wxString & GetValue() const
Definition footprint.h:879
const wxString & GetReference() const
Definition footprint.h:857
virtual bool IsStroke() const
Definition font.h:101
Common, abstract interface for edit frames.
bool IsReference() const
Definition pcb_field.h:66
bool IsValue() const
Definition pcb_field.h:67
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Display a syntax help window for text variables and expressions.
Definition pcb_text.cpp:874
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition confirm.cpp:192
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define _(s)
#define IN_EDIT
Item currently edited.
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
Definition eda_text.h:56
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
Definition eda_text.h:57
@ FRAME_FOOTPRINT_EDITOR
Definition frame_type.h:39
int GetPenSizeForBold(int aTextSize)
Definition gr_text.cpp:33
int GetPenSizeForNormal(int aTextSize)
Definition gr_text.cpp:57
int ClampTextPenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
Definition gr_text.cpp:69
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition lset.cpp:750
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
KICOMMON_API void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
BARCODE class definition.
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
@ CTX_QUOTED_STR
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_BOTTOM
@ GR_TEXT_V_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_CENTER
@ GR_TEXT_V_ALIGN_TOP
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:83
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683