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 <lib_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<LIB_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 LIB_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:
141 m_dummyPin = new LIB_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], KiBitmap( orientationIcons[ii] ), ii );
154
155 // We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
156 // implementation on MSW
157 m_tabOrder = {
173 };
174
175 // Default alternates turndown to whether or not alternates exist, or if we've had it open before
177
178 // wxwidgets doesn't call the OnCollapseChange even at init, so we update this value if
179 // the alternates pane defaults to open
180 if ( m_pin->GetAlternates().size() > 0 )
182
184
185 // Save original columns widths so we can do proportional sizing.
186 for( int i = 0; i < COL_COUNT; ++i )
187 m_originalColWidths[ i ] = m_alternatesGrid->GetColSize( i );
188
189 // Give a bit more room for combobox editors
190 m_alternatesGrid->SetDefaultRowSize( m_alternatesGrid->GetDefaultRowSize() + 4 );
191
193 m_alternatesGrid->PushEventHandler( new GRID_TRICKS( m_alternatesGrid,
194 [this]( wxCommandEvent& aEvent )
195 {
196 OnAddAlternate( aEvent );
197 } ) );
198
199 if( aPin->GetParent()->HasConversion() )
200 {
201 m_alternatesTurndown->Collapse();
202 m_alternatesTurndown->Disable();
203 m_alternatesTurndown->SetToolTip( _( "Alternate pin assignments are not available for "
204 "De Morgan symbols." ) );
205 }
206
207 // Set special attributes
208 wxGridCellAttr* attr;
209
210 attr = new wxGridCellAttr;
211 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(), PinTypeNames() ) );
212 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinTypeIcons(), PinTypeNames() ) );
213 m_alternatesGrid->SetColAttr( COL_TYPE, attr );
214
215 attr = new wxGridCellAttr;
216 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(), PinShapeNames() ) );
217 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinShapeIcons(), PinShapeNames() ) );
218 m_alternatesGrid->SetColAttr( COL_SHAPE, attr );
219
220 m_addAlternate->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
221 m_deleteAlternate->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
222 m_addAlternate->GetParent()->Layout();
223
226
227 // Now all widgets have the size fixed, call FinishDialogSettings
229
230 // On some window managers (Unity, XFCE) the dialog is not always raised, depending on
231 // how it is run.
232 Raise();
233
234 m_initialized = true;
235}
236
237
239{
240 delete m_dummyPin;
241 delete m_dummyParent;
242
243 // Prevents crash bug in wxGrid's d'tor
245
246 // Delete the GRID_TRICKS.
247 m_alternatesGrid->PopEventHandler( true );
248}
249
250
252{
253 if( !DIALOG_SHIM::TransferDataToWindow() )
254 return false;
255
257
261 m_textPinName->SetValue( m_pin->GetName() );
265 m_textPinNumber->SetValue( m_pin->GetNumber() );
269 m_checkApplyToAllParts->SetValue( m_pin->GetParent()->IsMulti() && m_pin->GetUnit() == 0 );
270 m_checkApplyToAllConversions->SetValue( m_pin->GetConvert() == 0 );
271 m_checkShow->SetValue( m_pin->IsVisible() );
272
274
275 wxString commonUnitsToolTip;
276
278 {
279 wxHyperlinkCtrl* button = new wxHyperlinkCtrl( m_infoBar, wxID_ANY,
280 _( "Exit sync pins mode" ),
281 wxEmptyString );
282
283 button->Bind( wxEVT_COMMAND_HYPERLINK,
284 std::function<void( wxHyperlinkEvent& aEvent )>(
285 [&]( wxHyperlinkEvent& aEvent )
286 {
287 m_frame->m_SyncPinEdit = false;
289 } ) );
290
292 m_infoBar->AddButton( button );
294
295 commonUnitsToolTip = _( "Synchronized pins mode is enabled.\n"
296 "Similar pins will be edited regardless of this option." );
297 }
298 else
299 {
300 commonUnitsToolTip = _( "If checked, this pin will exist in all units." );
301 }
302
303 if( !m_pin->GetParent()->IsMulti() )
304 commonUnitsToolTip = _( "This symbol only has one unit. This control has no effect." );
305
306 m_checkApplyToAllParts->SetToolTip( commonUnitsToolTip );
307
308 for( const std::pair<const wxString, LIB_PIN::ALT>& alt : m_pin->GetAlternates() )
309 m_alternatesDataModel->AppendRow( alt.second );
310
311 return true;
312}
313
314
316{
318 return false;
319
320 // Check for missing alternate names.
321 for( size_t i = 0; i < m_alternatesDataModel->size(); ++i )
322 {
323 if( m_alternatesDataModel->at( i ).m_Name.IsEmpty() )
324 {
325 DisplayErrorMessage( this, _( "Alternate pin definitions must have a name." ) );
326
329
330 return false;
331 }
332 }
333
334 if( !DIALOG_SHIM::TransferDataFromWindow() )
335 return false;
336
337 VECTOR2I newPos( m_posX.GetValue(), -m_posY.GetValue() );
338
339 const int standard_grid = 50;
340
341 // Only show the warning if the position has been changed
342 if( ( m_origPos != newPos )
343 && (( m_posX.GetValue() % standard_grid ) || ( m_posY.GetValue() % standard_grid ) ) )
344 {
345 wxString msg = wxString::Format( _( "This pin is not on a %d mils grid which will make it "
346 "difficult to connect to in the schematic.\n"
347 "Do you wish to continue?" ),
348 standard_grid );
349 if( !IsOK( this, msg ) )
350 return false;
351 }
352
353 m_pin->SetName( m_textPinName->GetValue() );
354 m_pin->SetNumber( m_textPinNumber->GetValue() );
358 m_pin->SetPosition( newPos );
363 m_pin->SetUnit( m_checkApplyToAllParts->GetValue() ? 0 : m_frame->GetUnit() );
364 m_pin->SetVisible( m_checkShow->GetValue() );
365
366 std::map<wxString, LIB_PIN::ALT>& alternates = m_pin->GetAlternates();
367 alternates.clear();
368
369 for( const LIB_PIN::ALT& alt : *m_alternatesDataModel )
370 alternates[ alt.m_Name ] = alt;
371
372 return true;
373}
374
375
376/*
377 * Draw (on m_panelShowPin) the pin according to current settings in dialog
378 */
380{
381 wxPaintDC dc( m_panelShowPin );
382 wxSize dc_size = dc.GetSize();
383 dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
384
385 // Give a parent to m_dummyPin for draw purposes.
386 // In fact m_dummyPin should not have a parent, but draw functions need a parent
387 // to know some options, about pin texts
388 SYMBOL_EDIT_FRAME* symbolEditor = (SYMBOL_EDIT_FRAME*) GetParent();
389
390 // Calculate a suitable scale to fit the available draw area
391 BOX2I bBox = m_dummyPin->GetBoundingBox( true, true, false );
392 double xscale = (double) dc_size.x / bBox.GetWidth();
393 double yscale = (double) dc_size.y / bBox.GetHeight();
394 double scale = std::min( xscale, yscale );
395
396 // Give a 7% margin (each side) and limit to no more than 100% zoom
397 scale = std::min( scale * 0.85, 1.0 );
398 dc.SetUserScale( scale, scale );
399 GRResetPenAndBrush( &dc );
400
402 opts.force_draw_pin_text = true;
403 opts.draw_hidden_fields = true;
404 opts.show_connect_point = true;
405
406 RENDER_SETTINGS* renderSettings = symbolEditor->GetRenderSettings();
407 renderSettings->SetPrintDC( &dc );
408
409 m_dummyPin->Print( renderSettings, -bBox.Centre(), (void*) &opts, DefaultTransform, false );
410
411 event.Skip();
412}
413
414
415void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
416{
417 if( !IsShownOnScreen() ) // do nothing at init time
418 return;
419
420 m_dummyPin->SetName( m_textPinName->GetValue() );
421 m_dummyPin->SetNumber( m_textPinNumber->GetValue() );
428 m_dummyPin->SetVisible( m_checkShow->GetValue() );
429
430 if( event.GetEventObject() == m_checkApplyToAllParts && m_frame->m_SyncPinEdit )
432
433 m_panelShowPin->Refresh();
434}
435
437{
438 if( m_checkApplyToAllParts->GetValue() )
439 return _( "Synchronized Pins Mode." );
440 else if( m_pin->IsNew() )
441 return _( "Synchronized Pins Mode. New pin will be added to all units." );
442 else
443 return _( "Synchronized Pins Mode. Matching pins in other units will be updated." );
444}
445
446
447void DIALOG_PIN_PROPERTIES::OnAddAlternate( wxCommandEvent& event )
448{
450 return;
451
452 LIB_PIN::ALT newAlt;
453 newAlt.m_Name = wxEmptyString;
454 newAlt.m_Type = m_pin->GetType();
455 newAlt.m_Shape = m_pin->GetShape();
456
458
459 m_alternatesGrid->MakeCellVisible( m_alternatesGrid->GetNumberRows() - 1, 0 );
460 m_alternatesGrid->SetGridCursor( m_alternatesGrid->GetNumberRows() - 1, 0 );
461
462 m_alternatesGrid->EnableCellEditControl( true );
463 m_alternatesGrid->ShowCellEditControl();
464}
465
466
467void DIALOG_PIN_PROPERTIES::OnDeleteAlternate( wxCommandEvent& event )
468{
470 return;
471
472 if( m_alternatesDataModel->size() == 0 ) // empty table
473 return;
474
475 int curRow = m_alternatesGrid->GetGridCursorRow();
476
477 if( curRow < 0 )
478 return;
479
481
482 curRow = std::max( 0, curRow - 1 );
483 m_alternatesGrid->MakeCellVisible( curRow, m_alternatesGrid->GetGridCursorCol() );
484 m_alternatesGrid->SetGridCursor( curRow, m_alternatesGrid->GetGridCursorCol() );
485}
486
487
489{
490 // Account for scroll bars
492
493 wxGridUpdateLocker deferRepaintsTillLeavingScope;
494
497
500}
501
502
503void DIALOG_PIN_PROPERTIES::OnSize( wxSizeEvent& event )
504{
505 auto new_size = event.GetSize();
506
507 if( m_initialized && m_size != new_size )
508 {
509 m_size = new_size;
510
512 }
513
514 // Always propagate for a grid repaint (needed if the height changes, as well as width)
515 event.Skip();
516}
517
518
519void DIALOG_PIN_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
520{
521 // Handle a delayed focus
522 if( m_delayedFocusRow >= 0 )
523 {
524 m_alternatesTurndown->Collapse( false );
525
526 m_alternatesGrid->SetFocus();
529
530 m_alternatesGrid->EnableCellEditControl( true );
531 m_alternatesGrid->ShowCellEditControl();
532
535 }
536}
537void DIALOG_PIN_PROPERTIES::OnCollapsiblePaneChange( wxCollapsiblePaneEvent& event )
538{
539 if( !event.GetCollapsed() )
540 {
541 wxTopLevelWindow* tlw = dynamic_cast<wxTopLevelWindow*>( wxGetTopLevelParent( this ) );
542
543 if( tlw )
544 {
545 tlw->InvalidateBestSize();
546 wxSize bestSize = tlw->GetBestSize();
547 wxSize currentSize = tlw->GetSize();
548 tlw->SetSize( wxMax( bestSize.GetWidth(), currentSize.GetWidth() ),
549 wxMax( bestSize.GetHeight(), currentSize.GetHeight() ) );
550 }
551 }
552}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
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 LIB_PIN::ALT &aAlt)
bool IsEmptyCell(int row, int col) override
coord_type GetHeight() const
Definition: box2.h:189
coord_type GetWidth() const
Definition: box2.h:188
Vec Centre() const
Definition: box2.h:71
Class DIALOG_PIN_PROPERTIES_BASE.
SYMBOL_EDIT_FRAME * m_frame
void OnUpdateUI(wxUpdateUIEvent &event) override
DIALOG_PIN_PROPERTIES(SYMBOL_EDIT_FRAME *parent, LIB_PIN *aPin)
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
bool TransferDataFromWindow() override
void OnDeleteAlternate(wxCommandEvent &event) override
int m_originalColWidths[COL_COUNT]
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={})
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:122
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:100
bool IsNew() const
Definition: eda_item.h:103
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
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void SetPrintDC(wxDC *aDC)
int GetUnit() const
Definition: lib_item.h:336
virtual void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, void *aData, const TRANSFORM &aTransform, bool aDimmed)
Draw an item.
Definition: lib_item.cpp:156
int GetConvert() const
Definition: lib_item.h:339
LIB_SYMBOL * GetParent() const
Definition: lib_item.h:202
void SetConvert(int aConvert)
Definition: lib_item.h:338
void SetUnit(int aUnit)
Definition: lib_item.h:335
void SetShape(GRAPHIC_PINSHAPE aShape)
Definition: lib_pin.h:72
int GetLength() const
Definition: lib_pin.h:74
ELECTRICAL_PINTYPE GetType() const
Definition: lib_pin.h:84
void SetPosition(const VECTOR2I &aPos) override
Definition: lib_pin.h:233
const BOX2I GetBoundingBox() const override
Definition: lib_pin.h:193
void SetName(const wxString &aName)
Definition: lib_pin.h:108
void SetNameTextSize(int aSize)
Definition: lib_pin.h:129
void SetType(ELECTRICAL_PINTYPE aType)
Definition: lib_pin.h:85
PIN_ORIENTATION GetOrientation() const
Definition: lib_pin.h:68
int GetNumberTextSize() const
Definition: lib_pin.h:135
void SetVisible(bool aVisible)
Definition: lib_pin.h:98
void ChangeLength(int aLength)
Change the length of a pin and adjust its position based on orientation.
Definition: lib_pin.cpp:1076
VECTOR2I GetPosition() const override
Definition: lib_pin.h:232
std::map< wxString, ALT > & GetAlternates()
Definition: lib_pin.h:142
const wxString & GetNumber() const
Definition: lib_pin.h:117
void SetOrientation(PIN_ORIENTATION aOrientation)
Definition: lib_pin.h:69
GRAPHIC_PINSHAPE GetShape() const
Definition: lib_pin.h:71
bool IsVisible() const
Definition: lib_pin.h:97
void SetNumber(const wxString &aNumber)
Definition: lib_pin.h:119
const wxString & GetName() const
Definition: lib_pin.h:106
void SetLength(int aLength)
Definition: lib_pin.h:75
int GetNameTextSize() const
Definition: lib_pin.h:128
void SetNumberTextSize(int aSize)
Definition: lib_pin.h:136
Define a library symbol object.
Definition: lib_symbol.h:99
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: lib_symbol.h:632
bool IsMulti() const
Definition: lib_symbol.h:599
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: lib_symbol.h:640
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
GRAPHIC_PINSHAPE GetPinShapeSelection()
void SetSelection(GRAPHIC_PINSHAPE aShape)
void SetSelection(ELECTRICAL_PINTYPE aType)
ELECTRICAL_PINTYPE GetPinTypeSelection()
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void SetBitmap(const wxBitmapBundle &aBmp)
The symbol library editor main window.
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
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:156
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:254
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:448
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:360
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:305
This file is part of the common library.
#define _(s)
EDA_UNITS
Definition: eda_units.h:46
TRANSFORM DefaultTransform
Definition: transform.cpp:32
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:73
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:382
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:120
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:113
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:56
const int scale
GRAPHIC_PINSHAPE m_Shape
Definition: lib_pin.h:47
ELECTRICAL_PINTYPE m_Type
Definition: lib_pin.h:48
wxString m_Name
Definition: lib_pin.h:46
bool force_draw_pin_text
Definition: lib_symbol.h:65
Functions for manipulating tab traversal in forms and dialogs.