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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SCH_TABLECELL_H
25#define SCH_TABLECELL_H
26
27
28#include <sch_textbox.h>
29
30
32{
33public:
34 SCH_TABLECELL( int aLineWidth = 0, FILL_T aFillType = FILL_T::NO_FILL );
35
36 static inline bool ClassOf( const EDA_ITEM* aItem ) { return aItem && SCH_TABLECELL_T == aItem->Type(); }
37
38 virtual wxString GetClass() const override { return wxT( "SCH_TABLECELL" ); }
39
40 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
41
42 EDA_ITEM* Clone() const override { return new SCH_TABLECELL( *this ); }
43
44 EDA_GROUP* GetParentGroup() const override { return GetParent()->GetParentGroup(); }
45
46 int GetRow() const;
47 int GetColumn() const;
48
50 wxString GetAddr() const;
51
52 wxString GetShownText( const RENDER_SETTINGS* aSettings, const SCH_SHEET_PATH* aPath, bool aAllowExtraText,
53 int aDepth = 0 ) const override;
54
55 wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override
56 {
57 SCH_SHEET_PATH* sheetPath = nullptr;
58
59 if( SCHEMATIC* schematic = Schematic() )
60 sheetPath = &schematic->CurrentSheet();
61
62 return GetShownText( nullptr, sheetPath, aAllowExtraText, aDepth );
63 }
64
65 int GetColSpan() const { return m_colSpan; }
66 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
67
68 int GetRowSpan() const { return m_rowSpan; }
69 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
70
71 int GetRowHeight() const;
72 void SetRowHeight( int aHeight );
73
74 int GetColumnWidth() const;
75 void SetColumnWidth( int aWidth );
76
77 bool IsFilledForHitTesting() const override { return true; }
78
79 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle,
80 const VECTOR2I& aOffset, bool aDimmed ) override;
81
82 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
83
84 double Similarity( const SCH_ITEM& aOther ) const override;
85
86 bool operator==( const SCH_TABLECELL& aOther ) const;
87 bool operator==( const SCH_ITEM& aOther ) const override;
88
89protected:
90 void swapData( SCH_ITEM* aItem ) override;
91
94};
95
96
97#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:46
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:116
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
EDA_ITEM * GetParent() const
Definition eda_item.h:112
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition plotter.h:136
Holds all the data relating to one schematic.
Definition schematic.h:88
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:167
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:244
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:56
@ NO_FILL
Definition eda_shape.h:57
@ SCH_TABLECELL_T
Definition typeinfo.h:170
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695