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
243 if( m_helpWindow )
244 m_helpWindow->Destroy();
245}
246
247
249{
250 DIALOG_TEXT_PROPERTIES dlg( this, aText );
251
252 // QuasiModal required for Scintilla auto-complete
253 dlg.ShowQuasiModal();
254}
255
256
257void DIALOG_TEXT_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
258{
259 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
260 {
261#ifdef __WXGTK__
262 // Force an update of the text control before setting the text selection
263 // This is needed because GTK seems to ignore the selection on first update
264 //
265 // Note that we can't do this on OSX as it tends to provoke Apple's
266 // "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
267 // bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
268 m_SingleLineText->Update();
269#endif
270 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
271 }
272 else
273 m_SingleLineText->SetSelection( -1, -1 );
274
275 event.Skip();
276}
277
278
280{
281 BOARD* board = m_frame->GetBoard();
282 FOOTPRINT* parentFP = m_item->GetParentFootprint();
283 wxString text = m_item->GetText();
284
285 // show text variable cross-references in a human-readable format
287
288 if( m_SingleLineText->IsShown() )
289 {
290 m_SingleLineText->SetValue( text );
291
292 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
293 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
294 else
295 m_SingleLineText->SetSelection( -1, -1 );
296 }
297 else if( m_MultiLineText->IsShown() )
298 {
299 m_MultiLineText->SetValue( text );
300 m_MultiLineText->SetSelection( -1, -1 );
301 m_MultiLineText->EmptyUndoBuffer();
302 }
303
304 if( parentFP )
305 {
306 m_statusLine->SetLabel( wxString::Format(
307 _( "Footprint %s (%s), %s, rotated %.1f deg" ), parentFP->GetReference(), parentFP->GetValue(),
308 parentFP->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ),
309 parentFP->GetOrientation().AsDegrees() ) );
310 }
311 else
312 {
313 m_statusLine->Show( false );
314 }
315
316 m_cbLocked->SetValue( m_item->IsLocked() );
317
318 m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
319 m_cbKnockout->SetValue( m_item->IsKnockout() );
320
321 m_fontCtrl->SetFontSelection( m_item->GetFont() );
322
323 m_textWidth.SetValue( m_item->GetTextSize().x );
324 m_textHeight.SetValue( m_item->GetTextSize().y );
325
326 if( m_item->GetAutoThickness() )
327 {
328 m_autoTextThickness->Check( m_item->GetAutoThickness() );
329 m_thickness.SetValue( m_item->GetEffectiveTextPenWidth() );
330 m_thickness.Enable( false );
331 }
332 else
333 {
334 m_thickness.SetValue( m_item->GetTextThickness() );
335 }
336
337 m_posX.SetValue( m_item->GetFPRelativePosition().x );
338 m_posY.SetValue( m_item->GetFPRelativePosition().y );
339
340 if( m_Visible->IsShown() )
341 m_Visible->SetValue( m_item->IsVisible() );
342
343 if( m_KeepUpright->IsShown() )
344 m_KeepUpright->SetValue( m_item->IsKeepUpright() );
345
346 m_bold->Check( m_item->IsBold() );
347 m_italic->Check( m_item->IsItalic() );
348
349 switch( m_item->GetHorizJustify() )
350 {
351 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check( true ); break;
352 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check( true ); break;
353 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check( true ); break;
355 }
356
357 switch( m_item->GetVertJustify() )
358 {
359 case GR_TEXT_V_ALIGN_BOTTOM: m_valignBottom->Check( true ); break;
360 case GR_TEXT_V_ALIGN_CENTER: m_valignCenter->Check( true ); break;
361 case GR_TEXT_V_ALIGN_TOP: m_valignTop->Check( true ); break;
363 }
364
365 m_mirrored->Check( m_item->IsMirrored() );
366
367 EDA_ANGLE orientation = m_item->GetTextAngle();
368 m_orientation.SetAngleValue( orientation.Normalize180() );
369
370 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
371}
372
373
374void DIALOG_TEXT_PROPERTIES::onFontSelected( wxCommandEvent& aEvent )
375{
376 if( KIFONT::FONT::IsStroke( aEvent.GetString() ) )
377 {
378 m_thickness.Show( true );
379 m_autoTextThickness->Show( true );
380
381 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
382 int thickness = m_thickness.GetValue();
383
384 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
385 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
386 }
387 else
388 {
389 m_thickness.Show( false );
390 m_autoTextThickness->Show( false );
391 }
392}
393
394
395void DIALOG_TEXT_PROPERTIES::onBoldToggle( wxCommandEvent& aEvent )
396{
397 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
398
399 if( aEvent.IsChecked() )
400 m_thickness.ChangeValue( GetPenSizeForBold( textSize ) );
401 else
402 m_thickness.ChangeValue( GetPenSizeForNormal( textSize ) );
403
404 aEvent.Skip();
405}
406
407
408void DIALOG_TEXT_PROPERTIES::onAlignButton( wxCommandEvent& aEvent )
409{
411 {
412 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
413 btn->Check( false );
414 }
415}
416
417
418void DIALOG_TEXT_PROPERTIES::onValignButton( wxCommandEvent& aEvent )
419{
421 {
422 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
423 btn->Check( false );
424 }
425}
426
427
428void DIALOG_TEXT_PROPERTIES::onThickness( wxCommandEvent& event )
429{
430 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
431 int thickness = m_thickness.GetValue();
432
433 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
434 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
435}
436
437
438void DIALOG_TEXT_PROPERTIES::onTextSize( wxCommandEvent& aEvent )
439{
440 if( m_autoTextThickness->IsChecked() )
441 {
442 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
443 int thickness;
444
445 // Calculate the "best" thickness from text size and bold option:
446 if( m_bold->IsChecked() )
447 thickness = GetPenSizeForBold( textSize );
448 else
449 thickness = GetPenSizeForNormal( textSize );
450
451 m_thickness.SetValue( thickness );
452 }
453}
454
455
457{
458 if( aEvent.IsChecked() )
459 {
460 m_autoTextThickness->Check( true );
461
462 wxCommandEvent dummy;
463 onTextSize( dummy );
464
465 m_thickness.Enable( false );
466 }
467 else
468 {
469 m_thickness.Enable( true );
470 }
471}
472
473
475{
476 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
477 return false;
478
479 int minSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
480 int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
481
482 if( !m_textWidth.Validate( minSize, maxSize ) || !m_textHeight.Validate( minSize, maxSize ) )
483 return false;
484
485 BOARD* board = m_frame->GetBoard();
486 BOARD_COMMIT commit( m_frame );
487 commit.Modify( m_item );
488
489 // If no other command in progress, prepare undo command
490 // (for a command in progress, will be made later, at the completion of command)
491 bool pushCommit = ( m_item->GetEditFlags() == 0 );
492
493 // Set IN_EDIT flag to force undo/redo/abort proper operation and avoid new calls to
494 // SaveCopyInUndoList for the same text if is moved, and then rotated, edited, etc....
495 if( !pushCommit )
497
498 // Set the new text content
499 if( m_SingleLineText->IsShown() )
500 {
501 if( !m_SingleLineText->GetValue().IsEmpty() )
502 {
503 // convert any text variable cross-references to their UUIDs
504 wxString txt = board->ConvertCrossReferencesToKIIDs( m_SingleLineText->GetValue() );
505
506 m_item->SetText( txt );
507 }
508 }
509 else if( m_MultiLineText->IsShown() )
510 {
511 if( !m_MultiLineText->GetValue().IsEmpty() )
512 {
513 // convert any text variable cross-references to their UUIDs
514 wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
515
516#ifdef __WXMAC__
517 // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting.
518 // Replace it now.
519 txt.Replace( wxT( "\r" ), wxT( "\n" ) );
520#elif defined( __WINDOWS__ )
521 // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in
522 // drawing routines so strip the \r char.
523 txt.Replace( wxT( "\r" ), wxT( "" ) );
524#endif
525 m_item->SetText( EscapeString( txt, CTX_QUOTED_STR ) );
526 }
527 }
528
529 m_item->SetLocked( m_cbLocked->GetValue() );
530
531 m_item->SetLayer( ToLAYER_ID( m_LayerSelectionCtrl->GetLayerSelection() ) );
532 m_item->SetIsKnockout( m_cbKnockout->GetValue() );
533
534 if( m_fontCtrl->HaveFontSelection() )
535 {
536 m_item->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) );
537 }
538
539 m_item->SetTextSize( VECTOR2I( m_textWidth.GetValue(), m_textHeight.GetValue() ) );
540
541 if( m_autoTextThickness->IsChecked() )
542 {
543 m_item->SetAutoThickness( true );
544 }
545 else
546 {
547 m_item->SetTextThickness( m_thickness.GetValue() );
548
549 // Test for acceptable values for thickness and size and clamp if fails
550 int maxPenWidth = ClampTextPenSize( m_item->GetTextThickness(), m_item->GetTextSize() );
551
552 if( m_item->GetTextThickness() > maxPenWidth )
553 {
554 DisplayError( this, _( "The text thickness is too large for the text size.\n"
555 "It will be clamped." ) );
556 m_item->SetTextThickness( maxPenWidth );
557 }
558 }
559
560 m_item->SetFPRelativePosition( VECTOR2I( m_posX.GetValue(), m_posY.GetValue() ) );
561 m_item->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
562
563 if( m_Visible->IsShown() )
564 m_item->SetVisible( m_Visible->GetValue() );
565
566 if( m_KeepUpright->IsShown() )
567 m_item->SetKeepUpright( m_KeepUpright->GetValue() );
568
569 m_item->SetBoldFlag( m_bold->IsChecked() );
570 m_item->SetItalicFlag( m_italic->IsChecked() );
571
572 if( m_alignLeft->IsChecked() )
573 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
574 else if( m_alignCenter->IsChecked() )
575 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
576 else
577 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
578
579 if( m_valignBottom->IsChecked() )
580 m_item->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
581 else if( m_valignCenter->IsChecked() )
582 m_item->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
583 else
584 m_item->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
585
586 m_item->SetMirrored( m_mirrored->IsChecked() );
587
588 if( pushCommit )
589 commit.Push( _( "Edit Text Properties" ) );
590
591 return true;
592}
593
594
595void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
596{
598 m_scintillaTricks->CancelAutocomplete();
599
600 event.Skip();
601}
602
603
604void DIALOG_TEXT_PROPERTIES::onSyntaxHelp( wxHyperlinkEvent& aEvent )
605{
607}
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:1906
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:1986
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:148
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:142
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:278
EDA_ANGLE GetOrientation() const
Definition footprint.h:248
bool IsFlipped() const
Definition footprint.h:434
const wxString & GetValue() const
Definition footprint.h:683
const wxString & GetReference() const
Definition footprint.h:661
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