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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
26
27#include <wx/valnum.h>
28#include <wx/hyperlink.h>
29
31#include <widgets/font_choice.h>
33#include <confirm.h>
34#include <board_commit.h>
35#include <board.h>
36#include <pcb_barcode.h>
37#include <footprint.h>
38#include <pcb_text.h>
39#include <project.h>
40#include <pcb_edit_frame.h>
42#include <scintilla_tricks.h>
43#include <string_utils.h>
44
45
48 m_frame( aParent ),
49 m_item( aText ),
55 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr )
56{
57 wxString title;
58
59 // Configure display origin transforms
60 if( m_item->GetParentFootprint() )
61 {
62 m_posX.SetCoordType( ORIGIN_TRANSFORMS::REL_X_COORD );
63 m_posY.SetCoordType( ORIGIN_TRANSFORMS::REL_Y_COORD );
64 }
65 else
66 {
67 m_posX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD );
68 m_posY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD );
69 }
70
71 m_MultiLineText->SetEOLMode( wxSTC_EOL_LF );
72
73#ifdef _WIN32
74 // Without this setting, on Windows, some esoteric unicode chars create display issue
75 // in a wxStyledTextCtrl.
76 // for SetTechnology() info, see https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY
77 m_MultiLineText->SetTechnology( wxSTC_TECHNOLOGY_DIRECTWRITE );
78#endif
79
81 m_MultiLineText, wxT( "{}" ), false,
82 // onAcceptFn
83 [this]( wxKeyEvent& aEvent )
84 {
85 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
86 },
87 // onCharFn
88 [this]( wxStyledTextEvent& aEvent )
89 {
90 m_scintillaTricks->DoTextVarAutocomplete(
91 // getTokensFn
92 [this]( const wxString& xRef, wxArrayString* tokens )
93 {
94 m_frame->GetContextualTextVars( m_item, xRef, tokens );
95 } );
96 } );
97
98 // A hack which causes Scintilla to auto-size the text editor canvas
99 // See: https://github.com/jacobslusser/ScintillaNET/issues/216
100 m_MultiLineText->SetScrollWidth( 1 );
101 m_MultiLineText->SetScrollWidthTracking( true );
102
103 // Add syntax help hyperlink
104 m_syntaxHelp = new wxHyperlinkCtrl( this, wxID_ANY, _( "Syntax help" ), wxEmptyString, wxDefaultPosition,
105 wxDefaultSize, wxHL_DEFAULT_STYLE );
106 m_syntaxHelp->SetToolTip( _( "Show syntax help window" ) );
107 m_MultiLineSizer->Add( m_syntaxHelp, 0, wxBOTTOM | wxRIGHT | wxLEFT, 3 );
108
109 m_syntaxHelp->Bind( wxEVT_HYPERLINK, &DIALOG_TEXT_PROPERTIES::onSyntaxHelp, this );
110
111 m_helpWindow = nullptr;
112
113 if( m_item->GetParentFootprint() )
114 {
115 m_PositionXLabel->SetLabel( _( "Offset X:" ) );
116 m_PositionYLabel->SetLabel( _( "Offset Y:" ) );
117
118 if( m_item->Type() == PCB_FIELD_T )
119 {
120 PCB_FIELD* field = static_cast<PCB_FIELD*>( m_item );
121
122 if( field->IsReference() )
123 {
124 title = _( "Footprint Reference Properties" );
125 m_TextLabel->SetLabel( _( "Reference:" ) );
126 }
127 else if( field->IsValue() )
128 {
129 title = _( "Footprint Value Properties" );
130 m_TextLabel->SetLabel( _( "Value:" ) );
131 }
132 else
133 {
134 title = _( "Footprint Field Properties" );
135 m_TextLabel->SetLabel( _( "Text:" ) );
136 }
137 }
138 else
139 {
140 title = _( "Footprint Text Properties" );
141 m_TextLabel->SetLabel( _( "Text:" ) );
142 m_Visible->Show( false );
143 }
144
146 m_MultiLineSizer->Show( false );
147
148 // Do not allow locking items in the footprint editor
149 m_cbLocked->Show( false );
150
154 }
155 else
156 {
157 title = _( "Text Properties" );
158
160 m_SingleLineSizer->Show( false );
161
162 m_Visible->Show( false );
163 m_KeepUpright->Show( false );
164 m_statusLine->Show( false );
165
169 }
170
171 m_bold->SetIsCheckButton();
173 m_italic->SetIsCheckButton();
175
176 m_separator1->SetIsSeparator();
177
178 m_alignLeft->SetIsRadioButton();
180 m_alignCenter->SetIsRadioButton();
182 m_alignRight->SetIsRadioButton();
184
185 m_separator2->SetIsSeparator();
186
187 m_valignBottom->SetIsRadioButton();
189 m_valignCenter->SetIsRadioButton();
191 m_valignTop->SetIsRadioButton();
193
194 m_separator3->SetIsSeparator();
195
196 m_mirrored->SetIsCheckButton();
198
199 m_autoTextThickness->SetIsCheckButton();
201
202 SetTitle( title );
203 m_hash_key = title;
204
205 // Configure the layers list selector. Note that footprints are built outside the current
206 // board and so we may need to show all layers if the text is on an unactivated layer.
207 if( !m_frame->GetBoard()->IsLayerEnabled( m_item->GetLayer() ) )
208 m_LayerSelectionCtrl->ShowNonActivatedLayers( true );
209
210 m_LayerSelectionCtrl->SetLayersHotkeys( false );
211 m_LayerSelectionCtrl->SetBoardFrame( m_frame );
212 m_LayerSelectionCtrl->Resync();
213
215 m_orientation.SetPrecision( 3 );
216
217 // Set predefined rotations in combo dropdown, according to the locale floating point
218 // separator notation
219 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
220
221 for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii )
222 m_OrientCtrl->SetString( ii, wxString::Format( wxT( "%.1f" ), rot_list[ii] ) );
223
224 // Set font sizes
225 m_statusLine->SetFont( KIUI::GetInfoFont( this ) );
226
228
229 // wxTextCtrls fail to generate wxEVT_CHAR events when the wxTE_MULTILINE flag is set,
230 // so we have to listen to wxEVT_CHAR_HOOK events instead.
231 Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
232
234}
235
236
238{
239 Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
240
241 delete m_scintillaTricks;
242 m_scintillaTricks = nullptr;
243
244 if( m_helpWindow )
245 m_helpWindow->Destroy();
246}
247
248
250{
251 DIALOG_TEXT_PROPERTIES dlg( this, aText );
252
253 // QuasiModal required for Scintilla auto-complete
254 dlg.ShowQuasiModal();
255}
256
257
258void DIALOG_TEXT_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
259{
260 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
261 {
262#ifdef __WXGTK__
263 // Force an update of the text control before setting the text selection
264 // This is needed because GTK seems to ignore the selection on first update
265 //
266 // Note that we can't do this on OSX as it tends to provoke Apple's
267 // "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
268 // bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
269 m_SingleLineText->Update();
270#endif
271 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
272 }
273 else
274 m_SingleLineText->SetSelection( -1, -1 );
275
276 event.Skip();
277}
278
279
281{
282 BOARD* board = m_frame->GetBoard();
283 FOOTPRINT* parentFP = m_item->GetParentFootprint();
284 wxString text = m_item->GetText();
285
286 // show text variable cross-references in a human-readable format
288
289 if( m_SingleLineText->IsShown() )
290 {
291 m_SingleLineText->SetValue( text );
292
293 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
294 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
295 else
296 m_SingleLineText->SetSelection( -1, -1 );
297 }
298 else if( m_MultiLineText->IsShown() )
299 {
300 m_MultiLineText->SetValue( text );
301 m_MultiLineText->SetSelection( -1, -1 );
302 m_MultiLineText->EmptyUndoBuffer();
303 }
304
305 if( parentFP )
306 {
307 m_statusLine->SetLabel( wxString::Format(
308 _( "Footprint %s (%s), %s, rotated %.1f deg" ), parentFP->GetReference(), parentFP->GetValue(),
309 parentFP->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ),
310 parentFP->GetOrientation().AsDegrees() ) );
311 }
312 else
313 {
314 m_statusLine->Show( false );
315 }
316
317 m_cbLocked->SetValue( m_item->IsLocked() );
318
319 m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
320 m_cbKnockout->SetValue( m_item->IsKnockout() );
321
322 m_fontCtrl->SetFontSelection( m_item->GetFont() );
323
324 m_textWidth.SetValue( m_item->GetTextSize().x );
325 m_textHeight.SetValue( m_item->GetTextSize().y );
326
327 if( m_item->GetAutoThickness() )
328 {
329 m_autoTextThickness->Check( m_item->GetAutoThickness() );
330 m_thickness.SetValue( m_item->GetEffectiveTextPenWidth() );
331 m_thickness.Enable( false );
332 }
333 else
334 {
335 m_thickness.SetValue( m_item->GetTextThickness() );
336 }
337
338 m_posX.SetValue( m_item->GetFPRelativePosition().x );
339 m_posY.SetValue( m_item->GetFPRelativePosition().y );
340
341 if( m_Visible->IsShown() )
342 m_Visible->SetValue( m_item->IsVisible() );
343
344 if( m_KeepUpright->IsShown() )
345 m_KeepUpright->SetValue( m_item->IsKeepUpright() );
346
347 m_bold->Check( m_item->IsBold() );
348 m_italic->Check( m_item->IsItalic() );
349
350 switch( m_item->GetHorizJustify() )
351 {
352 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check( true ); break;
353 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check( true ); break;
354 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check( true ); break;
356 }
357
358 switch( m_item->GetVertJustify() )
359 {
360 case GR_TEXT_V_ALIGN_BOTTOM: m_valignBottom->Check( true ); break;
361 case GR_TEXT_V_ALIGN_CENTER: m_valignCenter->Check( true ); break;
362 case GR_TEXT_V_ALIGN_TOP: m_valignTop->Check( true ); break;
364 }
365
366 m_mirrored->Check( m_item->IsMirrored() );
367
368 EDA_ANGLE orientation = m_item->GetTextAngle();
369 m_orientation.SetAngleValue( orientation.Normalize180() );
370
371 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
372}
373
374
375void DIALOG_TEXT_PROPERTIES::onFontSelected( wxCommandEvent& aEvent )
376{
377 if( KIFONT::FONT::IsStroke( aEvent.GetString() ) )
378 {
379 m_thickness.Show( true );
380 m_autoTextThickness->Show( true );
381
382 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
383 int thickness = m_thickness.GetValue();
384
385 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
386 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
387 }
388 else
389 {
390 m_thickness.Show( false );
391 m_autoTextThickness->Show( false );
392 }
393}
394
395
396void DIALOG_TEXT_PROPERTIES::onBoldToggle( wxCommandEvent& aEvent )
397{
398 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
399
400 if( aEvent.IsChecked() )
401 m_thickness.ChangeValue( GetPenSizeForBold( textSize ) );
402 else
403 m_thickness.ChangeValue( GetPenSizeForNormal( textSize ) );
404
405 aEvent.Skip();
406}
407
408
409void DIALOG_TEXT_PROPERTIES::onAlignButton( wxCommandEvent& aEvent )
410{
412 {
413 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
414 btn->Check( false );
415 }
416}
417
418
419void DIALOG_TEXT_PROPERTIES::onValignButton( wxCommandEvent& aEvent )
420{
422 {
423 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
424 btn->Check( false );
425 }
426}
427
428
429void DIALOG_TEXT_PROPERTIES::onThickness( wxCommandEvent& event )
430{
431 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
432 int thickness = m_thickness.GetValue();
433
434 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
435 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
436}
437
438
439void DIALOG_TEXT_PROPERTIES::onTextSize( wxCommandEvent& aEvent )
440{
441 if( m_autoTextThickness->IsChecked() )
442 {
443 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
444 int thickness;
445
446 // Calculate the "best" thickness from text size and bold option:
447 if( m_bold->IsChecked() )
448 thickness = GetPenSizeForBold( textSize );
449 else
450 thickness = GetPenSizeForNormal( textSize );
451
452 m_thickness.SetValue( thickness );
453 }
454}
455
456
458{
459 if( aEvent.IsChecked() )
460 {
461 m_autoTextThickness->Check( true );
462
463 wxCommandEvent dummy;
464 onTextSize( dummy );
465
466 m_thickness.Enable( false );
467 }
468 else
469 {
470 m_thickness.Enable( true );
471 }
472}
473
474
476{
477 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
478 return false;
479
480 int minSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
481 int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
482
483 if( !m_textWidth.Validate( minSize, maxSize ) || !m_textHeight.Validate( minSize, maxSize ) )
484 return false;
485
486 BOARD* board = m_frame->GetBoard();
487 BOARD_COMMIT commit( m_frame );
488 commit.Modify( m_item );
489
490 // If no other command in progress, prepare undo command
491 // (for a command in progress, will be made later, at the completion of command)
492 bool pushCommit = ( m_item->GetEditFlags() == 0 );
493
494 // Set IN_EDIT flag to force undo/redo/abort proper operation and avoid new calls to
495 // SaveCopyInUndoList for the same text if is moved, and then rotated, edited, etc....
496 if( !pushCommit )
498
499 // Set the new text content
500 if( m_SingleLineText->IsShown() )
501 {
502 if( !m_SingleLineText->GetValue().IsEmpty() )
503 {
504 // convert any text variable cross-references to their UUIDs
505 wxString txt = board->ConvertCrossReferencesToKIIDs( m_SingleLineText->GetValue() );
506
507 m_item->SetText( txt );
508 }
509 }
510 else if( m_MultiLineText->IsShown() )
511 {
512 if( !m_MultiLineText->GetValue().IsEmpty() )
513 {
514 // convert any text variable cross-references to their UUIDs
515 wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
516
517#ifdef __WXMAC__
518 // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting.
519 // Replace it now.
520 txt.Replace( wxT( "\r" ), wxT( "\n" ) );
521#elif defined( __WINDOWS__ )
522 // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in
523 // drawing routines so strip the \r char.
524 txt.Replace( wxT( "\r" ), wxT( "" ) );
525#endif
526 m_item->SetText( EscapeString( txt, CTX_QUOTED_STR ) );
527 }
528 }
529
530 m_item->SetLocked( m_cbLocked->GetValue() );
531
532 m_item->SetLayer( ToLAYER_ID( m_LayerSelectionCtrl->GetLayerSelection() ) );
533 m_item->SetIsKnockout( m_cbKnockout->GetValue() );
534
535 if( m_fontCtrl->HaveFontSelection() )
536 {
537 m_item->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) );
538 }
539
540 m_item->SetTextSize( VECTOR2I( m_textWidth.GetValue(), m_textHeight.GetValue() ) );
541
542 if( m_autoTextThickness->IsChecked() )
543 {
544 m_item->SetAutoThickness( true );
545 }
546 else
547 {
548 m_item->SetTextThickness( m_thickness.GetValue() );
549
550 // Test for acceptable values for thickness and size and clamp if fails
551 int maxPenWidth = ClampTextPenSize( m_item->GetTextThickness(), m_item->GetTextSize() );
552
553 if( m_item->GetTextThickness() > maxPenWidth )
554 {
555 DisplayError( this, _( "The text thickness is too large for the text size.\n"
556 "It will be clamped." ) );
557 m_item->SetTextThickness( maxPenWidth );
558 }
559 }
560
561 m_item->SetFPRelativePosition( VECTOR2I( m_posX.GetValue(), m_posY.GetValue() ) );
562 m_item->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
563
564 if( m_Visible->IsShown() )
565 m_item->SetVisible( m_Visible->GetValue() );
566
567 if( m_KeepUpright->IsShown() )
568 m_item->SetKeepUpright( m_KeepUpright->GetValue() );
569
570 m_item->SetBoldFlag( m_bold->IsChecked() );
571 m_item->SetItalicFlag( m_italic->IsChecked() );
572
573 if( m_alignLeft->IsChecked() )
574 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
575 else if( m_alignCenter->IsChecked() )
576 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
577 else
578 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
579
580 if( m_valignBottom->IsChecked() )
581 m_item->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
582 else if( m_valignCenter->IsChecked() )
583 m_item->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
584 else
585 m_item->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
586
587 m_item->SetMirrored( m_mirrored->IsChecked() );
588
589 if( pushCommit )
590 commit.Push( _( "Edit Text Properties" ) );
591
592 return true;
593}
594
595
596void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
597{
599 m_scintillaTricks->CancelAutocomplete();
600
601 event.Skip();
602}
603
604
605void DIALOG_TEXT_PROPERTIES::onSyntaxHelp( wxHyperlinkEvent& aEvent )
606{
608}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:110
@ 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:322
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:1933
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:2013
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:82
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:154
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:148
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:98
virtual void SetText(const wxString &aText)
Definition eda_text.cpp:279
EDA_ANGLE GetOrientation() const
Definition footprint.h:328
bool IsFlipped() const
Definition footprint.h:514
const wxString & GetValue() const
Definition footprint.h:763
const wxString & GetReference() const
Definition footprint.h:741
virtual bool IsStroke() const
Definition font.h:138
Common, abstract interface for edit frames.
bool IsReference() const
Definition pcb_field.h:68
bool IsValue() const
Definition pcb_field.h:69
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Display a syntax help window for text variables and expressions.
Definition pcb_text.cpp:670
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:177
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:47
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
Definition eda_text.h:48
int GetPenSizeForBold(int aTextSize)
Definition gr_text.cpp:37
int GetPenSizeForNormal(int aTextSize)
Definition gr_text.cpp:61
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:73
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition lset.cpp:737
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:90
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695