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 (C) 2010-2023 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#include <widgets/font_choice.h>
28#include <confirm.h>
29#include <board_commit.h>
30#include <board.h>
31#include <footprint.h>
32#include <pcb_text.h>
33#include <project.h>
34#include <pcb_edit_frame.h>
36#include <wx/valnum.h>
37#include <scintilla_tricks.h>
38
39
42 m_frame( aParent ),
43 m_item( aText ),
44 m_textWidth( aParent, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ),
45 m_textHeight( aParent, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ),
46 m_thickness( aParent, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ),
47 m_posX( aParent, m_PositionXLabel, m_PositionXCtrl, m_PositionXUnits ),
48 m_posY( aParent, m_PositionYLabel, m_PositionYCtrl, m_PositionYUnits ),
49 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr )
50{
51 wxString title;
52
53 // Configure display origin transforms
55 {
58 }
59 else
60 {
63 }
64
65 m_MultiLineText->SetEOLMode( wxSTC_EOL_LF );
66
67#ifdef _WIN32
68 // Without this setting, on Windows, some esoteric unicode chars create display issue
69 // in a wxStyledTextCtrl.
70 // for SetTechnology() info, see https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY
71 m_MultiLineText->SetTechnology(wxSTC_TECHNOLOGY_DIRECTWRITE);
72#endif
73
74 m_scintillaTricks = new SCINTILLA_TRICKS( m_MultiLineText, wxT( "{}" ), false,
75 // onAccept handler
76 [this]( wxKeyEvent& aEvent )
77 {
78 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
79 },
80 // onCharAdded handler
81 [this]( wxStyledTextEvent& aEvent )
82 {
84 [this]( const wxString& crossRef, wxArrayString* tokens )
85 {
86 m_frame->GetContextualTextVars( m_item, crossRef, tokens );
87 } );
88 } );
89
90 // A hack which causes Scintilla to auto-size the text editor canvas
91 // See: https://github.com/jacobslusser/ScintillaNET/issues/216
92 m_MultiLineText->SetScrollWidth( 1 );
93 m_MultiLineText->SetScrollWidthTracking( true );
94
96 {
97 m_PositionXLabel->SetLabel( _( "Offset X:" ) );
98 m_PositionYLabel->SetLabel( _( "Offset Y:" ) );
99
100 if( m_item->Type() == PCB_FIELD_T )
101 {
102 PCB_FIELD* field = static_cast<PCB_FIELD*>( m_item );
103
104 if( field->IsReference() )
105 {
106 title = _( "Footprint Reference Properties" );
107 m_TextLabel->SetLabel( _( "Reference:" ) );
108 }
109 else if( field->IsValue() )
110 {
111 title = _( "Footprint Value Properties" );
112 m_TextLabel->SetLabel( _( "Value:" ) );
113 }
114 else
115 {
116 // Don't let users modify the library link, in the board editor
117 if( field->IsFootprint() && !m_frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
118 m_SingleLineText->SetEditable( false );
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 }
129
131 m_MultiLineSizer->Show( false );
132
133 // Do not allow locking items in the footprint editor
134 m_cbLocked->Show( false );
135
136 m_tabOrder = {
142 m_Visible,
150 };
151 }
152 else
153 {
154 title = _( "Text Properties" );
155
157 m_SingleLineSizer->Show( false );
158
159 // This option makes sense only for footprint texts; texts on board are always visible.
160 m_Visible->SetValue( true );
161 m_Visible->Show( false );
162
163 m_KeepUpright->Show( false );
164 m_statusLine->Show( false );
165
166 m_tabOrder = {
179 };
180 }
181
183 m_bold->SetBitmap( KiBitmapBundle( BITMAPS::text_bold ) );
185 m_italic->SetBitmap( KiBitmapBundle( BITMAPS::text_italic ) );
186
188
190 m_alignLeft->SetBitmap( KiBitmapBundle( BITMAPS::text_align_left ) );
192 m_alignCenter->SetBitmap( KiBitmapBundle( BITMAPS::text_align_center ) );
194 m_alignRight->SetBitmap( KiBitmapBundle( BITMAPS::text_align_right ) );
195
197
199 m_valignBottom->SetBitmap( KiBitmapBundle( BITMAPS::text_valign_bottom ) );
201 m_valignCenter->SetBitmap( KiBitmapBundle( BITMAPS::text_valign_center ) );
203 m_valignTop->SetBitmap( KiBitmapBundle( BITMAPS::text_valign_top ) );
204
206
208 m_mirrored->SetBitmap( KiBitmapBundle( BITMAPS::text_mirrored ) );
209
210 SetTitle( title );
211 m_hash_key = title;
212
213 // Configure the layers list selector. Note that footprints are built outside the current
214 // board and so we may need to show all layers if the text is on an unactivated layer.
215 if( !m_frame->GetBoard()->IsLayerEnabled( m_item->GetLayer() ) )
217
221
222 m_orientation.SetUnits( EDA_UNITS::DEGREES );
224
225 // Set predefined rotations in combo dropdown, according to the locale floating point
226 // separator notation
227 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
228
229 for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii )
230 m_OrientCtrl->SetString( ii, wxString::Format( wxT( "%.1f" ), rot_list[ii] ) );
231
232 // Set font sizes
233 m_statusLine->SetFont( KIUI::GetInfoFont( this ) );
234
236
237 // wxTextCtrls fail to generate wxEVT_CHAR events when the wxTE_MULTILINE flag is set,
238 // so we have to listen to wxEVT_CHAR_HOOK events instead.
239 Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ),
240 nullptr, this );
241
243}
244
245
247{
248 Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_TEXT_PROPERTIES::OnCharHook ),
249 nullptr, this );
250
251 delete m_scintillaTricks;
252}
253
254
256{
257 DIALOG_TEXT_PROPERTIES dlg( this, aText );
258 dlg.ShowQuasiModal();
259}
260
261
262void DIALOG_TEXT_PROPERTIES::OnSetFocusText( wxFocusEvent& event )
263{
264 if( m_item->Type() == PCB_FIELD_T && static_cast<PCB_FIELD*>( m_item )->IsReference() )
265 {
266#ifdef __WXGTK__
267 // Force an update of the text control before setting the text selection
268 // This is needed because GTK seems to ignore the selection on first update
269 //
270 // Note that we can't do this on OSX as it tends to provoke Apple's
271 // "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
272 // bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
273 m_SingleLineText->Update();
274#endif
275 KIUI::SelectReferenceNumber( static_cast<wxTextEntry*>( m_SingleLineText ) );
276 }
277 else
278 m_SingleLineText->SetSelection( -1, -1 );
279
280 event.Skip();
281}
282
283
285{
286 BOARD* board = m_frame->GetBoard();
287 FOOTPRINT* parentFP = m_item->GetParentFootprint();
288
289 if( m_SingleLineText->IsShown() )
290 {
291 m_SingleLineText->SetValue( m_item->GetText() );
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 wxString msg = board->ConvertKIIDsToCrossReferences( UnescapeString( m_item->GetText() ) );
301
302 m_MultiLineText->SetValue( msg );
303 m_MultiLineText->SetSelection( -1, -1 );
304 m_MultiLineText->EmptyUndoBuffer();
305 }
306
307 if( parentFP )
308 {
309 m_statusLine->SetLabel( wxString::Format( _( "Footprint %s (%s), %s, rotated %.1f deg"),
310 parentFP->GetReference(),
311 parentFP->GetValue(),
312 parentFP->IsFlipped() ? _( "back side (mirrored)" )
313 : _( "front side" ),
314 parentFP->GetOrientation().AsDegrees() ) );
315 }
316 else
317 {
318 m_statusLine->Show( false );
319 }
320
321 m_cbLocked->SetValue( m_item->IsLocked() );
322
324 m_cbKnockout->SetValue( m_item->IsKnockout() );
325
327
333
334 m_Visible->SetValue( m_item->IsVisible() );
335
336 if( parentFP )
337 m_KeepUpright->SetValue( m_item->IsKeepUpright() );
338
339 m_bold->Check( m_item->IsBold() );
341
342 switch ( m_item->GetHorizJustify() )
343 {
344 case GR_TEXT_H_ALIGN_LEFT: m_alignLeft->Check( true ); break;
345 case GR_TEXT_H_ALIGN_CENTER: m_alignCenter->Check( true ); break;
346 case GR_TEXT_H_ALIGN_RIGHT: m_alignRight->Check( true ); break;
347 }
348
349 switch ( m_item->GetVertJustify() )
350 {
351 case GR_TEXT_V_ALIGN_BOTTOM: m_valignBottom->Check( true ); break;
352 case GR_TEXT_V_ALIGN_CENTER: m_valignCenter->Check( true ); break;
353 case GR_TEXT_V_ALIGN_TOP: m_valignTop->Check( true ); break;
354 }
355
357
358 EDA_ANGLE orientation = m_item->GetTextAngle();
360
361 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
362}
363
364
365void DIALOG_TEXT_PROPERTIES::onFontSelected( wxCommandEvent & aEvent )
366{
367 if( KIFONT::FONT::IsStroke( aEvent.GetString() ) )
368 {
369 m_thickness.Show( true );
370
371 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
372 int thickness = m_thickness.GetValue();
373
374 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
375 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
376 }
377 else
378 {
379 m_thickness.Show( false );
380 }
381}
382
383
384void DIALOG_TEXT_PROPERTIES::onBoldToggle( wxCommandEvent & aEvent )
385{
386 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
387
388 if( aEvent.IsChecked() )
390 else
392
393 aEvent.Skip();
394}
395
396
397void DIALOG_TEXT_PROPERTIES::onAlignButton( wxCommandEvent& aEvent )
398{
400 {
401 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
402 btn->Check( false );
403 }
404}
405
406
407void DIALOG_TEXT_PROPERTIES::onValignButton( wxCommandEvent& aEvent )
408{
410 {
411 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
412 btn->Check( false );
413 }
414}
415
416
417void DIALOG_TEXT_PROPERTIES::onThickness( wxCommandEvent& event )
418{
419 int textSize = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
420 int thickness = m_thickness.GetValue();
421
422 m_bold->Check( abs( thickness - GetPenSizeForBold( textSize ) )
423 < abs( thickness - GetPenSizeForNormal( textSize ) ) );
424}
425
426
428{
429 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
430 return false;
431
433 int maxSize = pcbIUScale.MilsToIU( TEXT_MAX_SIZE_MILS );
434
435 if( !m_textWidth.Validate( minSize, maxSize ) || !m_textHeight.Validate( minSize, maxSize ) )
436 return false;
437
438 BOARD_COMMIT commit( m_frame );
439 commit.Modify( m_item );
440
441 // If no other command in progress, prepare undo command
442 // (for a command in progress, will be made later, at the completion of command)
443 bool pushCommit = ( m_item->GetEditFlags() == 0 );
444
445 // Set IN_EDIT flag to force undo/redo/abort proper operation and avoid new calls to
446 // SaveCopyInUndoList for the same text if is moved, and then rotated, edited, etc....
447 if( !pushCommit )
449
450 // Set the new text content
451 if( m_SingleLineText->IsShown() )
452 {
453 if( !m_SingleLineText->GetValue().IsEmpty() )
454 m_item->SetText( m_SingleLineText->GetValue() );
455 }
456 else if( m_MultiLineText->IsShown() )
457 {
458 if( !m_MultiLineText->GetValue().IsEmpty() )
459 {
460 BOARD* board = m_frame->GetBoard();
461 wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
462
463#ifdef __WXMAC__
464 // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting.
465 // Replace it now.
466 txt.Replace( wxT( "\r" ), wxT( "\n" ) );
467#elif defined( __WINDOWS__ )
468 // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in
469 // drawing routines so strip the \r char.
470 txt.Replace( wxT( "\r" ), wxT( "" ) );
471#endif
473 }
474 }
475
476 m_item->SetLocked( m_cbLocked->GetValue() );
477
479 m_item->SetIsKnockout( m_cbKnockout->GetValue() );
480
482 {
484 m_italic->IsChecked() ) );
485 }
486
490
491 // Test for acceptable values for thickness and size and clamp if fails
492 int maxPenWidth = Clamp_Text_PenSize( m_item->GetTextThickness(), m_item->GetTextSize() );
493
494 if( m_item->GetTextThickness() > maxPenWidth )
495 {
496 DisplayError( this, _( "The text thickness is too large for the text size.\n"
497 "It will be clamped." ) );
498 m_item->SetTextThickness( maxPenWidth );
499 }
500
502
503 m_item->SetVisible( m_Visible->GetValue() );
504
505 if( m_KeepUpright->IsShown() )
506 m_item->SetKeepUpright( m_KeepUpright->GetValue() );
507
510
511 if( m_alignLeft->IsChecked() )
513 else if( m_alignCenter->IsChecked() )
515 else
517
520 else if( m_valignCenter->IsChecked() )
522 else
524
526
527 if( pushCommit )
528 commit.Push( _( "Change text properties" ) );
529
530 return true;
531}
532
533
534void DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus( wxFocusEvent& event )
535{
538
539 event.Skip();
540}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
Definition: bitmap_button.h:41
void SetIsRadioButton()
bool IsChecked() const
void Check(bool aCheck=true)
Check the control.
void SetIsSeparator()
Render button as a toolbar separator.
void SetIsCheckButton()
Setup the control as a two-state button (checked or unchecked).
void SetBitmap(const wxBitmapBundle &aBmp)
Set the bitmap shown when the button is enabled.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:225
virtual void SetLocked(bool aLocked)
Definition: board_item.h:299
virtual bool IsKnockout() const
Definition: board_item.h:295
virtual void SetIsKnockout(bool aKnockout)
Definition: board_item.h:296
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:259
FOOTPRINT * GetParentFootprint() const
Definition: board_item.cpp:247
VECTOR2I GetFPRelativePosition() const
Definition: board_item.cpp:261
void SetFPRelativePosition(const VECTOR2I &aPos)
Definition: board_item.cpp:275
virtual bool IsLocked() const
Definition: board_item.cpp:73
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:276
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
Definition: board.cpp:1270
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
Definition: board.cpp:1324
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:225
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:97
void SetupStandardButtons(std::map< int, wxString > aLabels={})
int ShowQuasiModal()
std::string m_hash_key
Definition: dialog_shim.h:205
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)
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...
DIALOG_TEXT_PROPERTIES(SCH_EDIT_FRAME *parent, SCH_ITEM *aTextItem)
void onMultiLineTCLostFocus(wxFocusEvent &event) override
void onFontSelected(wxCommandEvent &aEvent) override
void onBoldToggle(wxCommandEvent &aEvent) override
void onThickness(wxCommandEvent &aEvent) override
void onValignButton(wxCommandEvent &aEvent) override
void onAlignButton(wxCommandEvent &aEvent) override
EDA_ANGLE Normalize()
Definition: eda_angle.h:249
double AsDegrees() const
Definition: eda_angle.h:149
EDA_ANGLE Normalize180()
Definition: eda_angle.h:288
bool IsType(FRAME_T aType) const
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:129
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:123
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
void SetTextSize(VECTOR2I aNewSize)
Definition: eda_text.cpp:358
bool IsItalic() const
Definition: eda_text.h:141
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:131
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
bool IsKeepUpright() const
Definition: eda_text.h:166
virtual bool IsVisible() const
Definition: eda_text.h:147
KIFONT::FONT * GetFont() const
Definition: eda_text.h:207
void SetMirrored(bool isMirrored)
Definition: eda_text.cpp:236
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
Definition: eda_text.cpp:260
GR_TEXT_H_ALIGN_T GetHorizJustify() const
Definition: eda_text.h:160
virtual void SetVisible(bool aVisible)
Definition: eda_text.cpp:229
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.cpp:197
void SetBold(bool aBold)
Definition: eda_text.cpp:221
bool IsMirrored() const
Definition: eda_text.h:150
bool IsBold() const
Definition: eda_text.h:144
void SetKeepUpright(bool aKeepUpright)
Definition: eda_text.cpp:268
GR_TEXT_V_ALIGN_T GetVertJustify() const
Definition: eda_text.h:163
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:183
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
Definition: eda_text.cpp:205
int GetTextThickness() const
Definition: eda_text.h:123
void SetItalic(bool aItalic)
Definition: eda_text.cpp:213
void SetFont(KIFONT::FONT *aFont)
Definition: eda_text.cpp:342
VECTOR2I GetTextSize() const
Definition: eda_text.h:218
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:252
bool HaveFontSelection() const
Definition: font_choice.cpp:94
void SetFontSelection(KIFONT::FONT *aFont)
Definition: font_choice.cpp:73
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
EDA_ANGLE GetOrientation() const
Definition: footprint.h:209
bool IsFlipped() const
Definition: footprint.h:351
const wxString & GetValue() const
Definition: footprint.h:578
const wxString & GetReference() const
Definition: footprint.h:556
virtual bool IsStroke() const
Definition: font.h:138
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
Common, abstract interface for edit frames.
bool IsReference() const
Definition: pcb_field.h:67
bool IsValue() const
Definition: pcb_field.h:68
bool IsFootprint() const
Definition: pcb_field.h:69
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void ShowNonActivatedLayers(bool aShow)
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoTextVarAutocomplete(std::function< void(const wxString &crossRef, wxArrayString *tokens)> aTokenProvider)
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
virtual void SetAngleValue(const EDA_ANGLE &aValue)
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.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
Definition: unit_binder.h:189
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:280
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_MILS
Minimum text size in mils.
Definition: eda_text.h:42
#define TEXT_MAX_SIZE_MILS
Maximum text size in mils (10 inches)
Definition: eda_text.h:43
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:43
int GetPenSizeForBold(int aTextSize)
Definition: gr_text.cpp:40
int GetPenSizeForNormal(int aTextSize)
Definition: gr_text.cpp:64
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
Definition: gr_text.cpp:87
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:941
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:151
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
Definition: ui_common.cpp:225
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
Definition: string_utils.h:57
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
@ GR_TEXT_H_ALIGN_CENTER
@ GR_TEXT_H_ALIGN_RIGHT
@ GR_TEXT_H_ALIGN_LEFT
@ GR_TEXT_V_ALIGN_BOTTOM
@ 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< int > VECTOR2I
Definition: vector2d.h:588