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, true ),
128 m_posY( parent, m_posYLabel, m_posYCtrl, m_posYUnits, true ),
129 m_pinLength( parent, m_pinLengthLabel, m_pinLengthCtrl, m_pinLengthUnits, true ),
130 m_nameSize( parent, m_nameSizeLabel, m_nameSizeCtrl, m_nameSizeUnits, true ),
131 m_numberSize( parent, m_numberSizeLabel, m_numberSizeCtrl, m_numberSizeUnits, true ),
132 m_delayedFocusRow( -1 ),
133 m_delayedFocusColumn( -1 ),
134 m_initialized( false )
145 for (
unsigned ii = 0; ii < orientationNames.GetCount(); ii++ )
188 _(
"Alternate pin assignments are not available for DeMorgan components." ) );
192 wxGridCellAttr* attr;
194 attr =
new wxGridCellAttr;
199 attr =
new wxGridCellAttr;
236 if( !DIALOG_SHIM::TransferDataToWindow() )
283 if( !DIALOG_SHIM::TransferDataFromWindow() )
288 const int acceptable_mingrid = 50;
294 auto msg =
wxString::Format(
_(
"This pin is not on a %d mils grid which will make it\n" 295 "difficult to connect to in the schematic.\n" 296 "Do you want to continue?" ),
297 acceptable_mingrid );
298 if( !
IsOK(
this, msg ) )
319 alternates[ alt.m_Name ] = alt;
331 wxSize dc_size = dc.GetSize();
332 dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
341 double xscale = (double) dc_size.x / bBox.
GetWidth();
342 double yscale = (double) dc_size.y / bBox.
GetHeight();
343 double scale = std::min( xscale, yscale );
387 newAlt.
m_Name = wxEmptyString;
416 curRow = std::max( 0, curRow - 1 );
429 wxGridUpdateLocker deferRepaintsTillLeavingScope;
441 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
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.
This file is part of the common library.
const std::vector< BITMAP_DEF > & PinOrientationIcons()
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
int GetOrientation() const
void OnPropertiesChange(wxCommandEvent &event) override
LIB_PART * GetParent() const
std::vector< wxWindow * > m_tabOrder
void SetShape(GRAPHIC_PINSHAPE aShape)
GRAPHIC_PINSHAPE GetShape() const
ALT_PIN_DATA_MODEL(EDA_UNITS aUserUnits)
const std::vector< BITMAP_DEF > & PinTypeIcons()
void AppendRow(const LIB_PIN::ALT &aAlt)
void adjustGridColumns(int aWidth)
void SetSelection(GRAPHIC_PINSHAPE aShape)
wxTextCtrl * m_numberSizeCtrl
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.
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
const std::vector< BITMAP_DEF > & PinShapeIcons()
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
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
int GetNumberRows() override
SYMBOL_EDIT_FRAME * m_frame
const wxArrayString & PinShapeNames()
void SetType(ELECTRICAL_PINTYPE aType)
ELECTRICAL_PINTYPE GetPinTypeSelection()
~DIALOG_PIN_PROPERTIES() override
const wxString & GetName() const
wxString GetValue(int aRow, int aCol) override
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
bool TransferDataFromWindow() override
void OnDeleteAlternate(wxCommandEvent &event) override
const BITMAP_OPAQUE small_trash_xpm[1]
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
wxTextCtrl * m_pinLengthCtrl
std::map< wxString, ALT > & GetAlternates()
DIALOG_PIN_PROPERTIES(SYMBOL_EDIT_FRAME *parent, LIB_PIN *aPin)
Constructor.
int GetNumberTextSize() const
TRANSFORM DefaultTransform
void SetName(const wxString &aName)
void SetNameTextSize(int aSize)
ELECTRICAL_PINTYPE
The component 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
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
Class DIALOG_PIN_PROPERTIES_BASE.
Handle the component boundary box.
wxCollapsiblePane * m_alternatesTurndown
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
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 BITMAP_OPAQUE small_plus_xpm[1]
A color representation with 4 components: red, green, blue, alpha.
The symbol library editor main window.