KiCad PCB EDA Suite
unit_selector.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) 2011-2014 Jean-Pierre Charras
5 * Copyright (C) 2004-2022 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 3
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 along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
26#ifndef UNIT_SELECTOR_H
27#define UNIT_SELECTOR_H
28
29
30#include <wx/string.h>
31#include <wx/choice.h>
32
33
34class UNIT_SELECTOR: public wxChoice
35{
36public:
37 UNIT_SELECTOR( wxWindow *parent, wxWindowID id,
38 const wxPoint& pos, const wxSize& size,
39 const wxArrayString& choices, long style = 0 ):
40 wxChoice( parent, id, pos, size, choices, style )
41 {
42 }
43
49 virtual double GetUnitScale() = 0;
50
51 wxString GetUnitName()
52 {
53 return GetStringSelection();
54 }
55};
56
58{
59public:
60 UNIT_SELECTOR_LEN( wxWindow *parent, wxWindowID id,
61 const wxPoint& pos, const wxSize& size,
62 const wxArrayString& choices, long style = 0 );
63
69 double GetUnitScale() override;
70};
71
73{
74public:
75 UNIT_SELECTOR_THICKNESS( wxWindow *parent, wxWindowID id,
76 const wxPoint& pos, const wxSize& size,
77 const wxArrayString& choices, long style = 0 );
78
84 double GetUnitScale() override;
85};
86
88{
89public:
90 UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID id,
91 const wxPoint& pos, const wxSize& size,
92 const wxArrayString& choices, long style = 0 );
93
99 double GetUnitScale() override;
100};
101
103{
104public:
105 UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id,
106 const wxPoint& pos, const wxSize& size,
107 const wxArrayString& choices, long style = 0 );
108
114 double GetUnitScale() override;
115};
116
118{
119public:
120 UNIT_SELECTOR_RESISTOR( wxWindow *parent, wxWindowID id,
121 const wxPoint& pos, const wxSize& size,
122 const wxArrayString& choices, long style = 0 );
123
129 double GetUnitScale() override;
130};
131
133{
134public:
135 UNIT_SELECTOR_LINEAR_RESISTANCE( wxWindow *parent, wxWindowID id,
136 const wxPoint& pos, const wxSize& size,
137 const wxArrayString& choices, long style = 0 );
138
144 double GetUnitScale() override;
145};
146
148{
149public:
150 UNIT_SELECTOR_LEN_CABLE( wxWindow *parent, wxWindowID id,
151 const wxPoint& pos, const wxSize& size,
152 const wxArrayString& choices, long style = 0 );
153
159 double GetUnitScale() override;
160};
161
163{
164public:
165 UNIT_SELECTOR_VOLTAGE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
166 const wxArrayString& choices, long style = 0 );
167
173 double GetUnitScale() override;
174};
175
177{
178public:
179 UNIT_SELECTOR_POWER( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
180 const wxArrayString& choices, long style = 0 );
181
187 double GetUnitScale() override;
188};
189
191{
192public:
193 UNIT_SELECTOR_SPEED( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
194 const wxArrayString& choices, long style = 0 );
195
201 double GetUnitScale() override;
202};
203
205{
206public:
207 UNIT_SELECTOR_TIME( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
208 const wxArrayString& choices, long style = 0 );
209
215 double GetUnitScale() override;
216};
217
218#endif // UNIT_SELECTOR_H
219
UNIT_SELECTOR_ANGLE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_FREQUENCY(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN_CABLE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
UNIT_SELECTOR_LEN(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LINEAR_RESISTANCE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_POWER(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
UNIT_SELECTOR_RESISTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_SPEED(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
UNIT_SELECTOR_THICKNESS(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_TIME(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
Function GetUnitScale.
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_VOLTAGE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
UNIT_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
Definition: unit_selector.h:37
wxString GetUnitName()
Definition: unit_selector.h:51
virtual double GetUnitScale()=0
Function GetUnitScale.