KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew/dialogs/dialog_global_edit_text_and_graphics.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) 2012 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
21#include <string_utils.h>
22#include <board_commit.h>
23#include <pcb_edit_frame.h>
26#include <board.h>
28#include <footprint.h>
29#include <pcb_group.h>
30#include <pcb_barcode.h>
31#include <pcb_dimension.h>
32#include <pcb_shape.h>
33#include <pcb_text.h>
34#include <widgets/unit_binder.h>
35#include <widgets/font_choice.h>
37#include <bitmaps.h>
38#include <gr_text.h>
39#include <tool/tool_manager.h>
43
44// Columns of layer classes grid
45enum
46{
54};
55
56enum
57{
65};
66
67
68static wxString g_referenceFilter;
69static wxString g_footprintFilter;
70
71
73{
74public:
77
78protected:
79 void onActionButtonChange( wxCommandEvent& event ) override;
80 void onSpecifiedValueUpdateUI( wxUpdateUIEvent& event ) override;
81 void onDimensionItemCheckbox( wxCommandEvent& aEvent ) override;
82 void onAutoTextThickness( wxCommandEvent& aEvent ) override;
83 void onTextSize( wxCommandEvent& aEvent ) override;
84
85 void OnLayerFilterSelect( wxCommandEvent& event ) override
86 {
87 m_layerFilterOpt->SetValue( true );
88 }
89 void OnReferenceFilterText( wxCommandEvent& event ) override
90 {
91 m_referenceFilterOpt->SetValue( true );
92 }
93 void OnFootprintFilterText( wxCommandEvent& event ) override
94 {
95 m_footprintFilterOpt->SetValue( true );
96 }
97
98 bool TransferDataToWindow() override;
99 bool TransferDataFromWindow() override;
100
101 void visitItem( BOARD_COMMIT& aCommit, BOARD_ITEM* aItem );
102 void processItem( BOARD_COMMIT& aCommit, BOARD_ITEM* aItem );
103
104private:
109
114};
115
116
123{
124 m_parent = parent;
125 m_brdSettings = &m_parent->GetDesignSettings();
126 m_isBoardEditor = dynamic_cast<PCB_EDIT_FRAME*>( m_parent ) != nullptr;
127
128 if( !m_isBoardEditor )
129 {
130 m_footprintTexts->SetLabel( _( "Text items" ) );
131 m_footprintGraphics->SetLabel( _( "Graphic items" ) );
132 m_footprintDimensions->SetLabel( _( "Dimension items" ) );
133
134 m_boardText->Show( false );
135 m_boardGraphics->Show( false );
136 m_boardDimensions->Show( false );
137
138 m_referenceFilterOpt->Show( false );
139 m_referenceFilter->Show( false );
140 m_footprintFilterOpt->Show( false );
141 m_footprintFilter->Show( false );
142 }
143
144 // Allow indeterminate state in font control and rebuild list
145 m_fontCtrl->SetHasIndeterminateChoice();
146 m_fontCtrl->RefreshFonts();
147
148 m_autoTextThickness->SetIsCheckButton();
150
151 m_layerFilter->SetBoardFrame( m_parent );
152 m_layerFilter->SetLayersHotkeys( false );
153 m_layerFilter->Resync();
154
155 m_LayerCtrl->SetBoardFrame( m_parent );
156 m_LayerCtrl->SetLayersHotkeys( false );
157 m_LayerCtrl->SetUndefinedLayerName( INDETERMINATE_ACTION );
158 m_LayerCtrl->Resync();
159
160 m_grid->SetCellHighlightPenWidth( 0 );
161 m_grid->SetDefaultCellFont( KIUI::GetInfoFont( this ) );
162 m_grid->SetDefaultRowSize( m_grid->GetDefaultRowSize() - FromDIP( 2 ) );
163
164 SetupStandardButtons( { { wxID_OK, _( "Apply and Close" ) },
165 { wxID_CANCEL, _( "Close" ) } } );
166
168}
169
170
172{
173 if( m_isBoardEditor )
174 {
177 }
178}
179
180
182{
183 PCB_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
184 m_selection = selTool->GetSelection();
185
186 if( m_isBoardEditor )
187 {
188 // SetValue() generates events, ChangeValue() does not
189 m_referenceFilter->ChangeValue( g_referenceFilter );
190 m_footprintFilter->ChangeValue( g_footprintFilter );
191 }
192
194
195 m_fontCtrl->SetStringSelection( INDETERMINATE_ACTION );
196
200 m_autoTextThickness->Check( false );
201 m_thickness.Enable( true );
202 m_bold->Set3StateValue( wxCHK_UNDETERMINED );
203 m_italic->Set3StateValue( wxCHK_UNDETERMINED );
204 m_keepUpright->Set3StateValue( wxCHK_UNDETERMINED );
205 m_visible->Set3StateValue( wxCHK_UNDETERMINED );
206 m_LayerCtrl->SetLayerSelection( UNDEFINED_LAYER );
207
208 wxCommandEvent dummy;
210
211#define SET_INT_VALUE( aRow, aCol, aValue ) \
212 m_grid->SetCellValue( aRow, aCol, m_parent->StringFromValue( aValue, true ) )
213
214#define SET_BOOL_VALUE( aRow, aCol, aValue ) \
215 attr = new wxGridCellAttr; \
216 attr->SetRenderer( new wxGridCellBoolRenderer() ); \
217 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \
218 attr->SetReadOnly(); \
219 m_grid->SetAttr( aRow, aCol, attr ); \
220 m_grid->SetCellValue( aRow, aCol, ( aValue ) ? wxT( "1" ) : wxT( "" ) )
221
222 const BOARD_DESIGN_SETTINGS& bds = m_parent->GetBoard()->GetDesignSettings();
223 wxGridCellAttr* attr;
224
225 m_grid->SetCellValue( ROW_SILK, COL_CLASS_NAME, _( "Silk Layers" ) );
226 m_grid->SetCellValue( ROW_COPPER, COL_CLASS_NAME, _( "Copper Layers" ) );
227 m_grid->SetCellValue( ROW_EDGES, COL_CLASS_NAME, _( "Edge Cuts" ) );
228 m_grid->SetCellValue( ROW_COURTYARD, COL_CLASS_NAME, _( "Courtyards" ) );
229 m_grid->SetCellValue( ROW_FAB, COL_CLASS_NAME, _( "Fab Layers" ) );
230 m_grid->SetCellValue( ROW_OTHERS, COL_CLASS_NAME, _( "Other Layers" ) );
231
232 m_grid->SetCellValue( ROW_HEADER, COL_LINE_THICKNESS, _( "Line Thickness" ) );
239
240 m_grid->SetCellValue( ROW_HEADER, COL_TEXT_WIDTH, _( "Text Width" ) );
245
246 m_grid->SetCellValue( ROW_HEADER, COL_TEXT_HEIGHT, _( "Text Height" ) );
251
252 m_grid->SetCellValue( ROW_HEADER, COL_TEXT_THICKNESS, _( "Text Thickness" ) );
257
258 attr = new wxGridCellAttr;
259 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \
260 m_grid->SetAttr( ROW_HEADER, COL_TEXT_ITALIC, attr ); \
261 m_grid->SetCellValue( ROW_HEADER, COL_TEXT_ITALIC, _( "Italic" ) );
266
267 attr = new wxGridCellAttr;
268 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \
269 m_grid->SetAttr( ROW_HEADER, COL_TEXT_UPRIGHT, attr ); \
270 m_grid->SetCellValue( ROW_HEADER, COL_TEXT_UPRIGHT, _( "Keep Upright" ) );
275
276 return true;
277
278#undef SET_INT_VALUE
279#undef SET_BOOL_VALUE
280}
281
282
284{
285 // Update the UNIT_BINDER controls if the action to take is changed
286 bool enable = m_setToSpecifiedValues->GetValue();
287
288 m_LayerLabel->Enable( enable );
289 m_LayerCtrl->Enable( enable );
290
291 m_lineWidth.Enable( enable );
292 m_textWidth.Enable( enable );
293 m_textHeight.Enable( enable );
294 m_thickness.Enable( enable && !m_autoTextThickness->IsChecked() );
295
296 m_fontLabel->Enable( enable );
297 m_fontCtrl->Enable( enable );
298
299 m_centerOnFP->Enable( enable );
300
301 enable = !enable;
302 m_grid->Enable( enable );
303}
304
305
307{
308 // Update the UI for the elements inside the use specified values sizer
309 event.Enable( m_setToSpecifiedValues->GetValue() );
310}
311
312
314{
315 if( m_footprintDimensions->GetValue() || m_boardDimensions->GetValue() )
316 m_setToLayerDefaults->SetLabel( _( "Set to layer and dimension default values:" ) );
317 else
318 m_setToLayerDefaults->SetLabel( _( "Set to layer default values:" ) );
319}
320
321
323{
324 if( aEvent.IsChecked() )
325 {
326 m_autoTextThickness->Check( true );
327
328 wxCommandEvent dummy;
329 onTextSize( dummy );
330
331 if( m_textWidth.IsIndeterminate() || m_textHeight.IsIndeterminate() )
332 m_thickness.SetValue( _( "(auto)" ) );
333
334 m_thickness.Enable( false );
335 }
336 else
337 {
338 m_thickness.Enable( true );
340 }
341}
342
343
345{
346 if( !m_autoTextThickness->IsChecked() )
347 return;
348
349 if( m_textWidth.IsIndeterminate() || m_textHeight.IsIndeterminate() )
350 return;
351
352 int size = std::min( m_textWidth.GetValue(), m_textHeight.GetValue() );
353
354 m_thickness.SetValue( GetPenSizeForNormal( size ) );
355}
356
357
359{
360 aCommit.Modify( aItem );
361
362 PCB_FIELD* field = dynamic_cast<PCB_FIELD*>( aItem );
363 EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( aItem );
364 PCB_SHAPE* shape = dynamic_cast<PCB_SHAPE*>( aItem );
365 PCB_DIMENSION_BASE* dimension = dynamic_cast<PCB_DIMENSION_BASE*>( aItem );
366 PCB_BARCODE* barcode = dynamic_cast<PCB_BARCODE*>( aItem );
367 FOOTPRINT* parentFP = aItem->GetParentFootprint();
368
369 if( m_setToSpecifiedValues->GetValue() )
370 {
371 if( m_LayerCtrl->GetLayerSelection() != UNDEFINED_LAYER )
372 aItem->SetLayer( ToLAYER_ID( m_LayerCtrl->GetLayerSelection() ) );
373
374 if( text )
375 {
376 if( !m_textWidth.IsIndeterminate() )
377 text->SetTextSize( VECTOR2I( m_textWidth.GetIntValue(), text->GetTextSize().y ) );
378
379 if( !m_textHeight.IsIndeterminate() )
380 text->SetTextSize( VECTOR2I( text->GetTextSize().x, m_textHeight.GetIntValue() ) );
381
382 if( m_autoTextThickness->IsChecked() )
383 text->SetAutoThickness( true );
384 else if( !m_thickness.IsIndeterminate() )
385 text->SetTextThickness( m_thickness.GetIntValue() );
386
387 // Must be after SetTextSize()
388 if( m_bold->Get3StateValue() != wxCHK_UNDETERMINED )
389 text->SetBold( m_bold->GetValue() );
390
391 if( m_italic->Get3StateValue() != wxCHK_UNDETERMINED )
392 text->SetItalic( m_italic->GetValue() );
393
394 // Must come after setting bold & italic
395 if( m_fontCtrl->GetStringSelection() != INDETERMINATE_ACTION )
396 {
397 text->SetFont( m_fontCtrl->GetFontSelection( text->IsBold(), text->IsItalic() ) );
398 }
399 else if(( m_italic->Get3StateValue() != wxCHK_UNDETERMINED
400 || m_bold->Get3StateValue() != wxCHK_UNDETERMINED ) )
401 {
402 if( !text->GetFontName().IsEmpty() )
403 {
404 text->SetFont( KIFONT::FONT::GetFont( text->GetFontName(), text->IsBold(),
405 text->IsItalic(),
406 m_parent->GetBoard()->GetEmbeddedFiles()->GetFontFiles() ) );
407 }
408 }
409
410 if( parentFP )
411 {
412 if( m_keepUpright->Get3StateValue() != wxCHK_UNDETERMINED )
413 text->SetKeepUpright( m_keepUpright->GetValue() );
414
415 if( m_centerOnFP->GetValue() == wxCHK_CHECKED )
416 text->SetTextPos( aItem->GetParent()->GetCenter() );
417 }
418 }
419
420 if( barcode )
421 {
422 if( !m_textHeight.IsIndeterminate() )
423 barcode->SetTextSize( m_textHeight.GetIntValue() );
424 else if( !m_textWidth.IsIndeterminate() )
425 barcode->SetTextSize( m_textWidth.GetIntValue() );
426 }
427
428 if( field )
429 {
430 if( m_visible->Get3StateValue() != wxCHK_UNDETERMINED )
431 field->SetVisible( m_visible->GetValue() );
432 }
433
434 if( !m_lineWidth.IsIndeterminate() )
435 {
436 if( shape )
437 {
438 STROKE_PARAMS stroke = shape->GetStroke();
439 stroke.SetWidth( m_lineWidth.GetIntValue() );
440 shape->SetStroke( stroke );
441 }
442
443 if( dimension )
444 dimension->SetLineThickness( m_lineWidth.GetIntValue() );
445 }
446 }
447 else
448 {
449 aItem->StyleFromSettings( *m_brdSettings, false );
450 }
451}
452
453
455{
456 if( m_selectedItemsFilter->GetValue() )
457 {
458 EDA_ITEM* candidate = aItem;
459
460 if( !candidate->IsSelected() )
461 {
462 if( candidate->GetParent() && candidate->GetParent()->Type() == PCB_FOOTPRINT_T )
463 candidate = candidate->GetParent();
464 }
465
466 if( !candidate->IsSelected() )
467 {
468 candidate = ( candidate->GetParentGroup() ? candidate->GetParentGroup()->AsEdaItem() : nullptr );
469
470 while( candidate && !candidate->IsSelected() && candidate->GetParentGroup() )
471 candidate = candidate->GetParentGroup()->AsEdaItem();
472
473 if( !candidate || !candidate->IsSelected() )
474 return;
475 }
476 }
477
478 if( m_layerFilterOpt->GetValue() && m_layerFilter->GetLayerSelection() != UNDEFINED_LAYER )
479 {
480 if( aItem->GetLayer() != m_layerFilter->GetLayerSelection() )
481 return;
482 }
483
484 if( m_isBoardEditor )
485 {
486 if( m_referenceFilterOpt->GetValue() && !m_referenceFilter->GetValue().IsEmpty() )
487 {
488 if( FOOTPRINT* fp = aItem->GetParentFootprint() )
489 {
490 if( !WildCompareString( m_referenceFilter->GetValue(), fp->GetReference(), false ) )
491 return;
492 }
493 }
494
495 if( m_footprintFilterOpt->GetValue() && !m_footprintFilter->GetValue().IsEmpty() )
496 {
497 if( FOOTPRINT* fp = aItem->GetParentFootprint() )
498 {
499 if( !WildCompareString( m_footprintFilter->GetValue(), fp->GetFPID().Format(), false ) )
500 return;
501 }
502 }
503 }
504
505 processItem( aCommit, aItem );
506}
507
508
510{
511 int minTextSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
512 int maxTextSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
513
514 if( !m_textWidth.Validate( minTextSize, maxTextSize )
515 || !m_textHeight.Validate( minTextSize, maxTextSize ) )
516 {
517 return false;
518 }
519
520 BOARD_COMMIT commit( m_parent );
521
522 // Go through the footprints
523 for( FOOTPRINT* fp : m_parent->GetBoard()->Footprints() )
524 {
525 if( m_references->GetValue() )
526 visitItem( commit, &fp->Reference() );
527
528 if( m_values->GetValue() )
529 visitItem( commit, &fp->Value() );
530
531 for( PCB_FIELD* field : fp->GetFields() )
532 {
533 wxCHECK2( field, continue );
534
535 if( field->IsReference() )
536 continue;
537
538 if( field->IsValue() )
539 continue;
540
541 if( m_otherFootprintFields->GetValue() )
542 visitItem( commit, field );
543 else if( m_references->GetValue() && field->GetText() == wxT( "${REFERENCE}" ) )
544 visitItem( commit, field );
545 else if( m_values->GetValue() && field->GetText() == wxT( "${VALUE}" ) )
546 visitItem( commit, field );
547 }
548
549 // Go through all other footprint items
550 for( BOARD_ITEM* boardItem : fp->GraphicalItems() )
551 {
552 KICAD_T itemType = boardItem->Type();
553
554 if( itemType == PCB_TEXT_T || itemType == PCB_TEXTBOX_T )
555 {
556 EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( boardItem );
557
558 if( m_footprintTexts->GetValue() )
559 visitItem( commit, boardItem );
560 else if( m_references->GetValue() && textItem->GetText() == wxT( "${REFERENCE}" ) )
561 visitItem( commit, boardItem );
562 else if( m_values->GetValue() && textItem->GetText() == wxT( "${VALUE}" ) )
563 visitItem( commit, boardItem );
564 }
565 else if( itemType == PCB_TABLE_T )
566 {
567 boardItem->RunOnChildren(
568 [&]( BOARD_ITEM* child )
569 {
570 if( child->Type() == PCB_TABLECELL_T && m_footprintTexts->GetValue() )
571 visitItem( commit, child );
572 },
574 }
575 else if( BaseType( itemType ) == PCB_DIMENSION_T )
576 {
577 if( m_footprintDimensions->GetValue() )
578 visitItem( commit, boardItem );
579 }
580 else if( itemType == PCB_SHAPE_T || itemType == PCB_BARCODE_T )
581 {
582 if( m_footprintGraphics->GetValue() )
583 visitItem( commit, boardItem );
584 }
585 }
586 }
587
588 if( m_isBoardEditor )
589 {
590 // Go through the PCB text & graphic items
591 for( BOARD_ITEM* boardItem : m_parent->GetBoard()->Drawings() )
592 {
593 KICAD_T itemType = boardItem->Type();
594
595 if( itemType == PCB_TEXT_T || itemType == PCB_TEXTBOX_T )
596 {
597 if( m_boardText->GetValue() )
598 visitItem( commit, boardItem );
599 }
600 else if( itemType == PCB_TABLE_T )
601 {
602 boardItem->RunOnChildren(
603 [&]( BOARD_ITEM* child )
604 {
605 if( child->Type() == PCB_TABLECELL_T && m_boardText->GetValue() )
606 visitItem( commit, child );
607 },
609 }
610 else if( BaseType( itemType ) == PCB_DIMENSION_T )
611 {
612 if( m_boardDimensions->GetValue() )
613 visitItem( commit, boardItem );
614 }
615 else if( itemType == PCB_SHAPE_T || itemType == PCB_BARCODE_T )
616 {
617 if( m_boardGraphics->GetValue() )
618 visitItem( commit, boardItem );
619 }
620 }
621 }
622
623 commit.Push( _( "Edit Text and Graphics" ) );
624 m_parent->GetCanvas()->Refresh();
625
626 return true;
627}
628
629
631{
634
635 dlg.ShowModal();
636 return 0;
637}
638
639
641{
644
645 dlg.ShowModal();
646 return 0;
647}
648
649
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:121
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
@ edit_cmp_symb_links
@ LAYER_CLASS_OTHERS
@ LAYER_CLASS_FAB
@ LAYER_CLASS_COURTYARD
@ LAYER_CLASS_SILK
@ LAYER_CLASS_COPPER
@ LAYER_CLASS_EDGES
Container for design settings for a BOARD object.
bool m_TextUpright[LAYER_CLASS_COUNT]
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual VECTOR2I GetCenter() const
This defaults to the center of the bounding box if not overridden.
Definition board_item.h:150
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition board_item.h:374
FOOTPRINT * GetParentFootprint() const
BOARD_ITEM_CONTAINER * GetParent() const
Definition board_item.h:266
virtual void StyleFromSettings(const BOARD_DESIGN_SETTINGS &settings, bool aCheckSide)
Definition board_item.h:423
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
Definition commit.h:102
DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Edit Text and Graphic Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void processItem(SCH_COMMIT *aCommit, const SCH_SHEET_PATH &aSheetPath, SCH_ITEM *aItem)
void visitItem(SCH_COMMIT *aCommit, const SCH_SHEET_PATH &aSheetPath, SCH_ITEM *aItem)
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int ShowModal() override
virtual EDA_ITEM * AsEdaItem()=0
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:116
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
bool IsSelected() const
Definition eda_item.h:134
EDA_ITEM * GetParent() const
Definition eda_item.h:112
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:94
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:118
virtual void SetVisible(bool aVisible)
Definition eda_text.cpp:342
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
Definition font.cpp:143
void SetTextSize(int aTextSize)
Change the height of the human-readable text displayed below the barcode.
Common, abstract interface for edit frames.
Abstract dimension API.
void SetLineThickness(int aWidth)
The main frame for Pcbnew.
PCB_SELECTION & GetSelection()
STROKE_PARAMS GetStroke() const override
void SetStroke(const STROKE_PARAMS &aStroke) override
Simple container to manage line stroke parameters.
void SetWidth(int aWidth)
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:182
Generic, UI-independent tool event.
Definition tool_event.h:167
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.
#define _(s)
@ NO_RECURSE
Definition eda_item.h:52
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
Definition eda_text.h:61
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
Definition eda_text.h:62
int GetPenSizeForNormal(int aTextSize)
Definition gr_text.cpp:57
@ UNDEFINED_LAYER
Definition layer_ids.h:57
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition lset.cpp:750
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
#define SET_INT_VALUE(aRow, aCol, aValue)
#define SET_BOOL_VALUE(aRow, aCol, aValue)
std::vector< FAB_LAYER_COLOR > dummy
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
Definition typeinfo.h:259
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:80
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:85
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:84
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:93
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition typeinfo.h:87
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:78
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition typeinfo.h:92
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:86
#define INDETERMINATE_ACTION
Definition ui_common.h:47
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683