KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 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 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
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
25
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
47 virtual double GetUnitScale() = 0;
48
49 wxString GetUnitName()
50 {
51 return GetStringSelection();
52 }
53};
54
55
57{
58public:
59 UNIT_SELECTOR_LEN( wxWindow *parent, wxWindowID id,
60 const wxPoint& pos, const wxSize& size,
61 const wxArrayString& choices, long style = 0 );
62
66 double GetUnitScale() override;
67};
68
69
71{
72public:
73 UNIT_SELECTOR_THICKNESS( wxWindow *parent, wxWindowID id,
74 const wxPoint& pos, const wxSize& size,
75 const wxArrayString& choices, long style = 0 );
76
80 double GetUnitScale() override;
81};
82
83
85{
86public:
87 UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID id,
88 const wxPoint& pos, const wxSize& size,
89 const wxArrayString& choices, long style = 0 );
90
94 double GetUnitScale() override;
95};
96
97
99{
100public:
101 UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id,
102 const wxPoint& pos, const wxSize& size,
103 const wxArrayString& choices, long style = 0 );
104
108 double GetUnitScale() override;
109};
110
111
113{
114public:
115 UNIT_SELECTOR_RESISTOR( wxWindow *parent, wxWindowID id,
116 const wxPoint& pos, const wxSize& size,
117 const wxArrayString& choices, long style = 0 );
118
122 double GetUnitScale() override;
123};
124
125
127{
128public:
129 UNIT_SELECTOR_LINEAR_RESISTANCE( wxWindow *parent, wxWindowID id,
130 const wxPoint& pos, const wxSize& size,
131 const wxArrayString& choices, long style = 0 );
132
136 double GetUnitScale() override;
137};
138
139
141{
142public:
143 UNIT_SELECTOR_LEN_CABLE( wxWindow *parent, wxWindowID id,
144 const wxPoint& pos, const wxSize& size,
145 const wxArrayString& choices, long style = 0 );
146
150 double GetUnitScale() override;
151};
152
153
155{
156public:
157 UNIT_SELECTOR_VOLTAGE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
158 const wxArrayString& choices, long style = 0 );
159
163 double GetUnitScale() override;
164};
165
166
168{
169public:
170 UNIT_SELECTOR_POWER( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
171 const wxArrayString& choices, long style = 0 );
172
176 double GetUnitScale() override;
177};
178
179
181{
182public:
183 UNIT_SELECTOR_SPEED( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
184 const wxArrayString& choices, long style = 0 );
185
189 double GetUnitScale() override;
190};
191
192
194{
195public:
196 UNIT_SELECTOR_TIME( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
197 const wxArrayString& choices, long style = 0 );
198
202 double GetUnitScale() override;
203};
204
205#endif // UNIT_SELECTOR_H
206
UNIT_SELECTOR_ANGLE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
UNIT_SELECTOR_FREQUENCY(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
double GetUnitScale() override
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
Return the scaling factor to convert users units to normalized units (meter).
UNIT_SELECTOR_LINEAR_RESISTANCE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
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
double GetUnitScale() override
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
UNIT_SELECTOR_TIME(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
double GetUnitScale() override
double GetUnitScale() override
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)
wxString GetUnitName()
virtual double GetUnitScale()=0