]>
Commit | Line | Data |
---|---|---|
1e6feb95 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/gauge.h | |
3 | // Purpose: wxGauge interface | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 20.02.01 | |
7 | // RCS-ID: $Id$ | |
77ffb593 | 8 | // Copyright: (c) 1996-2001 wxWidgets team |
65571936 | 9 | // Licence: wxWindows licence |
1e6feb95 VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_GAUGE_H_BASE_ |
13 | #define _WX_GAUGE_H_BASE_ | |
c801d85f | 14 | |
1e6feb95 VZ |
15 | #include "wx/defs.h" |
16 | ||
17 | #if wxUSE_GAUGE | |
18 | ||
19 | #include "wx/control.h" | |
20 | ||
014c5a64 VZ |
21 | // ---------------------------------------------------------------------------- |
22 | // wxGauge style flags | |
23 | // ---------------------------------------------------------------------------- | |
24 | ||
25 | #define wxGA_HORIZONTAL wxHORIZONTAL | |
26 | #define wxGA_VERTICAL wxVERTICAL | |
27 | ||
28 | // Win32 only, is default (and only) on some other platforms | |
29 | #define wxGA_SMOOTH 0x0020 | |
30 | ||
31 | // obsolete style | |
32 | #define wxGA_PROGRESSBAR 0 | |
33 | ||
34 | ||
63ec432b | 35 | extern WXDLLEXPORT_DATA(const wxChar) wxGaugeNameStr[]; |
1e6feb95 VZ |
36 | |
37 | // ---------------------------------------------------------------------------- | |
38 | // wxGauge: a progress bar | |
39 | // ---------------------------------------------------------------------------- | |
40 | ||
41 | class WXDLLEXPORT wxGaugeBase : public wxControl | |
42 | { | |
43 | public: | |
9446dc26 | 44 | wxGaugeBase() { m_rangeMax = m_gaugePos = 0; } |
799ea011 GD |
45 | virtual ~wxGaugeBase(); |
46 | ||
1e6feb95 VZ |
47 | bool Create(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); | |
55 | ||
56 | // set/get the control range | |
57 | virtual void SetRange(int range); | |
58 | virtual int GetRange() const; | |
59 | ||
60 | // position | |
61 | virtual void SetValue(int pos); | |
62 | virtual int GetValue() const; | |
63 | ||
9446dc26 VZ |
64 | // simple accessors |
65 | bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } | |
66 | ||
1e6feb95 | 67 | |
9446dc26 | 68 | // appearance params (not implemented for most ports) |
1e6feb95 VZ |
69 | virtual void SetShadowWidth(int w); |
70 | virtual int GetShadowWidth() const; | |
71 | ||
72 | virtual void SetBezelFace(int w); | |
73 | virtual int GetBezelFace() const; | |
74 | ||
75 | // overriden base class virtuals | |
5d3e7b52 | 76 | virtual bool AcceptsFocus() const { return false; } |
1e6feb95 VZ |
77 | |
78 | protected: | |
79 | // the max position | |
80 | int m_rangeMax; | |
81 | ||
82 | // the current position | |
83 | int m_gaugePos; | |
fc7a2a60 VZ |
84 | |
85 | DECLARE_NO_COPY_CLASS(wxGaugeBase) | |
1e6feb95 VZ |
86 | }; |
87 | ||
88 | #if defined(__WXUNIVERSAL__) | |
89 | #include "wx/univ/gauge.h" | |
90 | #elif defined(__WXMSW__) | |
1ed64378 WS |
91 | #include "wx/msw/gauge95.h" |
92 | #define wxGauge wxGauge95 | |
2049ba38 | 93 | #elif defined(__WXMOTIF__) |
1e6feb95 | 94 | #include "wx/motif/gauge.h" |
1be7a35c | 95 | #elif defined(__WXGTK20__) |
1e6feb95 | 96 | #include "wx/gtk/gauge.h" |
1be7a35c MR |
97 | #elif defined(__WXGTK__) |
98 | #include "wx/gtk1/gauge.h" | |
34138703 | 99 | #elif defined(__WXMAC__) |
1e6feb95 | 100 | #include "wx/mac/gauge.h" |
24e97652 DE |
101 | #elif defined(__WXCOCOA__) |
102 | #include "wx/cocoa/gauge.h" | |
1777b9bb | 103 | #elif defined(__WXPM__) |
1e6feb95 | 104 | #include "wx/os2/gauge.h" |
c801d85f KB |
105 | #endif |
106 | ||
1e6feb95 VZ |
107 | #endif // wxUSE_GAUGE |
108 | ||
c801d85f | 109 | #endif |
34138703 | 110 | // _WX_GAUGE_H_BASE_ |