67 m_boolColAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
116 if( pcbframe !=
nullptr )
160 GetView()->ForceRefresh();
184 default: wxFAIL;
return wxEmptyString;
201 return aTypeName == wxGRID_VALUE_STRING;
208 return aTypeName == wxGRID_VALUE_BOOL;
211 return aTypeName == wxGRID_VALUE_NUMBER;
227 wxGridCellAttr::wxAttrKind aKind )
296 wxGrid*
grid = GetView();
297 const PCB_FIELD& field = this->at( (
size_t) aRow );
299 if(
grid->GetGridCursorRow() == aRow &&
grid->GetGridCursorCol() == aCol
300 &&
grid->IsCellEditControlShown() )
329 return wxT(
"bad wxWidgets!" );
336 PCB_FIELD& field = this->at( (
size_t) aRow );
347 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
355 PCB_FIELD& field = this->at( (
size_t) aRow );
362 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a long value" ), aCol ) );
370 PCB_FIELD& field = this->at( (
size_t) aRow );
372 wxString value = aValue;
383 if(
m_eval->Process( value ) )
421 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a string value" ), aCol ) );
425 GetView()->Refresh();
432 PCB_FIELD& field = this->at( (
size_t) aRow );
443 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
453 PCB_FIELD& field = this->at( (
size_t) aRow );
463 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a long value" ), aCol ) );
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual bool IsKnockout() const
virtual void SetIsKnockout(bool aKnockout)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
void SetFPRelativePosition(const VECTOR2I &aPos)
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
FRAME_T GetFrameType() const
bool IsType(FRAME_T aType) const
int GetTextHeight() const
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
bool IsKeepUpright() const
virtual bool IsVisible() const
void SetMirrored(bool isMirrored)
void SetTextWidth(int aWidth)
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetTextHeight(int aHeight)
void SetKeepUpright(bool aKeepUpright)
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetTextThickness() const
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
This class works around a bug in wxGrid where the first keystroke doesn't get sent through the valida...
virtual void SetValidator(const wxValidator &validator) override
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
The main frame for Pcbnew.
wxGridCellAttr * m_referenceAttr
PCB_FIELDS_GRID_TABLE(PCB_BASE_FRAME *aFrame, DIALOG_SHIM *aDialog)
void onUnitsChanged(wxCommandEvent &aEvent)
void SetValue(int aRow, int aCol, const wxString &aValue) override
bool GetValueAsBool(int aRow, int aCol) override
wxString GetColLabelValue(int aCol) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
std::map< std::pair< int, int >, wxString > m_evalOriginal
FIELD_VALIDATOR m_nonUrlValidator
long GetValueAsLong(int aRow, int aCol) override
wxGridCellAttr * m_readOnlyAttr
FIELD_VALIDATOR m_urlValidator
FIELD_VALIDATOR m_valueValidator
wxGridCellAttr * m_footprintAttr
wxString GetValue(int aRow, int aCol) override
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
std::unique_ptr< NUMERIC_EVALUATOR > m_eval
void SetValueAsBool(int aRow, int aCol, bool aValue) override
wxGridCellAttr * m_urlAttr
FIELD_VALIDATOR m_referenceValidator
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
wxGridCellAttr * m_boolColAttr
wxGridCellAttr * m_layerColAttr
wxGridCellAttr * m_orientationColAttr
wxGridCellAttr * m_valueAttr
void SetValueAsLong(int aRow, int aCol, long aValue) override
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void SetName(const wxString &aName)
EDA_ANGLE AngleValueFromString(const wxString &aTextValue) const
EDA_UNITS GetUserUnits() const
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
KICOMMON_API wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
wxArrayString g_menuOrientations
@ DATASHEET_FIELD
name of datasheet
@ FOOTPRINT_FIELD
Field Name Module PCB, i.e. "16DIP300".
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".