]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk1/gauge.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Copyright: (c) 1998 Robert Roebling | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef __GTKGAUGEH__ | |
10 | #define __GTKGAUGEH__ | |
11 | ||
12 | //----------------------------------------------------------------------------- | |
13 | // wxGaugeBox | |
14 | //----------------------------------------------------------------------------- | |
15 | ||
16 | class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase | |
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 | void SetRange( int r ); | |
46 | void SetValue( int pos ); | |
47 | int GetShadowWidth() const { return 0; } | |
48 | int GetBezelFace() const { return 0; } | |
49 | int GetRange() const; | |
50 | int GetValue() const; | |
51 | ||
52 | bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } | |
53 | ||
54 | static wxVisualAttributes | |
55 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
56 | ||
57 | // implementation | |
58 | // ------------- | |
59 | ||
60 | // the max and current gauge values | |
61 | int m_rangeMax, | |
62 | m_gaugePos; | |
63 | ||
64 | protected: | |
65 | // common part of all ctors | |
66 | void Init() { m_rangeMax = m_gaugePos = 0; } | |
67 | ||
68 | // set the gauge value to the value of m_gaugePos | |
69 | void DoSetGauge(); | |
70 | ||
71 | virtual wxSize DoGetBestSize() const; | |
72 | ||
73 | virtual wxVisualAttributes GetDefaultAttributes() const; | |
74 | ||
75 | private: | |
76 | DECLARE_DYNAMIC_CLASS(wxGauge) | |
77 | }; | |
78 | ||
79 | #endif | |
80 | // __GTKGAUGEH__ |