KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_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 PCB_TABLECELL_H
25#define PCB_TABLECELL_H
26
27
28#include <pcb_textbox.h>
30
31
33{
34public:
35 PCB_TABLECELL( BOARD_ITEM* parent );
36
37 static inline bool ClassOf( const EDA_ITEM* aItem ) { return aItem && PCB_TABLECELL_T == aItem->Type(); }
38
39 wxString GetClass() const override { return wxT( "PCB_TABLECELL" ); }
40
41 virtual wxString GetFriendlyName() const override { return _( "Table Cell" ); }
42
43 EDA_ITEM* Clone() const override { return new PCB_TABLECELL( *this ); }
44
45 EDA_GROUP* GetParentGroup() const override { return GetParent()->GetParentGroup(); }
46
47 int GetRow() const;
48 int GetColumn() const;
49
50 // @return the spreadsheet nomenclature for the cell (ie: B3 for 2nd column, 3rd row)
51 wxString GetAddr() const;
52
53 wxString GetShownText( bool aAllowExtraText, int aDepth = 0 ) const override;
54
55 int GetColSpan() const { return m_colSpan; }
56 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
57
58 int GetRowSpan() const { return m_rowSpan; }
59 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
60
61 int GetRowHeight() const;
62 void SetRowHeight( int aHeight );
63
64 int GetColumnWidth() const;
65 void SetColumnWidth( int aWidth );
66
67 bool IsFilledForHitTesting() const override { return true; }
68
69 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
70
71 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
72
73 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
74
75 bool operator==( const PCB_TABLECELL& aBoardItem ) const;
76 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
77
78protected:
79 virtual void swapData( BOARD_ITEM* aImage ) override;
80
81protected:
84};
85
86
87#endif /* PCB_TABLECELL_H */
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
BOARD_ITEM_CONTAINER * GetParent() const
Definition board_item.h:214
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
int GetColumnWidth() const
int GetRowSpan() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
wxString GetAddr() const
static bool ClassOf(const EDA_ITEM *aItem)
void SetRowHeight(int aHeight)
virtual void swapData(BOARD_ITEM *aImage) override
void SetRowSpan(int aSpan)
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)
bool IsFilledForHitTesting() const override
int GetColSpan() const
virtual wxString GetFriendlyName() const override
void SetColSpan(int aSpan)
int GetRow() const
EDA_GROUP * GetParentGroup() const override
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
int GetColumn() const
int GetRowHeight() 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.
wxString GetClass() const override
Return the class name.
PCB_TABLECELL(BOARD_ITEM *parent)
PCB_TEXTBOX(BOARD_ITEM *aParent, KICAD_T aType=PCB_TEXTBOX_T)
#define _(s)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition typeinfo.h:95