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 (C) 2024 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>
29
30
32{
33public:
34 PCB_TABLECELL( BOARD_ITEM* parent );
35
36 static inline bool ClassOf( const EDA_ITEM* aItem )
37 {
38 return aItem && PCB_TABLECELL_T == aItem->Type();
39 }
40
41 wxString GetClass() const override
42 {
43 return wxT( "PCB_TABLECELL" );
44 }
45
46 virtual wxString GetFriendlyName() const override
47 {
48 return _( "Table Cell" );
49 }
50
51 EDA_ITEM* Clone() const override
52 {
53 return new PCB_TABLECELL( *this );
54 }
55
56 int GetRow() const;
57 int GetColumn() const;
58
59 // @return the spreadsheet nomenclature for the cell (ie: B3 for 2nd column, 3rd row)
60 wxString GetAddr() const;
61
62 int GetColSpan() const { return m_colSpan; }
63 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
64
65 int GetRowSpan() const { return m_rowSpan; }
66 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
67
68 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
69
70 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
71
72 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
73
74 bool operator==( const PCB_TABLECELL& aBoardItem ) const;
75 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
76
77protected:
78 virtual void swapData( BOARD_ITEM* aImage ) override;
79
80protected:
83};
84
85
86#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:77
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
int GetRowSpan() const
Definition: pcb_tablecell.h:65
wxString GetAddr() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
static bool ClassOf(const EDA_ITEM *aItem)
Definition: pcb_tablecell.h:36
virtual void swapData(BOARD_ITEM *aImage) override
void SetRowSpan(int aSpan)
Definition: pcb_tablecell.h:66
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
int GetColSpan() const
Definition: pcb_tablecell.h:62
virtual wxString GetFriendlyName() const override
Definition: pcb_tablecell.h:46
void SetColSpan(int aSpan)
Definition: pcb_tablecell.h:63
int GetRow() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_tablecell.h:51
int GetColumn() 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:41
#define _(s)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition: typeinfo.h:95