]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
1b88201f | 2 | // Name: wx/gtk/gauge.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Copyright: (c) 1998 Robert Roebling |
1b88201f | 6 | // Licence: wxWindows licence |
c801d85f KB |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
0416c418 PC |
9 | #ifndef _WX_GTK_GAUGE_H_ |
10 | #define _WX_GTK_GAUGE_H_ | |
1a56f55c | 11 | |
c801d85f | 12 | //----------------------------------------------------------------------------- |
0416c418 | 13 | // wxGauge |
c801d85f KB |
14 | //----------------------------------------------------------------------------- |
15 | ||
20123d49 | 16 | class WXDLLIMPEXP_CORE wxGauge: public wxControl |
1a56f55c | 17 | { |
20e05ffb | 18 | public: |
2b5f62a0 VZ |
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 ) | |
6de97a3b | 29 | { |
2b5f62a0 VZ |
30 | Init(); |
31 | ||
32 | Create(parent, id, range, pos, size, style, validator, name); | |
6de97a3b | 33 | } |
2b5f62a0 VZ |
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) ) { } | |
6dd0883d SN |
45 | int GetShadowWidth() const { return 0; } |
46 | int GetBezelFace() const { return 0; } | |
fe8635a7 RR |
47 | |
48 | // determinate mode API | |
49 | void SetRange( int r ); | |
50 | void SetValue( int pos ); | |
51 | ||
36b3b54a RR |
52 | int GetRange() const; |
53 | int GetValue() const; | |
6de97a3b | 54 | |
fe8635a7 RR |
55 | // indeterminate mode API |
56 | virtual void Pulse(); | |
57 | ||
e04fe03d | 58 | bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } |
1b88201f | 59 | |
9d522606 RD |
60 | static wxVisualAttributes |
61 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
6f02a879 VZ |
62 | |
63 | virtual wxVisualAttributes GetDefaultAttributes() const; | |
1b88201f | 64 | |
20e05ffb RR |
65 | // implementation |
66 | // ------------- | |
2b5f62a0 | 67 | |
2b5f62a0 VZ |
68 | // the max and current gauge values |
69 | int m_rangeMax, | |
70 | m_gaugePos; | |
71 | ||
2b5f62a0 | 72 | protected: |
2b5f62a0 VZ |
73 | // set the gauge value to the value of m_gaugePos |
74 | void DoSetGauge(); | |
75 | ||
3a12cb0a RD |
76 | virtual wxSize DoGetBestSize() const; |
77 | ||
20e05ffb | 78 | private: |
95dc31e0 PC |
79 | void Init() { m_rangeMax = m_gaugePos = 0; } |
80 | ||
20e05ffb | 81 | DECLARE_DYNAMIC_CLASS(wxGauge) |
1a56f55c RR |
82 | }; |
83 | ||
1b88201f WS |
84 | #endif |
85 | // _WX_GTK_GAUGE_H_ |