KiCad PCB EDA Suite
UnitSelector.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-2016 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 _UnitSelector_h_
27 #define _UnitSelector_h_
28 
29 
30 #include <wx/string.h>
31 #include <wx/choice.h>
32 
33 
34 class UNIT_SELECTOR: public wxChoice
35 {
36 public:
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 {
59 public:
60  UNIT_SELECTOR_LEN( wxWindow *parent, wxWindowID id,
61  const wxPoint& pos, const wxSize& size,
62  const wxArrayString& choices, long style = 0 );
63 
69  virtual double GetUnitScale() override;
70 };
71 
73 {
74 public:
75  UNIT_SELECTOR_THICKNESS( wxWindow *parent, wxWindowID id,
76  const wxPoint& pos, const wxSize& size,
77  const wxArrayString& choices, long style = 0 );
78 
84  virtual double GetUnitScale() override;
85 };
86 
88 {
89 public:
90  UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID id,
91  const wxPoint& pos, const wxSize& size,
92  const wxArrayString& choices, long style = 0 );
93 
99  virtual double GetUnitScale() override;
100 };
101 
103 {
104 public:
105  UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id,
106  const wxPoint& pos, const wxSize& size,
107  const wxArrayString& choices, long style = 0 );
108 
114  virtual double GetUnitScale() override;
115 };
116 
118 {
119 public:
120  UNIT_SELECTOR_RESISTOR( wxWindow *parent, wxWindowID id,
121  const wxPoint& pos, const wxSize& size,
122  const wxArrayString& choices, long style = 0 );
123 
129  virtual double GetUnitScale() override;
130 };
131 
132 #endif // _UnitSelector_h_
133 
UNIT_SELECTOR_ANGLE(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
virtual double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_FREQUENCY(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: UnitSelector.h:37
virtual double GetUnitScale() override
Function GetUnitScale.
virtual double GetUnitScale() override
Function GetUnitScale.
virtual double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
wxString GetUnitName()
Definition: UnitSelector.h:51
UNIT_SELECTOR_RESISTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
virtual double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_THICKNESS(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0)
virtual double GetUnitScale()=0
Function GetUnitScale.