]>
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 | ||
11 | #ifndef __GTKGAUGEH__ | |
12 | #define __GTKGAUGEH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | ||
20 | #if wxUSE_GAUGE | |
21 | ||
22 | #include "wx/object.h" | |
23 | #include "wx/list.h" | |
24 | #include "wx/control.h" | |
25 | ||
26 | //----------------------------------------------------------------------------- | |
27 | // classes | |
28 | //----------------------------------------------------------------------------- | |
29 | ||
30 | class wxGauge; | |
31 | ||
32 | //----------------------------------------------------------------------------- | |
33 | // global data | |
34 | //----------------------------------------------------------------------------- | |
35 | ||
36 | extern const char* wxGaugeNameStr; | |
37 | ||
38 | //----------------------------------------------------------------------------- | |
39 | // wxGaugeBox | |
40 | //----------------------------------------------------------------------------- | |
41 | ||
42 | class wxGauge: public wxControl | |
43 | { | |
44 | DECLARE_DYNAMIC_CLASS(wxGauge) | |
45 | ||
46 | public: | |
47 | inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; } | |
48 | ||
49 | inline wxGauge( wxWindow *parent, wxWindowID id, 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 ) | |
55 | { | |
56 | Create(parent, id, range, pos, size, style, validator, name); | |
57 | } | |
58 | bool Create( wxWindow *parent, wxWindowID id, int range, | |
59 | const wxPoint& pos = wxDefaultPosition, | |
60 | const wxSize& size = wxDefaultSize, | |
61 | long style = wxGA_HORIZONTAL, | |
62 | const wxValidator& validator = wxDefaultValidator, | |
63 | const wxString& name = wxGaugeNameStr ); | |
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 | // Are we a Win95/GTK progress bar, or a normal gauge? | |
74 | inline bool GetProgressBar() const { return m_useProgressBar; } | |
75 | ||
76 | // implementation | |
77 | ||
78 | void ApplyWidgetStyle(); | |
79 | ||
80 | int m_rangeMax; | |
81 | int m_gaugePos; | |
82 | bool m_useProgressBar; | |
83 | }; | |
84 | ||
85 | #endif | |
86 | ||
87 | #endif // __GTKGAUGEH__ |