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 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 <bitmaps.h>
22#include <widgets/wx_infobar.h>
23#include <sch_painter.h>
24#include <symbol_edit_frame.h>
25#include <sch_pin.h>
27#include <confirm.h>
28#include <kiplatform/ui.h>
29#include <widgets/wx_grid.h>
30#include <grid_tricks.h>
33#include <wx/hyperlink.h>
35#include <tools/sch_actions.h>
36
38
39class ALT_PIN_DATA_MODEL : public WX_GRID_TABLE_BASE, 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_alternatesTurndown( nullptr ),
131 m_alternatesGrid( nullptr ),
132 m_addAlternate( nullptr ),
133 m_deleteAlternate( nullptr ),
139 m_delayedFocusRow( -1 ),
141 m_initialized( false )
142{
143 // Create a dummy symbol with a single pin for the preview widget:
144 m_dummyParent = new LIB_SYMBOL( *static_cast<LIB_SYMBOL*>( m_pin->GetParentSymbol() ) );
145
146 // Move everything in the copied symbol to unit 1; we'll use unit 2 for the dummy pin:
147 m_dummyParent->SetUnitCount( 2, false );
148 m_dummyParent->RunOnChildren( [&]( SCH_ITEM* child )
149 {
150 child->SetUnit( 1 );
151 },
153
154 m_dummyPin = new SCH_PIN( *m_pin );
155 m_dummyPin->ClearFlags( IS_NEW ); // Needed to display the dummy pin
156 m_dummyPin->SetUnit( 2 );
157 m_dummyParent->AddDrawItem( m_dummyPin, false );
158
159 m_dummyParent->SetShowPinNames( true );
160 m_dummyParent->SetShowPinNumbers( true );
161
163 m_frame->GetCanvas()->GetBackend() );
164
165 m_previewWidget->SetLayoutDirection( wxLayout_LeftToRight );
166 m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), m_dummyPin->GetBodyStyle() );
167
168 wxBoxSizer* previewSizer = new wxBoxSizer( wxHORIZONTAL );
169 previewSizer->Add( m_previewWidget, 1, wxEXPAND, 5 );
170 m_panelShowPin->SetSizer( previewSizer );
171
172 m_previewWidget->GetRenderSettings()->m_ShowHiddenPins = true;
173
174 if( aPin->GetParentSymbol()->IsMultiBodyStyle() )
175 {
176 // Multiple body styles are a superclass of alternate pin assignments, so don't allow free-form
177 // alternate assignments as well. (We won't know how to map the alternates back and forth when
178 // the body style is changed.)
179 wxString hintText = wxString::Format( wxT( " (%s)" ), NO_PIN_FUNCTIONS_WITH_MULTIPLE_BODY_STYLES );
180 wxStaticText* hint = new wxStaticText( this, wxID_ANY, hintText );
181 hint->SetFont( KIUI::GetControlFont( this ).Italic() );
182 m_lowerSizer->Add( hint, 0, wxALL, 8 );
183 }
184 else
185 {
186 m_alternatesTurndown = new WX_COLLAPSIBLE_PANE( this, wxID_ANY, _( "Alternate Pin Function Definitions" ) );
187
188 wxWindow* alternatesWindow = m_alternatesTurndown->GetPane();
189
190 wxBoxSizer* bAlternatesSizer;
191 bAlternatesSizer = new wxBoxSizer( wxVERTICAL );
192
193 m_alternatesGrid = new WX_GRID( alternatesWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
194 m_alternatesGrid->CreateGrid( 1, 3 );
195 m_alternatesGrid->SetColSize( 0, 260 );
196 m_alternatesGrid->SetColSize( 1, 140 );
197 m_alternatesGrid->SetColSize( 2, 140 );
198 m_alternatesGrid->SetColLabelValue( 0, _( "Alternate Pin Name" ) );
199 m_alternatesGrid->SetColLabelValue( 1, _( "Electrical Type " ) );
200 m_alternatesGrid->SetColLabelValue( 2, _( "Graphic Style " ) );
201 m_alternatesGrid->SetColLabelSize( 22 );
202 m_alternatesGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
203 m_alternatesGrid->SetRowLabelSize( 0 );
204 m_alternatesGrid->EnableDragColSize( false );
205 m_alternatesGrid->EnableDragRowSize( false );
206 m_alternatesGrid->SetMinSize( wxSize( -1, 100 ) );
207 bAlternatesSizer->Add( m_alternatesGrid, 1, wxEXPAND|wxRIGHT, 5 );
208
209 wxBoxSizer* bButtonSizer;
210 bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
211
212 m_addAlternate = new STD_BITMAP_BUTTON( alternatesWindow, wxID_ANY, wxNullBitmap );
213 bButtonSizer->Add( m_addAlternate, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
214 bButtonSizer->AddSpacer( 20 );
215 m_deleteAlternate = new STD_BITMAP_BUTTON( alternatesWindow, wxID_ANY, wxNullBitmap );
216 bButtonSizer->Add( m_deleteAlternate, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
217
218 m_addAlternate->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onAddAlternate, this );
219 m_deleteAlternate->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onDeleteAlternate, this );
220
221 bAlternatesSizer->Add( bButtonSizer, 0, wxTOP | wxBOTTOM, 3 );
222
223 alternatesWindow->SetSizer( bAlternatesSizer );
224 alternatesWindow->Layout();
225 bAlternatesSizer->Fit( alternatesWindow );
226
227 m_lowerSizer->Add( m_alternatesTurndown, 1, wxEXPAND | wxLEFT | wxRIGHT, 10 );
228
230 [this]( wxCommandEvent& aEvent )
231 {
232 Freeze();
233 m_alternatesTurndown->GetPane()->Fit();
234 m_lowerSizer->Layout();
235
236 if( !m_alternatesTurndown->IsCollapsed() )
237 {
238 InvalidateBestSize();
239 wxSize bestSize = GetBestSize();
240 wxSize currentSize = GetSize();
241 SetSize( wxMax( bestSize.GetWidth(), currentSize.GetWidth() ),
242 wxMax( bestSize.GetHeight(), currentSize.GetHeight() ) );
243 }
244
246
247 Thaw();
248 } );
249
250 // Default alternates turndown to whether or not alternates exist, or if we've had it open before
251 m_alternatesTurndown->Collapse( m_pin->GetAlternates().size() == 0 && !s_alternatesTurndownOpen );
252
253 // wxwidgets doesn't call the OnCollapseChange even at init, so we update this value if
254 // the alternates pane defaults to open
255 if ( m_pin->GetAlternates().size() > 0 )
257
259
260 // Save original columns widths so we can do proportional sizing.
261 for( int i = 0; i < COL_COUNT; ++i )
262 m_originalColWidths[ i ] = m_alternatesGrid->GetColSize( i );
263
265 m_alternatesGrid->PushEventHandler( new GRID_TRICKS( m_alternatesGrid,
266 [this]( wxCommandEvent& aEvent )
267 {
268 onAddAlternate( aEvent );
269 } ) );
270 m_alternatesGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
271
272 // Set special attributes
273 wxGridCellAttr* attr;
274
275 attr = new wxGridCellAttr;
276 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(), PinTypeNames() ) );
277 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinTypeIcons(), PinTypeNames() ) );
278 m_alternatesGrid->SetColAttr( COL_TYPE, attr );
279
280 attr = new wxGridCellAttr;
281 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(), PinShapeNames() ) );
282 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinShapeIcons(), PinShapeNames() ) );
283 m_alternatesGrid->SetColAttr( COL_SHAPE, attr );
284
287 m_addAlternate->GetParent()->Layout();
288 }
289
290 const wxArrayString& orientationNames = PinOrientationNames();
291 const std::vector<BITMAPS>& orientationIcons = PinOrientationIcons();
292
293 for ( unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
294 m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ), ii );
295
296 // We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
297 // implementation on MSW
298 m_tabOrder = {
314 };
315
317
318 SetInitialFocus( aFocusPinNumber ? m_textPinNumber : m_textPinName );
319
320 // We should call FinishDialogSettings() when all widgets have the size fixed.
321 // However m_infoBar is not yet initialized, so it will called later
322 // See TransferDataToWindow()
323
324 // On some window managers (Unity, XFCE) the dialog is not always raised, depending on
325 // how it is run.
326 Raise();
327
328 m_initialized = true;
329}
330
331
333{
334 if( m_addAlternate )
335 m_addAlternate->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onAddAlternate, this );
336
338 m_deleteAlternate->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onDeleteAlternate, this );
339
340 delete m_dummyParent;
341
342 if( m_alternatesGrid )
343 {
344 // Prevents crash bug in wxGrid's d'tor
346
347 // Delete the GRID_TRICKS.
348 m_alternatesGrid->PopEventHandler( true );
349 }
350}
351
352
354{
355 if( !DIALOG_SHIM::TransferDataToWindow() )
356 return false;
357
358 m_origPos = m_pin->GetPosition();
359
360 m_choiceOrientation->SetSelection( PinOrientationIndex( m_pin->GetOrientation() ) );
361 m_choiceStyle->SetSelection( m_pin->GetShape() );
362 m_choiceElectricalType->SetSelection( m_pin->GetType() );
363 m_textPinName->SetValue( m_pin->GetName() );
364 m_nameSize.SetValue( m_pin->GetNameTextSize() );
365 m_posX.SetValue( m_origPos.x );
366 m_posY.SetValue( m_origPos.y );
367 m_textPinNumber->SetValue( m_pin->GetNumber() );
368 m_numberSize.SetValue( m_pin->GetNumberTextSize() );
369 m_pinLength.SetValue( m_pin->GetLength() );
370 m_checkApplyToAllParts->Enable( m_pin->GetParentSymbol()->IsMultiUnit() );
371 m_checkApplyToAllParts->SetValue( m_pin->GetParentSymbol()->IsMultiUnit() && m_pin->GetUnit() == ALL_UNITS );
372 m_checkApplyToAllBodyStyles->Enable( m_pin->GetParentSymbol()->IsMultiBodyStyle() );
373 m_checkApplyToAllBodyStyles->SetValue( m_pin->GetBodyStyle() == ALL_BODY_STYLES );
374 m_checkShow->SetValue( m_pin->IsVisible() );
375
376 m_dummyPin->SetVisible( m_pin->IsVisible() );
377
378 wxString commonUnitsToolTip;
379
380 if( m_frame->SynchronizePins() )
381 {
382 m_infoBar->RemoveAllButtons();
383 m_infoBar->AddLink( _( "Exit sync pins mode" ),
384 [&]( wxHyperlinkEvent& aEvent )
385 {
386 if( SYMBOL_EDITOR_SETTINGS* cfg = m_frame->GetSettings() )
387 cfg->m_SyncPinEdit = !cfg->m_SyncPinEdit;
388
389 m_infoBar->Dismiss();
390 } );
391
392 m_infoBar->ShowMessage( getSyncPinsMessage() );
393
394 commonUnitsToolTip = _( "Synchronized pins mode is enabled.\n"
395 "Similar pins will be edited regardless of this option." );
396 }
397 else
398 {
399 commonUnitsToolTip = _( "If checked, this pin will exist in all units." );
400 }
401
402 if( !m_pin->GetParentSymbol()->IsMultiUnit() )
403 commonUnitsToolTip = _( "This symbol only has one unit. This control has no effect." );
404
405 m_checkApplyToAllParts->SetToolTip( commonUnitsToolTip );
406
407 if( !m_pin->GetParentSymbol()->IsMultiBodyStyle() )
408 {
409 for( const std::pair<const wxString, SCH_PIN::ALT>& alt : m_pin->GetAlternates() )
410 m_alternatesDataModel->AppendRow( alt.second );
411 }
412
413 // We can call FinishDialogSettings() now all widgets have the size fixed.
415
416 return true;
417}
418
419
421{
423 {
424 if( !m_alternatesGrid->CommitPendingChanges() )
425 return false;
426
427 // Check for missing alternate names.
428 for( size_t i = 0; i < m_alternatesDataModel->size(); ++i )
429 {
430 if( m_alternatesDataModel->at( i ).m_Name.IsEmpty() )
431 {
432 DisplayErrorMessage( this, _( "Alternate pin definitions must have a name." ) );
433
436
437 return false;
438 }
439 }
440 }
441
442 if( !DIALOG_SHIM::TransferDataFromWindow() )
443 return false;
444
445 VECTOR2I newPos( m_posX.GetIntValue(), m_posY.GetIntValue() );
446
447 const int standard_grid = 50;
448
449 // Only show the warning if the position has been changed
450 if( ( m_origPos != newPos )
451 && ( ( m_posX.GetValue() % standard_grid ) || ( m_posY.GetValue() % standard_grid ) ) )
452 {
453 wxString msg = wxString::Format( _( "This pin is not on a %d mils grid which will make it "
454 "difficult to connect to in the schematic.\n"
455 "Do you wish to continue?" ),
456 standard_grid );
457 if( !IsOK( this, msg ) )
458 return false;
459 }
460
461 m_pin->SetName( m_textPinName->GetValue() );
462 m_pin->SetNumber( m_textPinNumber->GetValue() );
463 m_pin->SetNameTextSize( m_nameSize.GetIntValue() );
464 m_pin->SetNumberTextSize( m_numberSize.GetIntValue() );
465 m_pin->SetOrientation( PinOrientationCode( m_choiceOrientation->GetSelection() ) );
466 m_pin->SetPosition( newPos );
467 m_pin->ChangeLength( m_pinLength.GetIntValue() );
468 m_pin->SetType( m_choiceElectricalType->GetPinTypeSelection() );
469 m_pin->SetShape( m_choiceStyle->GetPinShapeSelection() );
470 m_pin->SetBodyStyle( m_checkApplyToAllBodyStyles->GetValue() ? 0 : m_frame->GetBodyStyle() );
471 m_pin->SetUnit( m_checkApplyToAllParts->GetValue() ? 0 : m_frame->GetUnit() );
472 m_pin->SetVisible( m_checkShow->GetValue() );
473
475 {
476 std::map<wxString, SCH_PIN::ALT>& alternates = m_pin->GetAlternates();
477 alternates.clear();
478
479 for( const SCH_PIN::ALT& alt : *m_alternatesDataModel )
480 alternates[ alt.m_Name ] = alt;
481 }
482
483 return true;
484}
485
486
487void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
488{
489 if( !IsShownOnScreen() ) // do nothing at init time
490 return;
491
492 m_dummyPin->SetName( m_textPinName->GetValue() );
493 m_dummyPin->SetNumber( m_textPinNumber->GetValue() );
494 m_dummyPin->SetNameTextSize( m_nameSize.GetIntValue() );
495 m_dummyPin->SetNumberTextSize( m_numberSize.GetIntValue() );
496 m_dummyPin->SetOrientation( PinOrientationCode( m_choiceOrientation->GetSelection() ) );
497 m_dummyPin->SetLength( m_pinLength.GetIntValue() );
498 m_dummyPin->SetType( m_choiceElectricalType->GetPinTypeSelection() );
499 m_dummyPin->SetShape( m_choiceStyle->GetPinShapeSelection() );
500 m_dummyPin->SetVisible( m_checkShow->GetValue() );
501
502 if( event.GetEventObject() == m_checkApplyToAllParts && m_frame->SynchronizePins() )
503 {
504 m_infoBar->ShowMessage( getSyncPinsMessage() );
505 m_infoBar->GetSizer()->Layout();
506 }
507
508 m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), m_dummyPin->GetBodyStyle() );
509}
510
511
513{
514 if( m_checkApplyToAllParts->GetValue() )
515 return _( "Synchronized Pins Mode." );
516 else if( m_pin->IsNew() )
517 return _( "Synchronized Pins Mode. New pin will be added to all units." );
518 else
519 return _( "Synchronized Pins Mode. Matching pins in other units will be updated." );
520}
521
522
523void DIALOG_PIN_PROPERTIES::onAddAlternate( wxCommandEvent& event )
524{
525 if( !m_alternatesGrid->CommitPendingChanges() )
526 return;
527
528 m_alternatesGrid->OnAddRow(
529 [&]() -> std::pair<int, int>
530 {
531 SCH_PIN::ALT newAlt;
532 newAlt.m_Name = wxEmptyString;
533 newAlt.m_Type = m_pin->GetType();
534 newAlt.m_Shape = m_pin->GetShape();
535
536 m_alternatesDataModel->AppendRow( newAlt );
537 return { m_alternatesGrid->GetNumberRows() - 1, COL_NAME };
538 } );
539}
540
541
542void DIALOG_PIN_PROPERTIES::onDeleteAlternate( wxCommandEvent& event )
543{
544 m_alternatesGrid->OnDeleteRows(
545 [&]( int row )
546 {
547 m_alternatesDataModel->RemoveRow( row );
548 } );
549}
550
551
553{
554 if( m_alternatesGrid )
555 {
556 // Account for scroll bars
558
559 wxGridUpdateLocker deferRepaintsTillLeavingScope;
560
563
565 }
566}
567
568
569void DIALOG_PIN_PROPERTIES::OnSize( wxSizeEvent& event )
570{
571 wxSize new_size = event.GetSize();
572
573 if( m_initialized && m_size != new_size )
574 {
575 m_size = new_size;
576
578 }
579
580 // Always propagate for a grid repaint (needed if the height changes, as well as width)
581 event.Skip();
582}
583
584
585void DIALOG_PIN_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
586{
587 // Handle a delayed focus
589 {
590 m_alternatesTurndown->Collapse( false );
591
592 m_alternatesGrid->SetFocus();
595
596 m_alternatesGrid->EnableCellEditControl( true );
597 m_alternatesGrid->ShowCellEditControl();
598
601 }
602}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
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
DIALOG_PIN_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Pin Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
SYMBOL_EDIT_FRAME * m_frame
void OnUpdateUI(wxUpdateUIEvent &event) override
std::map< int, int > m_originalColWidths
void onDeleteAlternate(wxCommandEvent &event)
void OnPropertiesChange(wxCommandEvent &event) override
STD_BITMAP_BUTTON * m_deleteAlternate
SYMBOL_PREVIEW_WIDGET * m_previewWidget
ALT_PIN_DATA_MODEL * m_alternatesDataModel
WX_COLLAPSIBLE_PANE * m_alternatesTurndown
void OnSize(wxSizeEvent &event) override
void onAddAlternate(wxCommandEvent &event)
DIALOG_PIN_PROPERTIES(SYMBOL_EDIT_FRAME *parent, SCH_PIN *aPin, bool aFocusPinNumber)
STD_BITMAP_BUTTON * m_addAlternate
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:94
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
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition grid_tricks.h:57
Define a library symbol object.
Definition lib_symbol.h:114
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
const SYMBOL * GetParentSymbol() const
Definition sch_item.cpp:350
virtual void SetUnit(int aUnit)
Definition sch_item.h:242
PIN_ALTERNATE ALT
Definition sch_pin.h:63
A bitmap button widget that behaves like a standard dialog button except with an icon.
The symbol library editor main window.
virtual bool IsMultiBodyStyle() const =0
A better wxCollapsiblePane that.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:274
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
#define _(s)
@ NO_RECURSE
Definition eda_item.h:52
#define IS_NEW
New item, just created.
EDA_UNITS
Definition eda_units.h:44
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition wxgtk/ui.cpp:446
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
const std::vector< BITMAPS > & PinTypeIcons()
Definition pin_type.cpp:159
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition pin_type.h:32
const wxArrayString & PinTypeNames()
Definition pin_type.cpp:150
int PinOrientationIndex(PIN_ORIENTATION code)
Definition pin_type.cpp:67
const wxArrayString & PinShapeNames()
Definition pin_type.cpp:168
const std::vector< BITMAPS > & PinShapeIcons()
Definition pin_type.cpp:177
const wxArrayString & PinOrientationNames()
Definition pin_type.cpp:186
PIN_ORIENTATION PinOrientationCode(size_t index)
Definition pin_type.cpp:60
const std::vector< BITMAPS > & PinOrientationIcons()
Definition pin_type.cpp:195
GRAPHIC_PINSHAPE
Definition pin_type.h:80
#define NO_PIN_FUNCTIONS_WITH_MULTIPLE_BODY_STYLES
Definition sch_actions.h:34
GRAPHIC_PINSHAPE m_Shape
ELECTRICAL_PINTYPE m_Type
#define ALL_UNITS
Definition symbol.h:150
#define ALL_BODY_STYLES
Definition symbol.h:151
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
const KICOMMON_API wxEventTypeTag< wxCommandEvent > WX_COLLAPSIBLE_PANE_CHANGED