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>
30#include <widgets/wx_grid.h>
31#include <grid_tricks.h>
34#include <wx/hyperlink.h>
36#include <tools/sch_actions.h>
37
39
40class ALT_PIN_DATA_MODEL : public WX_GRID_TABLE_BASE, public std::vector<SCH_PIN::ALT>
41{
42public:
44 {
45 }
46
47 int GetNumberRows() override { return (int) size(); }
48 int GetNumberCols() override { return COL_COUNT; }
49
50 wxString GetColLabelValue( int aCol ) override
51 {
52 switch( aCol )
53 {
54 case COL_NAME: return _( "Alternate Pin Name" );
55 case COL_TYPE: return _( "Electrical Type" );
56 case COL_SHAPE: return _( "Graphic Style" );
57 default: wxFAIL; return wxEmptyString;
58 }
59 }
60
61 bool IsEmptyCell( int row, int col ) override
62 {
63 return false; // don't allow adjacent cell overflow, even if we are actually empty
64 }
65
66 wxString GetValue( int aRow, int aCol ) override
67 {
68 switch( aCol )
69 {
70 case COL_NAME: return at( aRow ).m_Name;
71 case COL_TYPE: return PinTypeNames()[static_cast<int>( at( aRow ).m_Type )];
72 case COL_SHAPE: return PinShapeNames()[static_cast<int>( at( aRow ).m_Shape )];
73 default: wxFAIL; return wxEmptyString;
74 }
75 }
76
77 void SetValue( int aRow, int aCol, const wxString &aValue ) override
78 {
79 switch( aCol )
80 {
81 case COL_NAME:
82 at( aRow ).m_Name = aValue;
83 break;
84
85 case COL_TYPE:
86 if( PinTypeNames().Index( aValue ) != wxNOT_FOUND )
87 at( aRow ).m_Type = (ELECTRICAL_PINTYPE) PinTypeNames().Index( aValue );
88
89 break;
90
91 case COL_SHAPE:
92 if( PinShapeNames().Index( aValue ) != wxNOT_FOUND )
93 at( aRow ).m_Shape = (GRAPHIC_PINSHAPE) PinShapeNames().Index( aValue );
94
95 break;
96
97 default:
98 wxFAIL;
99 break;
100 }
101 }
102
103 void AppendRow( const SCH_PIN::ALT& aAlt )
104 {
105 push_back( aAlt );
106
107 if ( GetView() )
108 {
109 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
110 GetView()->ProcessTableMessage( msg );
111 }
112 }
113
114 void RemoveRow( int aRow )
115 {
116 erase( begin() + aRow );
117
118 if ( GetView() )
119 {
120 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow, 1 );
121 GetView()->ProcessTableMessage( msg );
122 }
123 }
124};
125
126
129 m_frame( parent ),
130 m_pin( aPin ),
131 m_alternatesTurndown( nullptr ),
132 m_alternatesGrid( nullptr ),
133 m_addAlternate( nullptr ),
134 m_deleteAlternate( nullptr ),
140 m_delayedFocusRow( -1 ),
142 m_initialized( false )
143{
144 // Create a dummy symbol with a single pin for the preview widget:
145 m_dummyParent = new LIB_SYMBOL( *static_cast<LIB_SYMBOL*>( m_pin->GetParentSymbol() ) );
146
147 // Move everything in the copied symbol to unit 1; we'll use unit 2 for the dummy pin:
148 m_dummyParent->SetUnitCount( 2, false );
149 m_dummyParent->RunOnChildren( [&]( SCH_ITEM* child )
150 {
151 child->SetUnit( 1 );
152 },
154
155 m_dummyPin = new SCH_PIN( *m_pin );
156 m_dummyPin->ClearFlags( IS_NEW ); // Needed to display the dummy pin
157 m_dummyPin->SetUnit( 2 );
158 m_dummyParent->AddDrawItem( m_dummyPin, false );
159
160 m_dummyParent->SetShowPinNames( true );
161 m_dummyParent->SetShowPinNumbers( true );
162
164 m_frame->GetCanvas()->GetBackend() );
165
166 m_previewWidget->SetLayoutDirection( wxLayout_LeftToRight );
167 m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), m_dummyPin->GetBodyStyle() );
168
169 wxBoxSizer* previewSizer = new wxBoxSizer( wxHORIZONTAL );
170 previewSizer->Add( m_previewWidget, 1, wxEXPAND, 5 );
171 m_panelShowPin->SetSizer( previewSizer );
172
173 m_previewWidget->GetRenderSettings()->m_ShowHiddenPins = true;
174
175 if( aPin->GetParentSymbol()->IsMultiBodyStyle() )
176 {
177 // Multiple body styles are a superclass of alternate pin assignments, so don't allow free-form
178 // alternate assignments as well. (We won't know how to map the alternates back and forth when
179 // the body style is changed.)
180 wxString hintText = wxString::Format( wxT( " (%s)" ), NO_PIN_FUNCTIONS_WITH_MULTIPLE_BODY_STYLES );
181 wxStaticText* hint = new wxStaticText( this, wxID_ANY, hintText );
182 hint->SetFont( KIUI::GetControlFont( this ).Italic() );
183 m_lowerSizer->Add( hint, 0, wxALL, 8 );
184 }
185 else
186 {
187 m_alternatesTurndown = new WX_COLLAPSIBLE_PANE( this, wxID_ANY, _( "Alternate Pin Function Definitions" ) );
188
189 wxWindow* alternatesWindow = m_alternatesTurndown->GetPane();
190
191 wxBoxSizer* bAlternatesSizer;
192 bAlternatesSizer = new wxBoxSizer( wxVERTICAL );
193
194 m_alternatesGrid = new WX_GRID( alternatesWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
195 m_alternatesGrid->CreateGrid( 1, 3 );
196 m_alternatesGrid->SetColSize( 0, 260 );
197 m_alternatesGrid->SetColSize( 1, 140 );
198 m_alternatesGrid->SetColSize( 2, 140 );
199 m_alternatesGrid->SetColLabelValue( 0, _( "Alternate Pin Name" ) );
200 m_alternatesGrid->SetColLabelValue( 1, _( "Electrical Type " ) );
201 m_alternatesGrid->SetColLabelValue( 2, _( "Graphic Style " ) );
202 m_alternatesGrid->SetColLabelSize( 22 );
203 m_alternatesGrid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
204 m_alternatesGrid->SetRowLabelSize( 0 );
205 m_alternatesGrid->EnableDragColSize( false );
206 m_alternatesGrid->EnableDragRowSize( false );
207 m_alternatesGrid->SetMinSize( wxSize( -1, 100 ) );
208 bAlternatesSizer->Add( m_alternatesGrid, 1, wxEXPAND|wxRIGHT, 5 );
209
210 wxBoxSizer* bButtonSizer;
211 bButtonSizer = new wxBoxSizer( wxHORIZONTAL );
212
213 m_addAlternate = new STD_BITMAP_BUTTON( alternatesWindow, wxID_ANY, wxNullBitmap );
214 bButtonSizer->Add( m_addAlternate, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
215 bButtonSizer->AddSpacer( 20 );
216 m_deleteAlternate = new STD_BITMAP_BUTTON( alternatesWindow, wxID_ANY, wxNullBitmap );
217 bButtonSizer->Add( m_deleteAlternate, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
218
219 m_addAlternate->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onAddAlternate, this );
220 m_deleteAlternate->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onDeleteAlternate, this );
221
222 bAlternatesSizer->Add( bButtonSizer, 0, wxTOP | wxBOTTOM, 3 );
223
224 alternatesWindow->SetSizer( bAlternatesSizer );
225 alternatesWindow->Layout();
226 bAlternatesSizer->Fit( alternatesWindow );
227
228 m_lowerSizer->Add( m_alternatesTurndown, 1, wxEXPAND | wxLEFT | wxRIGHT, 10 );
229
231 [this]( wxCommandEvent& aEvent )
232 {
233 Freeze();
234 m_alternatesTurndown->GetPane()->Fit();
235 m_lowerSizer->Layout();
236
237 if( !m_alternatesTurndown->IsCollapsed() )
238 {
239 InvalidateBestSize();
240 wxSize bestSize = GetBestSize();
241 wxSize currentSize = GetSize();
242 SetSize( wxMax( bestSize.GetWidth(), currentSize.GetWidth() ),
243 wxMax( bestSize.GetHeight(), currentSize.GetHeight() ) );
244 }
245
247
248 Thaw();
249 } );
250
251 // Default alternates turndown to whether or not alternates exist, or if we've had it open before
252 m_alternatesTurndown->Collapse( m_pin->GetAlternates().size() == 0 && !s_alternatesTurndownOpen );
253
254 // wxwidgets doesn't call the OnCollapseChange even at init, so we update this value if
255 // the alternates pane defaults to open
256 if ( m_pin->GetAlternates().size() > 0 )
258
260
261 // Save original columns widths so we can do proportional sizing.
262 for( int i = 0; i < COL_COUNT; ++i )
263 m_originalColWidths[ i ] = m_alternatesGrid->GetColSize( i );
264
266 m_alternatesGrid->PushEventHandler( new GRID_TRICKS( m_alternatesGrid,
267 [this]( wxCommandEvent& aEvent )
268 {
269 onAddAlternate( aEvent );
270 } ) );
271 m_alternatesGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
272
273 // Set special attributes
274 wxGridCellAttr* attr;
275
276 attr = new wxGridCellAttr;
277 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinTypeIcons(), PinTypeNames() ) );
278 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinTypeIcons(), PinTypeNames() ) );
279 m_alternatesGrid->SetColAttr( COL_TYPE, attr );
280
281 attr = new wxGridCellAttr;
282 attr->SetRenderer( new GRID_CELL_ICON_TEXT_RENDERER( PinShapeIcons(), PinShapeNames() ) );
283 attr->SetEditor( new GRID_CELL_ICON_TEXT_POPUP( PinShapeIcons(), PinShapeNames() ) );
284 m_alternatesGrid->SetColAttr( COL_SHAPE, attr );
285
288 m_addAlternate->GetParent()->Layout();
289 }
290
291 const wxArrayString& orientationNames = PinOrientationNames();
292 const std::vector<BITMAPS>& orientationIcons = PinOrientationIcons();
293
294 for ( unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
295 m_choiceOrientation->Insert( orientationNames[ii], KiBitmapBundle( orientationIcons[ii] ), ii );
296
297 // We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
298 // implementation on MSW
299 m_tabOrder = {
315 };
316
318
319 SetInitialFocus( aFocusPinNumber ? m_textPinNumber : m_textPinName );
320
321 // We should call FinishDialogSettings() when all widgets have the size fixed.
322 // However m_infoBar is not yet initialized, so it will called later
323 // See TransferDataToWindow()
324
325 // On some window managers (Unity, XFCE) the dialog is not always raised, depending on
326 // how it is run.
327 Raise();
328
329 m_initialized = true;
330}
331
332
334{
335 if( m_addAlternate )
336 m_addAlternate->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onAddAlternate, this );
337
339 m_deleteAlternate->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_PIN_PROPERTIES::onDeleteAlternate, this );
340
341 delete m_dummyParent;
342
343 if( m_alternatesGrid )
344 {
345 // Prevents crash bug in wxGrid's d'tor
347
348 // Delete the GRID_TRICKS.
349 m_alternatesGrid->PopEventHandler( true );
350 }
351}
352
353
355{
356 if( !DIALOG_SHIM::TransferDataToWindow() )
357 return false;
358
359 m_origPos = m_pin->GetPosition();
360
361 m_choiceOrientation->SetSelection( PinOrientationIndex( m_pin->GetOrientation() ) );
362 m_choiceStyle->SetSelection( m_pin->GetShape() );
363 m_choiceElectricalType->SetSelection( m_pin->GetType() );
364 m_textPinName->SetValue( m_pin->GetName() );
365 m_nameSize.SetValue( m_pin->GetNameTextSize() );
366 m_posX.SetValue( m_origPos.x );
367 m_posY.SetValue( m_origPos.y );
368 m_textPinNumber->SetValue( m_pin->GetNumber() );
369 m_numberSize.SetValue( m_pin->GetNumberTextSize() );
370 m_pinLength.SetValue( m_pin->GetLength() );
371 m_checkApplyToAllParts->Enable( m_pin->GetParentSymbol()->IsMultiUnit() );
372 m_checkApplyToAllParts->SetValue( m_pin->GetParentSymbol()->IsMultiUnit() && m_pin->GetUnit() == 0 );
373 m_checkApplyToAllBodyStyles->Enable( m_pin->GetParentSymbol()->IsMultiBodyStyle() );
374 m_checkApplyToAllBodyStyles->SetValue( m_pin->GetBodyStyle() == 0 );
375 m_checkShow->SetValue( m_pin->IsVisible() );
376
377 m_dummyPin->SetVisible( m_pin->IsVisible() );
378
379 wxString commonUnitsToolTip;
380
381 if( m_frame->SynchronizePins() )
382 {
383 m_infoBar->RemoveAllButtons();
384 m_infoBar->AddLink( _( "Exit sync pins mode" ),
385 [&]( wxHyperlinkEvent& aEvent )
386 {
387 if( SYMBOL_EDITOR_SETTINGS* cfg = m_frame->GetSettings() )
388 cfg->m_SyncPinEdit = !cfg->m_SyncPinEdit;
389
390 m_infoBar->Dismiss();
391 } );
392
393 m_infoBar->ShowMessage( getSyncPinsMessage() );
394
395 commonUnitsToolTip = _( "Synchronized pins mode is enabled.\n"
396 "Similar pins will be edited regardless of this option." );
397 }
398 else
399 {
400 commonUnitsToolTip = _( "If checked, this pin will exist in all units." );
401 }
402
403 if( !m_pin->GetParentSymbol()->IsMultiUnit() )
404 commonUnitsToolTip = _( "This symbol only has one unit. This control has no effect." );
405
406 m_checkApplyToAllParts->SetToolTip( commonUnitsToolTip );
407
408 for( const std::pair<const wxString, SCH_PIN::ALT>& alt : m_pin->GetAlternates() )
409 m_alternatesDataModel->AppendRow( alt.second );
410
411 // We can call FinishDialogSettings() now all widgets have the size fixed.
413
414 return true;
415}
416
417
419{
421 {
422 if( !m_alternatesGrid->CommitPendingChanges() )
423 return false;
424
425 // Check for missing alternate names.
426 for( size_t i = 0; i < m_alternatesDataModel->size(); ++i )
427 {
428 if( m_alternatesDataModel->at( i ).m_Name.IsEmpty() )
429 {
430 DisplayErrorMessage( this, _( "Alternate pin definitions must have a name." ) );
431
434
435 return false;
436 }
437 }
438 }
439
440 if( !DIALOG_SHIM::TransferDataFromWindow() )
441 return false;
442
443 VECTOR2I newPos( m_posX.GetIntValue(), m_posY.GetIntValue() );
444
445 const int standard_grid = 50;
446
447 // Only show the warning if the position has been changed
448 if( ( m_origPos != newPos )
449 && ( ( m_posX.GetValue() % standard_grid ) || ( m_posY.GetValue() % standard_grid ) ) )
450 {
451 wxString msg = wxString::Format( _( "This pin is not on a %d mils grid which will make it "
452 "difficult to connect to in the schematic.\n"
453 "Do you wish to continue?" ),
454 standard_grid );
455 if( !IsOK( this, msg ) )
456 return false;
457 }
458
459 m_pin->SetName( m_textPinName->GetValue() );
460 m_pin->SetNumber( m_textPinNumber->GetValue() );
461 m_pin->SetNameTextSize( m_nameSize.GetIntValue() );
462 m_pin->SetNumberTextSize( m_numberSize.GetIntValue() );
463 m_pin->SetOrientation( PinOrientationCode( m_choiceOrientation->GetSelection() ) );
464 m_pin->SetPosition( newPos );
465 m_pin->ChangeLength( m_pinLength.GetIntValue() );
466 m_pin->SetType( m_choiceElectricalType->GetPinTypeSelection() );
467 m_pin->SetShape( m_choiceStyle->GetPinShapeSelection() );
468 m_pin->SetBodyStyle( m_checkApplyToAllBodyStyles->GetValue() ? 0 : m_frame->GetBodyStyle() );
469 m_pin->SetUnit( m_checkApplyToAllParts->GetValue() ? 0 : m_frame->GetUnit() );
470 m_pin->SetVisible( m_checkShow->GetValue() );
471
473 {
474 std::map<wxString, SCH_PIN::ALT>& alternates = m_pin->GetAlternates();
475 alternates.clear();
476
477 for( const SCH_PIN::ALT& alt : *m_alternatesDataModel )
478 alternates[ alt.m_Name ] = alt;
479 }
480
481 return true;
482}
483
484
485void DIALOG_PIN_PROPERTIES::OnPropertiesChange( wxCommandEvent& event )
486{
487 if( !IsShownOnScreen() ) // do nothing at init time
488 return;
489
490 m_dummyPin->SetName( m_textPinName->GetValue() );
491 m_dummyPin->SetNumber( m_textPinNumber->GetValue() );
492 m_dummyPin->SetNameTextSize( m_nameSize.GetIntValue() );
493 m_dummyPin->SetNumberTextSize( m_numberSize.GetIntValue() );
494 m_dummyPin->SetOrientation( PinOrientationCode( m_choiceOrientation->GetSelection() ) );
495 m_dummyPin->SetLength( m_pinLength.GetIntValue() );
496 m_dummyPin->SetType( m_choiceElectricalType->GetPinTypeSelection() );
497 m_dummyPin->SetShape( m_choiceStyle->GetPinShapeSelection() );
498 m_dummyPin->SetVisible( m_checkShow->GetValue() );
499
500 if( event.GetEventObject() == m_checkApplyToAllParts && m_frame->SynchronizePins() )
501 {
502 m_infoBar->ShowMessage( getSyncPinsMessage() );
503 m_infoBar->GetSizer()->Layout();
504 }
505
506 m_previewWidget->DisplayPart( m_dummyParent, m_dummyPin->GetUnit(), m_dummyPin->GetBodyStyle() );
507}
508
509
511{
512 if( m_checkApplyToAllParts->GetValue() )
513 return _( "Synchronized Pins Mode." );
514 else if( m_pin->IsNew() )
515 return _( "Synchronized Pins Mode. New pin will be added to all units." );
516 else
517 return _( "Synchronized Pins Mode. Matching pins in other units will be updated." );
518}
519
520
521void DIALOG_PIN_PROPERTIES::onAddAlternate( wxCommandEvent& event )
522{
523 if( !m_alternatesGrid->CommitPendingChanges() )
524 return;
525
526 m_alternatesGrid->OnAddRow(
527 [&]() -> std::pair<int, int>
528 {
529 SCH_PIN::ALT newAlt;
530 newAlt.m_Name = wxEmptyString;
531 newAlt.m_Type = m_pin->GetType();
532 newAlt.m_Shape = m_pin->GetShape();
533
534 m_alternatesDataModel->AppendRow( newAlt );
535 return { m_alternatesGrid->GetNumberRows() - 1, COL_NAME };
536 } );
537}
538
539
540void DIALOG_PIN_PROPERTIES::onDeleteAlternate( wxCommandEvent& event )
541{
542 m_alternatesGrid->OnDeleteRows(
543 [&]( int row )
544 {
545 m_alternatesDataModel->RemoveRow( row );
546 } );
547}
548
549
551{
552 if( m_alternatesGrid )
553 {
554 // Account for scroll bars
556
557 wxGridUpdateLocker deferRepaintsTillLeavingScope;
558
561
563 }
564}
565
566
567void DIALOG_PIN_PROPERTIES::OnSize( wxSizeEvent& event )
568{
569 wxSize new_size = event.GetSize();
570
571 if( m_initialized && m_size != new_size )
572 {
573 m_size = new_size;
574
576 }
577
578 // Always propagate for a grid repaint (needed if the height changes, as well as width)
579 event.Skip();
580}
581
582
583void DIALOG_PIN_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
584{
585 // Handle a delayed focus
587 {
588 m_alternatesTurndown->Collapse( false );
589
590 m_alternatesGrid->SetFocus();
593
594 m_alternatesGrid->EnableCellEditControl( true );
595 m_alternatesGrid->ShowCellEditControl();
596
599 }
600}
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:119
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
const SYMBOL * GetParentSymbol() const
Definition sch_item.cpp:287
virtual void SetUnit(int aUnit)
Definition sch_item.h:236
PIN_ALTERNATE ALT
Definition sch_pin.h:61
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:367
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
const std::vector< BITMAPS > & PinTypeIcons()
Definition pin_type.cpp:158
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:149
int PinOrientationIndex(PIN_ORIENTATION code)
Definition pin_type.cpp:66
const wxArrayString & PinShapeNames()
Definition pin_type.cpp:167
const std::vector< BITMAPS > & PinShapeIcons()
Definition pin_type.cpp:176
const wxArrayString & PinOrientationNames()
Definition pin_type.cpp:185
PIN_ORIENTATION PinOrientationCode(size_t index)
Definition pin_type.cpp:59
const std::vector< BITMAPS > & PinOrientationIcons()
Definition pin_type.cpp:194
GRAPHIC_PINSHAPE
Definition pin_type.h:80
#define NO_PIN_FUNCTIONS_WITH_MULTIPLE_BODY_STYLES
Definition sch_actions.h:33
GRAPHIC_PINSHAPE m_Shape
ELECTRICAL_PINTYPE m_Type
Functions for manipulating tab traversal in forms and dialogs.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
const KICOMMON_API wxEventTypeTag< wxCommandEvent > WX_COLLAPSIBLE_PANE_CHANGED