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 m_cbLocked->Show( false );
151
155 }
156 else
157 {
158 title = _( "Text Properties" );
159
161 m_SingleLineSizer->Show( false );
162
163 m_Visible->Show( false );
164 m_KeepUpright->Show( false );
165 m_statusLine->Show( false );
166
170 }
171
172 m_bold->SetIsCheckButton();
174 m_italic->SetIsCheckButton();
176
177 m_separator1->SetIsSeparator();
178
179 m_alignLeft->SetIsRadioButton();
181 m_alignCenter->SetIsRadioButton();
183 m_alignRight->SetIsRadioButton();
185
186 m_separator2->SetIsSeparator();
187
188 m_valignBottom->SetIsRadioButton();
190 m_valignCenter->SetIsRadioButton();
192 m_valignTop->SetIsRadioButton();
194
195 m_separator3->SetIsSeparator();
196
197 m_mirrored->SetIsCheckButton();
199
200 m_autoTextThickness->SetIsCheckButton();
202
203 SetTitle( title );
204 m_hash_key = title;
205
206 // Configure the layers list selector. Note that footprints are built outside the current
207 // board and so we may need to show all layers if the text is on an unactivated layer.
208 if( !m_frame->GetBoard()->IsLayerEnabled( m_item->GetLayer() ) )
209 m_LayerSelectionCtrl->ShowNonActivatedLayers( true );
210
211 m_LayerSelectionCtrl->SetLayersHotkeys( false );
212 m_LayerSelectionCtrl->SetBoardFrame( m_frame );
213 m_LayerSelectionCtrl->Resync();
214
216 m_orientation.SetPrecision( 3 );
217
218 // Set predefined rotations in combo dropdown, according to the locale floating point
219 // separator notation
220 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
221
222 for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii )
223 m_OrientCtrl->SetString( ii, wxString::Format( wxT( "%.1f" ), rot_list[ii] ) );
224
225 // Set font sizes
226 m_statusLine->SetFont( KIUI::GetInfoFont( this ) );
227
229
230 // wxTextCtrls fail to generate wxEVT_CHAR events when the wxTE_MULTILINE flag is set,
231 // so we have to listen to wxEVT_CHAR_HOOK events instead.
232 Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
233
235}
236
237
239{
240 Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ), nullptr, this );
241
242 delete m_scintillaTricks;
243 m_scintillaTricks = nullptr;
244
245 if( m_helpWindow )
246 m_helpWindow->Destroy();
247}
248
249
251{
252 DIALOG_TEXT_PROPERTIES dlg( this, aText );
253
254 // QuasiModal required for Scintilla auto-complete
255 dlg.ShowQuasiModal();
256}
257
258
259void DIALOG_TEXT_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
260{
261 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
262 {
263#ifdef __WXGTK__
264 // Force an update of the text control before setting the text selection
265 // This is needed because GTK seems to ignore the selection on first update
266 //
267 // Note that we can't do this on OSX as it tends to provoke Apple's
268 // "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
269 // bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
270 m_SingleLineText->Update();
271#endif
272 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
273 }
274 else
275 m_SingleLineText->SetSelection( -1, -1 );
276
277 event.Skip();
278}
279
280
282{
283 BOARD* board = m_frame->GetBoard();
284 FOOTPRINT* parentFP = m_item->GetParentFootprint();
285 wxString text = m_item->GetText();
286
287 // show text variable cross-references in a human-readable format
289
290 if( m_SingleLineText->IsShown() )
291 {
292 m_SingleLineText->SetValue( text );
293
294 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
295 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
296 else
297 m_SingleLineText->SetSelection( -1, -1 );
298 }
299 else if( m_MultiLineText->IsShown() )
300 {
301 m_MultiLineText->SetValue( text );
302 m_MultiLineText->SetSelection( -1, -1 );
303 m_MultiLineText->EmptyUndoBuffer();
304 }
305
306 if( parentFP )
307 {
308 m_statusLine->SetLabel( wxString::Format(
309 _( "Footprint %s (%s), %s, rotated %.1f deg" ), parentFP->GetReference(), parentFP->GetValue(),
310 parentFP->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ),
311 parentFP->GetOrientation().AsDegrees() ) );
312 }
313 else
314 {
315 m_statusLine->Show( false );
316 }
317
318 m_cbLocked->SetValue( m_item->IsLocked() );
319
320 m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
321 m_cbKnockout->SetValue( m_item->IsKnockout() );
322
323 m_fontCtrl->SetFontSelection( m_item->GetFont() );
324
325 m_textWidth.SetValue( m_item->GetTextSize().x );
326 m_textHeight.SetValue( m_item->GetTextSize().y );
327
328 if( m_item->GetAutoThickness() )
329 {
330 m_autoTextThickness->Check( m_item->GetAutoThickness() );
331 m_thickness.SetValue( m_item->GetEffectiveTextPenWidth() );
332 m_thickness.Enable( false );
333 }
334 else
335 {
336 m_thickness.SetValue( m_item->GetTextThickness() );
337 }
338
339 m_posX.SetValue( m_item->GetFPRelativePosition().x );
340 m_posY.SetValue( m_item->GetFPRelativePosition().y );
341
342 if( m_Visible->IsShown() )
343 m_Visible->SetValue( m_item->IsVisible() );
344
345 if( m_KeepUpright->IsShown() )
346 m_KeepUpright->SetValue( m_item->IsKeepUpright() );
347
348 m_bold->Check( m_item->IsBold() );
349 m_italic->Check( m_item->IsItalic() );
350
351 switch( m_item->GetHorizJustify() )
352 {
353 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check( true ); break;
354 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check( true ); break;
355 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check( true ); break;
357 }
358
359 switch( m_item->GetVertJustify() )
360 {
361 case GR_TEXT_V_ALIGN_BOTTOM: m_valignBottom->Check( true ); break;
362 case GR_TEXT_V_ALIGN_CENTER: m_valignCenter->Check( true ); break;
363 case GR_TEXT_V_ALIGN_TOP: m_valignTop->Check( true ); break;
365 }
366
367 m_mirrored->Check( m_item->IsMirrored() );
368
369 EDA_ANGLE orientation = m_item->GetTextAngle();
370 m_orientation.SetAngleValue( orientation.Normalize180() );
371
372 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
373}
374
375
376void DIALOG_TEXT_PROPERTIES::onFontSelected( wxCommandEvent& aEvent )
377{
378 if( KIFONT::FONT::IsStroke( aEvent.GetString() ) )
379 {
380 m_thickness.Show( true );
381 m_autoTextThickness->Show( true );
382
383 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
384 int thickness = m_thickness.GetValue();
385
386 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
387 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
388 }
389 else
390 {
391 m_thickness.Show( false );
392 m_autoTextThickness->Show( false );
393 }
394}
395
396
397void DIALOG_TEXT_PROPERTIES::onBoldToggle( wxCommandEvent& aEvent )
398{
399 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
400
401 if( aEvent.IsChecked() )
402 m_thickness.ChangeValue( GetPenSizeForBold( textSize ) );
403 else
404 m_thickness.ChangeValue( GetPenSizeForNormal( textSize ) );
405
406 aEvent.Skip();
407}
408
409
410void DIALOG_TEXT_PROPERTIES::onAlignButton( wxCommandEvent& aEvent )
411{
413 {
414 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
415 btn->Check( false );
416 }
417}
418
419
420void DIALOG_TEXT_PROPERTIES::onValignButton( wxCommandEvent& aEvent )
421{
423 {
424 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
425 btn->Check( false );
426 }
427}
428
429
430void DIALOG_TEXT_PROPERTIES::onThickness( wxCommandEvent& event )
431{
432 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
433 int thickness = m_thickness.GetValue();
434
435 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
436 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
437}
438
439
440void DIALOG_TEXT_PROPERTIES::onTextSize( wxCommandEvent& aEvent )
441{
442 if( m_autoTextThickness->IsChecked() )
443 {
444 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
445 int thickness;
446
447 // Calculate the "best" thickness from text size and bold option:
448 if( m_bold->IsChecked() )
449 thickness = GetPenSizeForBold( textSize );
450 else
451 thickness = GetPenSizeForNormal( textSize );
452
453 m_thickness.SetValue( thickness );
454 }
455}
456
457
459{
460 if( aEvent.IsChecked() )
461 {
462 m_autoTextThickness->Check( true );
463
464 wxCommandEvent dummy;
465 onTextSize( dummy );
466
467 m_thickness.Enable( false );
468 }
469 else
470 {
471 m_thickness.Enable( true );
472 }
473}
474
475
477{
478 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
479 return false;
480
481 int minSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
482 int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
483
484 if( !m_textWidth.Validate( minSize, maxSize ) || !m_textHeight.Validate( minSize, maxSize ) )
485 return false;
486
487 BOARD* board = m_frame->GetBoard();
488 BOARD_COMMIT commit( m_frame );
489 commit.Modify( m_item );
490
491 // If no other command in progress, prepare undo command
492 // (for a command in progress, will be made later, at the completion of command)
493 bool pushCommit = ( m_item->GetEditFlags() == 0 );
494
495 // Set IN_EDIT flag to force undo/redo/abort proper operation and avoid new calls to
496 // SaveCopyInUndoList for the same text if is moved, and then rotated, edited, etc....
497 if( !pushCommit )
499
500 // Set the new text content
501 if( m_SingleLineText->IsShown() )
502 {
503 if( !m_SingleLineText->GetValue().IsEmpty() )
504 {
505 // convert any text variable cross-references to their UUIDs
506 wxString txt = board->ConvertCrossReferencesToKIIDs( m_SingleLineText->GetValue() );
507
508 m_item->SetText( txt );
509 }
510 }
511 else if( m_MultiLineText->IsShown() )
512 {
513 if( !m_MultiLineText->GetValue().IsEmpty() )
514 {
515 // convert any text variable cross-references to their UUIDs
516 wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
517
518#ifdef __WXMAC__
519 // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting.
520 // Replace it now.
521 txt.Replace( wxT( "\r" ), wxT( "\n" ) );
522#elif defined( __WINDOWS__ )
523 // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in
524 // drawing routines so strip the \r char.
525 txt.Replace( wxT( "\r" ), wxT( "" ) );
526#endif
527 m_item->SetText( EscapeString( txt, CTX_QUOTED_STR ) );
528 }
529 }
530
531 m_item->SetLocked( m_cbLocked->GetValue() );
532
533 m_item->SetLayer( ToLAYER_ID( m_LayerSelectionCtrl->GetLayerSelection() ) );
534 m_item->SetIsKnockout( m_cbKnockout->GetValue() );
535
536 if( m_fontCtrl->HaveFontSelection() )
537 {
538 m_item->SetFont( m_fontCtrl->GetFontSelection( m_bold->IsChecked(), m_italic->IsChecked() ) );
539 }
540
541 m_item->SetTextSize( VECTOR2I( m_textWidth.GetValue(), m_textHeight.GetValue() ) );
542
543 if( m_autoTextThickness->IsChecked() )
544 {
545 m_item->SetAutoThickness( true );
546 }
547 else
548 {
549 m_item->SetTextThickness( m_thickness.GetValue() );
550
551 // Test for acceptable values for thickness and size and clamp if fails
552 int maxPenWidth = ClampTextPenSize( m_item->GetTextThickness(), m_item->GetTextSize() );
553
554 if( m_item->GetTextThickness() > maxPenWidth )
555 {
556 DisplayError( this, _( "The text thickness is too large for the text size.\n"
557 "It will be clamped." ) );
558 m_item->SetTextThickness( maxPenWidth );
559 }
560 }
561
562 m_item->SetFPRelativePosition( VECTOR2I( m_posX.GetValue(), m_posY.GetValue() ) );
563 m_item->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
564
565 if( m_Visible->IsShown() )
566 m_item->SetVisible( m_Visible->GetValue() );
567
568 if( m_KeepUpright->IsShown() )
569 m_item->SetKeepUpright( m_KeepUpright->GetValue() );
570
571 m_item->SetBoldFlag( m_bold->IsChecked() );
572 m_item->SetItalicFlag( m_italic->IsChecked() );
573
574 if( m_alignLeft->IsChecked() )
575 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
576 else if( m_alignCenter->IsChecked() )
577 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
578 else
579 m_item->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
580
581 if( m_valignBottom->IsChecked() )
582 m_item->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
583 else if( m_valignCenter->IsChecked() )
584 m_item->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
585 else
586 m_item->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
587
588 m_item->SetMirrored( m_mirrored->IsChecked() );
589
590 if( pushCommit )
591 commit.Push( _( "Edit Text Properties" ) );
592
593 return true;
594}
595
596
597void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
598{
600 m_scintillaTricks->CancelAutocomplete();
601
602 event.Skip();
603}
604
605
606void DIALOG_TEXT_PROPERTIES::onSyntaxHelp( wxHyperlinkEvent& aEvent )
607{
609}
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:372
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition board.cpp:2229
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition board.cpp:2309
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:79
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:406
bool IsFlipped() const
Definition footprint.h:614
const wxString & GetValue() const
Definition footprint.h:863
const wxString & GetReference() const
Definition footprint.h:841
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:873
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
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