50 case COL_NAME:
return _(
"Alternate Pin Name" );
51 case COL_TYPE:
return _(
"Electrical Type" );
53 default: wxFAIL;
return wxEmptyString;
62 wxString
GetValue(
int aRow,
int aCol )
override 66 case COL_NAME:
return at( aRow ).m_Name;
69 default: wxFAIL;
return wxEmptyString;
73 void SetValue(
int aRow,
int aCol,
const wxString &aValue )
override 78 at( aRow ).m_Name = aValue;
105 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
106 GetView()->ProcessTableMessage( msg );
112 erase( begin() + aRow );
116 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow, 1 );
117 GetView()->ProcessTableMessage( msg );
127 m_posX( parent, m_posXLabel, m_posXCtrl, m_posXUnits ),
128 m_posY( parent, m_posYLabel, m_posYCtrl, m_posYUnits ),
129 m_pinLength( parent, m_pinLengthLabel, m_pinLengthCtrl, m_pinLengthUnits ),
130 m_nameSize( parent, m_nameSizeLabel, m_nameSizeCtrl, m_nameSizeUnits ),
131 m_numberSize( parent, m_numberSizeLabel, m_numberSizeCtrl, m_numberSizeUnits ),
132 m_delayedFocusRow( -1 ),
133 m_delayedFocusColumn( -1 ),
134 m_initialized( false )
145 m_textInfoUpper->SetLabel(
_(
"Synchronized pins edit mode, and this pin is new" ) );
146 m_textInfoLower->SetLabel(
_(
"Similar pins will be automatically added to other units, " 147 "if this pin is not common to all units" ) );
152 m_textInfoLower->SetLabel(
_(
"Similar pins at the same location will be edited. " 153 "Pin number of other pins will be not modified" ) );
163 for (
unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
206 _(
"Alternate pin assignments are not available for De Morgan symbols." ) );
210 wxGridCellAttr* attr;
212 attr =
new wxGridCellAttr;
217 attr =
new wxGridCellAttr;
255 if( !DIALOG_SHIM::TransferDataToWindow() )
283 toolTip =
_(
"This symbol only has one unit. This control has no effect." );
285 toolTip =
_(
"Synchronized pin edit mode is enabled.\n" 286 "Similar pins will be edited, regardless this option." );
288 toolTip =
_(
"If checked, this pin will exist in all units." );
318 if( !DIALOG_SHIM::TransferDataFromWindow() )
323 const int acceptable_mingrid = 50;
329 auto msg =
wxString::Format(
_(
"This pin is not on a %d mils grid which will make it\n" 330 "difficult to connect to in the schematic.\n" 331 "Do you want to continue?" ),
332 acceptable_mingrid );
333 if( !
IsOK(
this, msg ) )
354 alternates[ alt.m_Name ] = alt;
366 wxSize dc_size = dc.GetSize();
367 dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
376 double xscale = (double) dc_size.x / bBox.
GetWidth();
377 double yscale = (double) dc_size.y / bBox.
GetHeight();
378 double scale = std::min( xscale, yscale );
423 newAlt.
m_Name = wxEmptyString;
452 curRow = std::max( 0, curRow - 1 );
465 wxGridUpdateLocker deferRepaintsTillLeavingScope;
477 auto new_size =
event.GetSize().GetX();
void SetNumberTextSize(int aSize)
void GRResetPenAndBrush(wxDC *DC)
Functions for manipulating tab traversal in forms and dialogs.
void OnUpdateUI(wxUpdateUIEvent &event) override
const std::vector< BITMAPS > & PinOrientationIcons()
wxString GetColLabelValue(int aCol) override
wxButton * m_sdbSizerButtonsCancel
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
void SetOrientation(int aOrientation)
WX_GRID * m_alternatesGrid
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::vector< BITMAPS > & PinShapeIcons()
This file is part of the common library.
int GetOrientation() const
void OnPropertiesChange(wxCommandEvent &event) override
std::vector< wxWindow * > m_tabOrder
void SetShape(GRAPHIC_PINSHAPE aShape)
GRAPHIC_PINSHAPE GetShape() const
ALT_PIN_DATA_MODEL(EDA_UNITS aUserUnits)
void AppendRow(const LIB_PIN::ALT &aAlt)
void adjustGridColumns(int aWidth)
void SetSelection(GRAPHIC_PINSHAPE aShape)
wxTextCtrl * m_numberSizeCtrl
bool m_SyncPinEdit
Set to true to synchronize pins at the same position when editing symbols with multiple units or mult...
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
int m_originalColWidths[COL_COUNT]
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void onUpdateUIInfo(wxUpdateUIEvent &event) override
int PinOrientationIndex(int code)
void SetLength(int aLength)
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
bool TransferDataToWindow() override
wxBitmapButton * m_deleteAlternate
int GetNumberCols() override
int PinOrientationCode(int index)
wxBitmapComboBox * m_choiceOrientation
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...
wxButton * m_sdbSizerButtonsOK
const EDA_RECT GetBoundingBox() const override
void OnPaintShowPanel(wxPaintEvent &event) override
void SetPosition(const wxPoint &aPos) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
ELECTRICAL_PINTYPE m_Type
EDA_UNITS GetUserUnits() const
void OnAddAlternate(wxCommandEvent &event) override
void SetNumber(const wxString &aNumber)
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
ALT_PIN_DATA_MODEL * m_alternatesDataModel
bool HasConversion() const
Test if symbol has more than one body conversion type (DeMorgan).
int GetNumberRows() override
SYMBOL_EDIT_FRAME * m_frame
const wxArrayString & PinShapeNames()
void SetType(ELECTRICAL_PINTYPE aType)
ELECTRICAL_PINTYPE GetPinTypeSelection()
wxBoxSizer * m_bSizerInfo
~DIALOG_PIN_PROPERTIES() override
const wxString & GetName() const
wxString GetValue(int aRow, int aCol) override
int GetUnitCount() const override
For items with units, return the number of units.
wxCheckBox * m_checkApplyToAllParts
void SetVisible(bool aVisible)
wxTextCtrl * m_textPinName
const wxArrayString & PinTypeNames()
wxCheckBox * m_checkApplyToAllConversions
void SetSelection(ELECTRICAL_PINTYPE aType)
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
int GetNameTextSize() const
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
bool TransferDataFromWindow() override
void OnDeleteAlternate(wxCommandEvent &event) override
wxBitmapButton * m_addAlternate
void SetConvert(int aConvert)
wxPoint GetPosition() const override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
const wxArrayString & PinOrientationNames()
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
const wxString & GetNumber() const
ELECTRICAL_PINTYPE GetType() const
LIB_SYMBOL * GetParent() const
wxTextCtrl * m_pinLengthCtrl
std::map< wxString, ALT > & GetAlternates()
DIALOG_PIN_PROPERTIES(SYMBOL_EDIT_FRAME *parent, LIB_PIN *aPin)
int GetNumberTextSize() const
TRANSFORM DefaultTransform
void SetName(const wxString &aName)
void SetNameTextSize(int aSize)
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
virtual void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, void *aData, const TRANSFORM &aTransform)
Draw an item.
void OnSize(wxSizeEvent &event) override
wxTextCtrl * m_textPinNumber
Class DIALOG_PIN_PROPERTIES_BASE.
Handle the component boundary box.
wxCollapsiblePane * m_alternatesTurndown
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual long long int GetValue()
Return the current value in Internal Units.
PinShapeComboBox * m_choiceStyle
void SetValue(int aRow, int aCol, const wxString &aValue) override
bool IsEmptyCell(int row, int col) override
wxStaticText * m_textInfoLower
wxStaticText * m_textInfoUpper
wxTextCtrl * m_nameSizeCtrl
GRAPHIC_PINSHAPE GetPinShapeSelection()
PinTypeComboBox * m_choiceElectricalType
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void SetPrintDC(wxDC *aDC)
const std::vector< BITMAPS > & PinTypeIcons()
A color representation with 4 components: red, green, blue, alpha.
The symbol library editor main window.