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 )
38 {
39 return aItem && PCB_TABLECELL_T == aItem->Type();
40 }
41
42 wxString GetClass() const override
43 {
44 return wxT( "PCB_TABLECELL" );
45 }
46
47 virtual wxString GetFriendlyName() const override
48 {
49 return _( "Table Cell" );
50 }
51
52 EDA_ITEM* Clone() const override
53 {
54 return new PCB_TABLECELL( *this );
55 }
56
57 EDA_GROUP* GetParentGroup() const override
58 {
59 return GetParent()->GetParentGroup();
60 }
61
62 int GetRow() const;
63 int GetColumn() const;
64
65 // @return the spreadsheet nomenclature for the cell (ie: B3 for 2nd column, 3rd row)
66 wxString GetAddr() const;
67
68 int GetColSpan() const { return m_colSpan; }
69 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
70
71 int GetRowSpan() const { return m_rowSpan; }
72 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
73
74 int GetRowHeight() const;
75 void SetRowHeight( int aHeight );
76
77 int GetColumnWidth() const;
78 void SetColumnWidth( int aWidth );
79
80 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
81
82 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
83
84 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
85
86 bool operator==( const PCB_TABLECELL& aBoardItem ) const;
87 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
88
89protected:
90 virtual void swapData( BOARD_ITEM* aImage ) override;
91
92protected:
95};
96
97
98#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:79
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:210
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
Definition: pcb_tablecell.h:71
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)
Definition: pcb_tablecell.h:37
void SetRowHeight(int aHeight)
virtual void swapData(BOARD_ITEM *aImage) override
void SetRowSpan(int aSpan)
Definition: pcb_tablecell.h:72
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)
int GetColSpan() const
Definition: pcb_tablecell.h:68
virtual wxString GetFriendlyName() const override
Definition: pcb_tablecell.h:47
void SetColSpan(int aSpan)
Definition: pcb_tablecell.h:69
int GetRow() const
EDA_GROUP * GetParentGroup() const override
Definition: pcb_tablecell.h:57
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_tablecell.h:52
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.
Definition: pcb_tablecell.h:42
#define _(s)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition: typeinfo.h:95