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, see <https://www.gnu.org/licenses/>.
19 */
20
25#include <sch_label.h>
26#include <sch_sheet_pin.h>
28#include <sch_sheet.h>
29#include <sch_screen.h>
30#include <wx/bitmap.h>
31#include <wx/image.h>
32
33
39
40
42{
43 return m_label->GetShownText( true );
44}
45
46
48{
49 return m_label->GetShape();
50}
51
52
59
60
65
66
71
72
78
79
81{
82 return m_pin->GetShownText( true );
83}
84
85
87{
88 return m_pin->GetShape();
89}
90
91
93{
94 static wxBitmap bitMap =
96 return bitMap;
97}
98
99
104
105
110
111
116
117
123
124
126{
127 return m_label->GetShownText( true );
128}
129
130
132{
133 return m_label->GetShape();
134}
135
136
138{
139 static auto label_and_pin_icon = ( []{
142 wxBitmap right =
145 wxImage img( wxSize{ SYNC_SHEET_PIN_PREFERENCE::NORMAL_WIDTH * 2,
147 img.Paste( left.ConvertToImage(), 0, 0 );
148 img.Paste( right.ConvertToImage(), SYNC_SHEET_PIN_PREFERENCE::NORMAL_WIDTH, 0 );
149 return wxBitmap( img );
150 } )();
151
152 return label_and_pin_icon;
153}
154
155
157{
158 return nullptr;
159}
160
161
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:100
@ 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:162
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:44
SHEET_SYNCHRONIZATION_ITEM_KIND