KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_pin_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) 2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2016-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
25#include <bitmaps.h>
26#include <sch_painter.h>
27#include <symbol_edit_frame.h>
28#include <sch_pin.h>
30#include <confirm.h>
31#include <kiplatform/ui.h>
33#include <widgets/wx_grid.h>
34#include <grid_tricks.h>
37#include <wx/hyperlink.h>
38
39class ALT_PIN_DATA_MODEL : public wxGridTableBase, public std::vector<SCH_PIN::ALT>
40{
41public:
43 {
44 }
45
46 int GetNumberRows() override { return (int) size(); }
47 int GetNumberCols() override { return COL_COUNT; }
48
49 wxString GetColLabelValue( int aCol ) override
50 {
51 switch( aCol )
52 {
53 case COL_NAME: return _( "Alternate Pin Name" );
54 case COL_TYPE: return _( "Electrical Type" );
55 case COL_SHAPE: return _( "Graphic Style" );
56 default: wxFAIL; return wxEmptyString;
57 }
58 }
59
60 bool IsEmptyCell( int row, int col ) override
61 {
62 return false; // don't allow adjacent cell overflow, even if we are actually empty
63 }
64
65 wxString GetValue( int aRow, int aCol ) override
66 {
67 switch( aCol )
68 {
69 case COL_NAME: return at( aRow ).m_Name;
70 case COL_TYPE: return PinTypeNames()[static_cast<int>( at( aRow ).m_Type )];
71 case COL_SHAPE: return PinShapeNames()[static_cast<int>( at( aRow ).m_Shape )];
72 default: wxFAIL; return wxEmptyString;
73 }
74 }
75
76 void SetValue( int aRow, int aCol, const wxString &aValue ) override
77 {
78 switch( aCol )
79 {
80 case COL_NAME:
81 at( aRow ).m_Name = aValue;
82 break;
83
84 case COL_TYPE:
85 if( PinTypeNames().Index( aValue ) != wxNOT_FOUND )
86 at( aRow ).m_Type = (ELECTRICAL_PINTYPE) PinTypeNames().Index( aValue );
87
88 break;
89
90 case COL_SHAPE:
91 if( PinShapeNames().Index( aValue ) != wxNOT_FOUND )
92 at( aRow ).m_Shape = (GRAPHIC_PINSHAPE) PinShapeNames().Index( aValue );
93
94 break;
95
96 default:
97 wxFAIL;
98 break;
99 }
100 }
101
102 void AppendRow( const SCH_PIN::ALT& aAlt )
103 {
104 push_back( aAlt );
105
106 if ( GetView() )
107 {
108 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
109 GetView()->ProcessTableMessage( msg );
110 }
111 }
112
113 void RemoveRow( int aRow )
114 {
115 erase( begin() + aRow );
116
117 if ( GetView() )
118 {
119 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow, 1 );
120 GetView()->ProcessTableMessage( msg );
121 }
122 }
123};
124
125
128 m_frame( parent ),
129 m_pin( aPin ),
130 m_posX( parent, m_posXLabel, m_posXCtrl, m_posXUnits ),
131 m_posY( parent, m_posYLabel, m_posYCtrl, m_posYUnits ),
132 m_pinLength( parent, m_pinLengthLabel, m_pinLengthCtrl, m_pinLengthUnits ),
133 m_nameSize( parent, m_nameSizeLabel, m_nameSizeCtrl, m_nameSizeUnits ),
134 m_numberSize( parent, m_numberSizeLabel, m_numberSizeCtrl, m_numberSizeUnits ),
135 m_delayedFocusRow( -1 ),
136 m_delayedFocusColumn( -1 ),
137 m_initialized( false )
138{
139 // Creates a dummy pin to show on a panel, inside this dialog:
140 m_dummyParent = new LIB_SYMBOL( *static_cast<LIB_SYMBOL*>( m_pin->GetParentSymbol() ) );
141 m_dummyPin = new SCH_PIN( *m_pin );
145
147 m_panelShowPin->SetBackgroundColour( bgColor.ToColour() );
148
149 const wxArrayString& orientationNames = PinOrientationNames();
150 const std::vector<BITMAPS>& orientationIcons = PinOrientationIcons();
151
152 for ( unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
153 m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ),
154 ii );
155
156 // We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
157 // implementation on MSW
158 m_tabOrder = {
174 };
175
176 // Default alternates turndown to whether or not alternates exist, or if we've had it open before
178
179 // wxwidgets doesn't call the OnCollapseChange even at init, so we update this value if
180 // the alternates pane defaults to open
181 if ( m_pin->GetAlternates().size() > 0 )
183
185
186 // Save original columns widths so we can do proportional sizing.
187 for( int i = 0; i < COL_COUNT; ++i )
188 m_originalColWidths[ i ] = m_alternatesGrid->GetColSize( i );
189
190 // Give a bit more room for combobox editors
191 m_alternatesGrid->SetDefaultRowSize( m_alternatesGrid->GetDefaultRowSize() + 4 );
192
194 m_alternatesGrid->PushEventHandler( new GRID_TRICKS( m_alternatesGrid,
195 [this]( wxCommandEvent& aEvent )
196 {
197 OnAddAlternate( aEvent );
198 } ) );
199
201 {
202 m_alternatesTurndown->Collapse();
203 m_alternatesTurndown->Disable();
204 m_alternatesTurndown->SetToolTip( _( "Alternate pin assignments are not available for "
205 "De Morgan symbols." ) );
206 }
207
208 // Set special attributes
209 wxGridCellAttr* attr;
210
211 attr = new wxGridCellAttr;
212 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(), PinTypeNames() ) );
213 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinTypeIcons(), PinTypeNames() ) );
214 m_alternatesGrid->SetColAttr( COL_TYPE, attr );
215
216 attr = new wxGridCellAttr;
217 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(), PinShapeNames() ) );
218 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinShapeIcons(), PinShapeNames() ) );
219 m_alternatesGrid->SetColAttr( COL_SHAPE, attr );
220
221 m_addAlternate->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
222 m_deleteAlternate->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
223 m_addAlternate->GetParent()->Layout();
224
227
228 // Now all widgets have the size fixed, call FinishDialogSettings
230
231 // On some window managers (Unity, XFCE) the dialog is not always raised, depending on
232 // how it is run.
233 Raise();
234
235 m_initialized = true;
236}
237
238
240{
241 delete m_dummyPin;
242 delete m_dummyParent;
243
244 // Prevents crash bug in wxGrid's d'tor
246
247 // Delete the GRID_TRICKS.
248 m_alternatesGrid->PopEventHandler( true );
249}
250
251
253{
254 if( !DIALOG_SHIM::TransferDataToWindow() )
255 return false;
256
258
262 m_textPinName->SetValue( m_pin->GetName() );
266 m_textPinNumber->SetValue( m_pin->GetNumber() );
270 m_checkApplyToAllParts->SetValue( m_pin->GetParentSymbol()->IsMulti() && m_pin->GetUnit() == 0 );
272 m_checkShow->SetValue( m_pin->IsVisible() );
273
275
276 wxString commonUnitsToolTip;
277
279 {
280 wxHyperlinkCtrl* button = new wxHyperlinkCtrl( m_infoBar, wxID_ANY,
281 _( "Exit sync pins mode" ),
282 wxEmptyString );
283
284 button->Bind( wxEVT_COMMAND_HYPERLINK,
285 std::function<void( wxHyperlinkEvent& aEvent )>(
286 [&]( wxHyperlinkEvent& aEvent )
287 {
288 m_frame->m_SyncPinEdit = false;
290 } ) );
291
293 m_infoBar->AddButton( button );
295
296 commonUnitsToolTip = _( "Synchronized pins mode is enabled.\n"
297 "Similar pins will be edited regardless of this option." );
298 }
299 else
300 {
301 commonUnitsToolTip = _( "If checked, this pin will exist in all units." );
302 }
303
304 if( !m_pin->GetParentSymbol()->IsMulti() )
305 commonUnitsToolTip = _( "This symbol only has one unit. This control has no effect." );
306
307 m_checkApplyToAllParts->SetToolTip( commonUnitsToolTip );
308
309 for( const std::pair<const wxString, SCH_PIN::ALT>& alt : m_pin->GetAlternates() )
310 m_alternatesDataModel->AppendRow( alt.second );
311
312 return true;
313}
314
315
317{
319 return false;
320
321 // Check for missing alternate names.
322 for( size_t i = 0; i < m_alternatesDataModel->size(); ++i )
323 {
324 if( m_alternatesDataModel->at( i ).m_Name.IsEmpty() )
325 {
326 DisplayErrorMessage( this, _( "Alternate pin definitions must have a name." ) );
327
330
331 return false;
332 }
333 }
334
335 if( !DIALOG_SHIM::TransferDataFromWindow() )
336 return false;
337
339
340 const int standard_grid = 50;
341
342 // Only show the warning if the position has been changed
343 if( ( m_origPos != newPos )
344 && (( m_posX.GetValue() % standard_grid ) || ( m_posY.GetValue() % standard_grid ) ) )
345 {
346 wxString msg = wxString::Format( _( "This pin is not on a %d mils grid which will make it "
347 "difficult to connect to in the schematic.\n"
348 "Do you wish to continue?" ),
349 standard_grid );
350 if( !IsOK( this, msg ) )
351 return false;
352 }
353
354 m_pin->SetName( m_textPinName->GetValue() );
355 m_pin->SetNumber( m_textPinNumber->GetValue() );
359 m_pin->SetPosition( newPos );
364 m_pin->SetUnit( m_checkApplyToAllParts->GetValue() ? 0 : m_frame->GetUnit() );
365 m_pin->SetVisible( m_checkShow->GetValue() );
366
367 std::map<wxString, SCH_PIN::ALT>& alternates = m_pin->GetAlternates();
368 alternates.clear();
369
370 for( const SCH_PIN::ALT& alt : *m_alternatesDataModel )
371 alternates[ alt.m_Name ] = alt;
372
373 return true;
374}
375
376
377/*
378 * Draw (on m_panelShowPin) the pin according to current settings in dialog
379 */
381{
382 wxPaintDC dc( m_panelShowPin );
383 wxSize dc_size = dc.GetSize();
384 dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
385
386 // Give a parent to m_dummyPin for draw purposes.
387 // In fact m_dummyPin should not have a parent, but draw functions need a parent
388 // to know some options, about pin texts
389 SYMBOL_EDIT_FRAME* symbolEditor = (SYMBOL_EDIT_FRAME*) GetParent();
390
391 // Calculate a suitable scale to fit the available draw area
392 BOX2I bBox = m_dummyPin->GetBoundingBox( true, true, false );
394
395 double xscale = (double) dc_size.x / bBox.GetWidth();
396 double yscale = (double) dc_size.y / bBox.GetHeight();
397 double scale = std::min( xscale, yscale );
398
399 // Give a 7% margin (each side) and limit to no more than 100% zoom
400 scale = std::min( scale * 0.85, 1.0 );
401 dc.SetUserScale( scale, scale );
402 GRResetPenAndBrush( &dc );
403
404 SCH_RENDER_SETTINGS renderSettings( *symbolEditor->GetRenderSettings() );
405 renderSettings.m_ShowPinNumbers = true;
406 renderSettings.m_ShowPinNames = true;
407 renderSettings.m_ShowHiddenFields = true;
408 renderSettings.m_ShowConnectionPoints = true;
409 renderSettings.m_Transform = TRANSFORM();
410 renderSettings.SetPrintDC( &dc );
411
412 m_dummyPin->Print( &renderSettings, 0, 0, -bBox.Centre(), false, false );
413
414 event.Skip();
415}
416
417
418void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
419{
420 if( !IsShownOnScreen() ) // do nothing at init time
421 return;
422
423 m_dummyPin->SetName( m_textPinName->GetValue() );
424 m_dummyPin->SetNumber( m_textPinNumber->GetValue() );
431 m_dummyPin->SetVisible( m_checkShow->GetValue() );
432
433 if( event.GetEventObject() == m_checkApplyToAllParts && m_frame->m_SyncPinEdit )
435
436 m_panelShowPin->Refresh();
437}
438
440{
441 if( m_checkApplyToAllParts->GetValue() )
442 return _( "Synchronized Pins Mode." );
443 else if( m_pin->IsNew() )
444 return _( "Synchronized Pins Mode. New pin will be added to all units." );
445 else
446 return _( "Synchronized Pins Mode. Matching pins in other units will be updated." );
447}
448
449
450void DIALOG_PIN_PROPERTIES::OnAddAlternate( wxCommandEvent& event )
451{
453 return;
454
455 SCH_PIN::ALT newAlt;
456 newAlt.m_Name = wxEmptyString;
457 newAlt.m_Type = m_pin->GetType();
458 newAlt.m_Shape = m_pin->GetShape();
459
461
462 m_alternatesGrid->MakeCellVisible( m_alternatesGrid->GetNumberRows() - 1, 0 );
463 m_alternatesGrid->SetGridCursor( m_alternatesGrid->GetNumberRows() - 1, 0 );
464
465 m_alternatesGrid->EnableCellEditControl( true );
466 m_alternatesGrid->ShowCellEditControl();
467}
468
469
470void DIALOG_PIN_PROPERTIES::OnDeleteAlternate( wxCommandEvent& event )
471{
473 return;
474
475 if( m_alternatesDataModel->size() == 0 ) // empty table
476 return;
477
478 int curRow = m_alternatesGrid->GetGridCursorRow();
479
480 if( curRow < 0 )
481 return;
482
484
485 curRow = std::max( 0, curRow - 1 );
486 m_alternatesGrid->MakeCellVisible( curRow, m_alternatesGrid->GetGridCursorCol() );
487 m_alternatesGrid->SetGridCursor( curRow, m_alternatesGrid->GetGridCursorCol() );
488}
489
490
492{
493 // Account for scroll bars
495
496 wxGridUpdateLocker deferRepaintsTillLeavingScope;
497
500
503}
504
505
506void DIALOG_PIN_PROPERTIES::OnSize( wxSizeEvent& event )
507{
508 auto new_size = event.GetSize();
509
510 if( m_initialized && m_size != new_size )
511 {
512 m_size = new_size;
513
515 }
516
517 // Always propagate for a grid repaint (needed if the height changes, as well as width)
518 event.Skip();
519}
520
521
522void DIALOG_PIN_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
523{
524 // Handle a delayed focus
525 if( m_delayedFocusRow >= 0 )
526 {
527 m_alternatesTurndown->Collapse( false );
528
529 m_alternatesGrid->SetFocus();
532
533 m_alternatesGrid->EnableCellEditControl( true );
534 m_alternatesGrid->ShowCellEditControl();
535
538 }
539}
540void DIALOG_PIN_PROPERTIES::OnCollapsiblePaneChange( wxCollapsiblePaneEvent& event )
541{
542 if( !event.GetCollapsed() )
543 {
544 wxTopLevelWindow* tlw = dynamic_cast<wxTopLevelWindow*>( wxGetTopLevelParent( this ) );
545
546 if( tlw )
547 {
548 tlw->InvalidateBestSize();
549 wxSize bestSize = tlw->GetBestSize();
550 wxSize currentSize = tlw->GetSize();
551 tlw->SetSize( wxMax( bestSize.GetWidth(), currentSize.GetWidth() ),
552 wxMax( bestSize.GetHeight(), currentSize.GetHeight() ) );
553 }
554 }
555}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:110
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
wxString GetColLabelValue(int aCol) override
void SetValue(int aRow, int aCol, const wxString &aValue) override
ALT_PIN_DATA_MODEL(EDA_UNITS aUserUnits)
wxString GetValue(int aRow, int aCol) override
void AppendRow(const SCH_PIN::ALT &aAlt)
bool IsEmptyCell(int row, int col) override
size_type GetHeight() const
Definition: box2.h:205
size_type GetWidth() const
Definition: box2.h:204
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:541
Vec Centre() const
Definition: box2.h:87
Class DIALOG_PIN_PROPERTIES_BASE.
SYMBOL_EDIT_FRAME * m_frame
void OnUpdateUI(wxUpdateUIEvent &event) override
std::map< int, int > m_originalColWidths
void OnCollapsiblePaneChange(wxCollapsiblePaneEvent &event) override
void OnPropertiesChange(wxCommandEvent &event) override
void OnPaintShowPanel(wxPaintEvent &event) override
bool TransferDataToWindow() override
void OnAddAlternate(wxCommandEvent &event) override
ALT_PIN_DATA_MODEL * m_alternatesDataModel
void OnSize(wxSizeEvent &event) override
DIALOG_PIN_PROPERTIES(SYMBOL_EDIT_FRAME *parent, SCH_PIN *aPin)
bool TransferDataFromWindow() override
void OnDeleteAlternate(wxCommandEvent &event) override
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:230
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:102
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...
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:127
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:103
bool IsNew() const
Definition: eda_item.h:106
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
wxColour ToColour() const
Definition: color4d.cpp:220
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetPrintDC(wxDC *aDC)
Define a library symbol object.
Definition: lib_symbol.h:77
GRAPHIC_PINSHAPE GetPinShapeSelection()
void SetSelection(GRAPHIC_PINSHAPE aShape)
void SetSelection(ELECTRICAL_PINTYPE aType)
ELECTRICAL_PINTYPE GetPinTypeSelection()
SCH_RENDER_SETTINGS * GetRenderSettings()
virtual void SetBodyStyle(int aBodyStyle)
Definition: sch_item.h:239
const SYMBOL * GetParentSymbol() const
Definition: sch_item.cpp:161
int GetBodyStyle() const
Definition: sch_item.h:240
int GetUnit() const
Definition: sch_item.h:237
virtual void SetUnit(int aUnit)
Definition: sch_item.h:236
int GetNumberTextSize() const
Definition: sch_pin.cpp:499
int GetLength() const
Definition: sch_pin.cpp:278
void SetNumber(const wxString &aNumber)
Definition: sch_pin.cpp:467
void SetVisible(bool aVisible)
Definition: sch_pin.h:105
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
Definition: sch_pin.cpp:1420
void SetOrientation(PIN_ORIENTATION aOrientation)
Definition: sch_pin.h:84
void SetName(const wxString &aName)
Definition: sch_pin.cpp:364
bool IsVisible() const
Definition: sch_pin.cpp:340
void SetPosition(const VECTOR2I &aPos) override
Definition: sch_pin.h:191
const wxString & GetName() const
Definition: sch_pin.cpp:353
void SetLength(int aLength)
Definition: sch_pin.h:90
PIN_ORIENTATION GetOrientation() const
Definition: sch_pin.cpp:245
void SetNumberTextSize(int aSize)
Definition: sch_pin.cpp:514
void SetShape(GRAPHIC_PINSHAPE aShape)
Definition: sch_pin.h:87
std::map< wxString, ALT > & GetAlternates()
Definition: sch_pin.h:121
VECTOR2I GetPosition() const override
Definition: sch_pin.cpp:237
int GetNameTextSize() const
Definition: sch_pin.cpp:477
void SetType(ELECTRICAL_PINTYPE aType)
Definition: sch_pin.h:100
const wxString & GetNumber() const
Definition: sch_pin.h:111
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_pin.h:163
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
Definition: sch_pin.cpp:541
GRAPHIC_PINSHAPE GetShape() const
Definition: sch_pin.cpp:258
ELECTRICAL_PINTYPE GetType() const
Definition: sch_pin.cpp:291
void SetNameTextSize(int aSize)
Definition: sch_pin.cpp:492
void SetBitmap(const wxBitmapBundle &aBmp)
The symbol library editor main window.
int GetBodyStyle() const
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
virtual bool IsMulti() const =0
virtual void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: symbol.h:129
virtual void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: symbol.h:123
virtual bool HasAlternateBodyStyle() const =0
Test if symbol has more than one body conversion type (DeMorgan).
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
int GetIntValue()
Definition: unit_binder.h:127
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
Definition: wx_grid.cpp:263
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
Definition: wx_grid.cpp:396
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:590
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
Definition: wx_infobar.cpp:301
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
Definition: wx_infobar.cpp:260
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Definition: wx_infobar.cpp:187
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Definition: wx_infobar.cpp:154
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:241
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:186
This file is part of the common library.
#define DANGLING_SYMBOL_SIZE
< The size of the rectangle indicating an unconnected wire or label
#define _(s)
EDA_UNITS
Definition: eda_units.h:46
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:73
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:390
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: gtk/ui.cpp:195
const std::vector< BITMAPS > & PinTypeIcons()
Definition: pin_type.cpp:162
const wxArrayString & PinTypeNames()
Definition: pin_type.cpp:153
int PinOrientationIndex(PIN_ORIENTATION code)
Definition: pin_type.cpp:70
const wxArrayString & PinShapeNames()
Definition: pin_type.cpp:171
const std::vector< BITMAPS > & PinShapeIcons()
Definition: pin_type.cpp:180
const wxArrayString & PinOrientationNames()
Definition: pin_type.cpp:189
PIN_ORIENTATION PinOrientationCode(size_t index)
Definition: pin_type.cpp:63
const std::vector< BITMAPS > & PinOrientationIcons()
Definition: pin_type.cpp:198
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition: pin_type.h:36
GRAPHIC_PINSHAPE
Definition: pin_type.h:57
const int scale
constexpr int MilsToIU(int mils) const
Definition: base_units.h:93
wxString m_Name
Definition: sch_pin.h:43
GRAPHIC_PINSHAPE m_Shape
Definition: sch_pin.h:44
ELECTRICAL_PINTYPE m_Type
Definition: sch_pin.h:45
Functions for manipulating tab traversal in forms and dialogs.