58 return wxString::Format(
_(
"Table cell %s" ),
GetAddr() );
66 for(
int row = 0; row <
table->GetRowCount(); ++row )
68 for(
int col = 0; col <
table->GetColCount(); ++col )
70 if(
table->GetCell( row, col ) ==
this )
83 for(
int row = 0; row <
table->GetRowCount(); ++row )
85 for(
int col = 0; col <
table->GetColCount(); ++col )
87 if(
table->GetCell( row, col ) ==
this )
98 return wxString::Format( wxT(
"%c%d" ),
'A' +
GetColumn() % 26,
GetRow() + 1 );
107 std::function<bool( wxString* )> tableCellResolver = [&]( wxString* token ) ->
bool
109 if( token->IsSameAs( wxT(
"ROW" ) ) )
111 *token = wxString::Format( wxT(
"%d" ),
GetRow() + 1 );
114 else if( token->IsSameAs( wxT(
"COL" ) ) )
116 *token = wxString::Format( wxT(
"%d" ),
GetColumn() + 1 );
119 else if( token->IsSameAs( wxT(
"ADDR" ) ) )
124 else if( token->IsSameAs( wxT(
"LAYER" ) ) )
130 if( parentFootprint && parentFootprint->
ResolveTextVar( token, aDepth + 1 ) )
147 int colWidth = ( corners[1] - corners[0] ).EuclideanNorm();
157 text.Replace( wxT(
"<<<ESC_DOLLAR:" ), wxT(
"${" ) );
158 text.Replace( wxT(
"<<<ESC_AT:" ), wxT(
"@{" ) );
196 aList.emplace_back(
_(
"Table Cell" ),
GetAddr() );
202 aList.emplace_back(
_(
"Status" ),
_(
"Locked" ) );
205 aList.emplace_back(
_(
"Mirror" ),
IsMirrored() ?
_(
"Yes" ) :
_(
"No" ) );
210 aList.emplace_back(
_(
"Font" ),
GetFont() ?
GetFont()->GetName() :
_(
"Default" ) );
215 aList.emplace_back(
_(
"Text Thickness" ),
_(
"Auto" ) );
229 double similarity = 1.0;
249 return *
this == other;
306 const wxString tableProps =
_(
"Table" );
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
bool IsLocked() const override
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
BOARD_ITEM_CONTAINER * GetParent() const
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Information pertinent to a Pcbnew printed circuit board.
bool ResolveTextVar(wxString *token, int aDepth) const
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
void SetRectangleHeight(const int &aHeight)
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetRectangleWidth(const int &aWidth)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual int GetTextHeight() const
KIFONT::FONT * GetFont() const
void SetMirrored(bool isMirrored)
virtual EDA_ANGLE GetDrawRotation() const
virtual int GetTextWidth() const
virtual KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const
bool HasTextVars() const
Indicates the ShownText has text var references which need to be processed.
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
FONT is an abstract base class for both outline and stroke fonts.
void LinebreakText(wxString &aText, int aColumnWidth, const VECTOR2I &aGlyphSize, int aThickness, bool aBold, bool aItalic) const
Insert characters into text to ensure that no lines are wider than aColumnWidth.
int GetColumnWidth() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetRowHeight(int aHeight)
virtual void swapData(BOARD_ITEM *aImage) override
double Similarity(const BOARD_ITEM &aBoardItem) const override
Return a measure of how likely the other object is to represent the same object.
bool operator==(const PCB_TABLECELL &aBoardItem) const
void SetColumnWidth(int aWidth)
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
PCB_TABLECELL(BOARD_ITEM *parent)
double Similarity(const BOARD_ITEM &aBoardItem) const override
Return a measure of how likely the other object is to represent the same object.
int GetMarginBottom() const
EDA_ANGLE GetTextAngle() const override
PCB_TEXTBOX(BOARD_ITEM *aParent, KICAD_T aType=PCB_TEXTBOX_T)
int GetTextThickness() const override
VECTOR2I GetTextSize() const override
int GetMarginLeft() const
std::vector< VECTOR2I > GetCornersInSequence(EDA_ANGLE angle) const override
int GetMarginRight() const
bool operator==(const PCB_TEXTBOX &aOther) const
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
wxString ResolveTextVars(const wxString &aSource, const std::function< bool(wxString *)> *aResolver, int &aDepth)
Multi-pass text variable expansion and math expression evaluation.
#define PCB_EDIT_FRAME_NAME
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Message panel definition file.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
static struct PCB_TABLECELL_DESC _PCB_TABLECELL_DESC
@ PT_SIZE
Size expressed in distance units (mm/inch)
std::vector< std::vector< std::string > > table
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables