KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_tablecell.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef SCH_TABLECELL_H
21#define SCH_TABLECELL_H
22
23
24#include <sch_textbox.h>
25
26
28{
29public:
30 SCH_TABLECELL( int aLineWidth = 0, FILL_T aFillType = FILL_T::NO_FILL );
31
32 static inline bool ClassOf( const EDA_ITEM* aItem ) { return aItem && SCH_TABLECELL_T == aItem->Type(); }
33
34 virtual wxString GetClass() const override { return wxT( "SCH_TABLECELL" ); }
35
36 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
37
38 EDA_ITEM* Clone() const override { return new SCH_TABLECELL( *this ); }
39
40 EDA_GROUP* GetParentGroup() const override { return GetParent()->GetParentGroup(); }
41
42 int GetRow() const;
43 int GetColumn() const;
44
46 wxString GetAddr() const;
47
48 wxString GetShownText( const RENDER_SETTINGS* aSettings, const SCH_SHEET_PATH* aPath, bool aAllowExtraText,
49 int aDepth = 0 ) const override;
50
51 wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override
52 {
53 SCH_SHEET_PATH* sheetPath = nullptr;
54
55 if( SCHEMATIC* schematic = Schematic() )
56 sheetPath = &schematic->CurrentSheet();
57
58 return GetShownText( nullptr, sheetPath, aAllowExtraText, aDepth );
59 }
60
61 int GetColSpan() const { return m_colSpan; }
62 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
63
64 int GetRowSpan() const { return m_rowSpan; }
65 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
66
67 int GetRowHeight() const;
68 void SetRowHeight( int aHeight );
69
70 int GetColumnWidth() const;
71 void SetColumnWidth( int aWidth );
72
73 bool IsFilledForHitTesting() const override { return true; }
74
75 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle,
76 const VECTOR2I& aOffset, bool aDimmed ) override;
77
78 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
79
80 double Similarity( const SCH_ITEM& aOther ) const override;
81
82 bool operator==( const SCH_TABLECELL& aOther ) const;
83 bool operator==( const SCH_ITEM& aOther ) const override;
84
85protected:
86 void swapData( SCH_ITEM* aItem ) override;
87
90};
91
92
93#endif /* SCH_TABLECELL_H */
The base class for create windows for drawing purpose.
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:42
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:114
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
EDA_ITEM * GetParent() const
Definition eda_item.h:110
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition plotter.h:133
Holds all the data relating to one schematic.
Definition schematic.h:90
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:268
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
EDA_GROUP * GetParentGroup() const override
static bool ClassOf(const EDA_ITEM *aItem)
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
int GetRowHeight() const
int GetColSpan() const
virtual wxString GetClass() const override
Return the class name.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
int GetRowSpan() const
SCH_TABLECELL(int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
wxString GetAddr() const
bool operator==(const SCH_TABLECELL &aOther) const
void SetRowSpan(int aSpan)
wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetColumnWidth(int aWidth)
int GetColumn() const
void SetColSpan(int aSpan)
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
bool IsFilledForHitTesting() const override
void SetRowHeight(int aHeight)
int GetColumnWidth() const
int GetRow() const
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.
SCH_TEXTBOX(SCH_LAYER_ID aLayer=LAYER_NOTES, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXTBOX_T)
FILL_T
Definition eda_shape.h:59
@ NO_FILL
Definition eda_shape.h:60
@ SCH_TABLECELL_T
Definition typeinfo.h:163
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683