KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cursors.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef CURSOR_STORE__H
21#define CURSOR_STORE__H
22
23#include <wx/cursor.h>
24
25#include <map>
26#include <vector>
27
32#if wxCHECK_VERSION( 3, 3, 0 )
33typedef wxCursorBundle WX_CURSOR_TYPE;
34#else
35typedef wxCursor WX_CURSOR_TYPE;
36#endif
37
38
97
105{
106public:
111 {
112 const char** m_xpm;
113
115 wxPoint m_hotspot;
116 };
117
124 static const WX_CURSOR_TYPE GetCursor( KICURSOR aCursorType, bool aHiDPI = false );
125
131 static wxStockCursor GetStockCursor( KICURSOR aCursorType );
132
133private:
138 CURSOR_STORE();
139
140#if wxCHECK_VERSION( 3, 3, 0 )
146 const wxCursorBundle& storeGetBundle( KICURSOR aIdKey ) const;
147#else
154 const wxCursor& storeGetCursor( KICURSOR aIdKey, bool aHiDPI = false ) const;
155#endif
156
157#if wxCHECK_VERSION( 3, 3, 0 )
159 std::map<KICURSOR, wxCursorBundle> m_bundleMap;
160#else
161 std::map<KICURSOR, wxCursor> m_standardCursorMap;
162 std::map<KICURSOR, wxCursor> m_hidpiCursorMap;
163#endif
164
165};
166
167#endif // CURSOR_STORE__H
@ ADD
Definition am_param.h:146
Store all of the related component information found in a netlist.
std::map< KICURSOR, wxCursor > m_hidpiCursorMap
Definition cursors.h:162
static const WX_CURSOR_TYPE GetCursor(KICURSOR aCursorType, bool aHiDPI=false)
Get a cursor bundle (wx 3.3+) or appropriate cursor (older versions)
Definition cursors.cpp:399
static wxStockCursor GetStockCursor(KICURSOR aCursorType)
Get stock cursor type for the given cursor.
Definition cursors.cpp:433
CURSOR_STORE()
Construct a store with cursors for all defined types.
Definition cursors.cpp:324
const wxCursor & storeGetCursor(KICURSOR aIdKey, bool aHiDPI=false) const
Get a cursor by its ID, automatically selecting the appropriate resolution.
Definition cursors.cpp:384
std::map< KICURSOR, wxCursor > m_standardCursorMap
Definition cursors.h:161
KICURSOR
Definition cursors.h:40
@ LINE_WIRE64
Definition cursors.h:91
@ LINE_BUS
Definition cursors.h:86
@ LINE_WIRE
Definition cursors.h:90
@ BULLSEYE64
Definition cursors.h:55
@ LABEL_GLOBAL64
Definition cursors.h:79
@ SUBTRACT
Definition cursors.h:68
@ VOLTAGE_PROBE
Definition cursors.h:56
@ PLACE64
Definition cursors.h:95
@ LINE_GRAPHIC64
Definition cursors.h:89
@ MEASURE64
Definition cursors.h:65
@ ARROW64
Definition cursors.h:43
@ SELECT_WINDOW
Definition cursors.h:82
@ SELECT_LASSO64
Definition cursors.h:85
@ ZOOM_IN64
Definition cursors.h:73
@ SUBTRACT64
Definition cursors.h:69
@ COMPONENT64
Definition cursors.h:81
@ REMOVE
Definition cursors.h:50
@ MOVING64
Definition cursors.h:45
@ MEASURE
Definition cursors.h:64
@ PLACE
Definition cursors.h:94
@ SELECT_LASSO
Definition cursors.h:84
@ LINE_BUS64
Definition cursors.h:87
@ ZOOM_IN
Definition cursors.h:72
@ ZOOM_OUT
Definition cursors.h:74
@ HAND64
Definition cursors.h:53
@ LABEL_NET64
Definition cursors.h:77
@ LABEL_GLOBAL
Definition cursors.h:78
@ MOVING
Definition cursors.h:44
@ TUNE64
Definition cursors.h:61
@ TEXT64
Definition cursors.h:63
@ CURRENT_PROBE
Definition cursors.h:58
@ XOR64
Definition cursors.h:71
@ WARNING64
Definition cursors.h:47
@ ADD64
Definition cursors.h:67
@ LABEL_NET
Definition cursors.h:76
@ LABEL_HIER64
Definition cursors.h:93
@ VOLTAGE_PROBE64
Definition cursors.h:57
@ CURRENT_PROBE64
Definition cursors.h:59
@ PENCIL64
Definition cursors.h:49
@ SELECT_WINDOW64
Definition cursors.h:83
@ LINE_GRAPHIC
Definition cursors.h:88
@ LABEL_HIER
Definition cursors.h:92
@ BULLSEYE
Definition cursors.h:54
@ PENCIL
Definition cursors.h:48
@ REMOVE64
Definition cursors.h:51
@ ZOOM_OUT64
Definition cursors.h:75
wxCursor WX_CURSOR_TYPE
Represents either a wxCursorBundle for wx 3.3+ or a wxCursor for older versions.
Definition cursors.h:35
@ XOR
Definition image.h:41
Definition of a cursor.
Definition cursors.h:111
const char ** m_xpm
The "hotspot" where the cursor "is" in the image.
Definition cursors.h:112