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