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