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