]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: gauge.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef __GTKGAUGEH__ | |
11 | #define __GTKGAUGEH__ | |
12 | ||
13 | #include "wx/defs.h" | |
14 | ||
15 | #if wxUSE_GAUGE | |
16 | ||
17 | #include "wx/object.h" | |
18 | #include "wx/list.h" | |
19 | #include "wx/control.h" | |
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | // classes | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | class WXDLLIMPEXP_CORE wxGauge; | |
26 | ||
27 | //----------------------------------------------------------------------------- | |
28 | // global data | |
29 | //----------------------------------------------------------------------------- | |
30 | ||
31 | extern WXDLLIMPEXP_CORE const wxChar wxGaugeNameStr[]; | |
32 | ||
33 | //----------------------------------------------------------------------------- | |
34 | // wxGaugeBox | |
35 | //----------------------------------------------------------------------------- | |
36 | ||
37 | class WXDLLIMPEXP_CORE wxGauge: public wxControl | |
38 | { | |
39 | public: | |
40 | wxGauge() { Init(); } | |
41 | ||
42 | wxGauge( wxWindow *parent, | |
43 | wxWindowID id, | |
44 | int range, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | long style = wxGA_HORIZONTAL, | |
48 | const wxValidator& validator = wxDefaultValidator, | |
49 | const wxString& name = wxGaugeNameStr ) | |
50 | { | |
51 | Init(); | |
52 | ||
53 | Create(parent, id, range, pos, size, style, validator, name); | |
54 | } | |
55 | ||
56 | bool Create( wxWindow *parent, | |
57 | wxWindowID id, int range, | |
58 | const wxPoint& pos = wxDefaultPosition, | |
59 | const wxSize& size = wxDefaultSize, | |
60 | long style = wxGA_HORIZONTAL, | |
61 | const wxValidator& validator = wxDefaultValidator, | |
62 | const wxString& name = wxGaugeNameStr ); | |
63 | ||
64 | void SetShadowWidth( int WXUNUSED(w) ) { } | |
65 | void SetBezelFace( int WXUNUSED(w) ) { } | |
66 | void SetRange( int r ); | |
67 | void SetValue( int pos ); | |
68 | int GetShadowWidth() const { return 0; }; | |
69 | int GetBezelFace() const { return 0; }; | |
70 | int GetRange() const; | |
71 | int GetValue() const; | |
72 | ||
73 | bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } | |
74 | ||
75 | static wxVisualAttributes | |
76 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
77 | ||
78 | virtual wxVisualAttributes GetDefaultAttributes() const; | |
79 | ||
80 | // implementation | |
81 | // ------------- | |
82 | ||
83 | // the max and current gauge values | |
84 | int m_rangeMax, | |
85 | m_gaugePos; | |
86 | ||
87 | protected: | |
88 | // common part of all ctors | |
89 | void Init() { m_rangeMax = m_gaugePos = 0; } | |
90 | ||
91 | // set the gauge value to the value of m_gaugePos | |
92 | void DoSetGauge(); | |
93 | ||
94 | virtual wxSize DoGetBestSize() const; | |
95 | ||
96 | private: | |
97 | DECLARE_DYNAMIC_CLASS(wxGauge) | |
98 | }; | |
99 | ||
100 | #endif | |
101 | ||
102 | #endif // __GTKGAUGEH__ |