KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sheet_synchronization_item.cpp
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) 2023 Ethan Chien <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
29#include <sch_label.h>
30#include <sch_sheet_pin.h>
32#include <sch_sheet.h>
33#include <sch_screen.h>
34#include <wx/bitmap.h>
35#include <wx/image.h>
36
37
43
44
46{
47 return m_label->GetShownText( true );
48}
49
50
52{
53 return m_label->GetShape();
54}
55
56
63
64
69
70
75
76
82
83
85{
86 return m_pin->GetShownText( true );
87}
88
89
91{
92 return m_pin->GetShape();
93}
94
95
97{
98 static wxBitmap bitMap =
100 return bitMap;
101}
102
103
108
109
114
115
120
121
127
128
130{
131 return m_label->GetShownText( true );
132}
133
134
136{
137 return m_label->GetShape();
138}
139
140
142{
143 static auto label_and_pin_icon = ( []{
146 wxBitmap right =
149 wxImage img( wxSize{ SYNC_SHEET_PIN_PREFERENCE::NORMAL_WIDTH * 2,
151 img.Paste( left.ConvertToImage(), 0, 0 );
152 img.Paste( right.ConvertToImage(), SYNC_SHEET_PIN_PREFERENCE::NORMAL_WIDTH, 0 );
153 return wxBitmap( img );
154 } )();
155
156 return label_and_pin_icon;
157}
158
159
161{
162 return nullptr;
163}
164
165
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition bitmap.cpp:104
@ add_hierarchical_label
@ add_hierar_pin
ASSOCIATED_SCH_LABEL_PIN(SCH_HIERLABEL *aLabel, SCH_SHEET_PIN *aPin)
SCH_ITEM * GetItem() const override
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
wxBitmap & GetBitmap() const override
SCH_HIERLABEL_SYNCHRONIZATION_ITEM(SCH_HIERLABEL *aLabel, SCH_SHEET *aSheet)
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:167
SCH_SHEET_PIN_SYNCHRONIZATION_ITEM(SCH_SHEET_PIN *aPin, SCH_SHEET *aSheet)
SHEET_SYNCHRONIZATION_ITEM_KIND GetKind() const override
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:47
SHEET_SYNCHRONIZATION_ITEM_KIND