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