added IsVertical(); initialize members in ctor
[wxWidgets.git] / include / wx / gauge.h
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$
8 // Copyright: (c) 1996-2001 wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GAUGE_H_BASE_
13 #define _WX_GAUGE_H_BASE_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "gaugebase.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #if wxUSE_GAUGE
22
23 #include "wx/control.h"
24
25 WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
26
27 // ----------------------------------------------------------------------------
28 // wxGauge: a progress bar
29 // ----------------------------------------------------------------------------
30
31 class WXDLLEXPORT wxGaugeBase : public wxControl
32 {
33 public:
34 wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
35 virtual ~wxGaugeBase();
36
37 bool Create(wxWindow *parent,
38 wxWindowID id,
39 int range,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxGA_HORIZONTAL,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxGaugeNameStr);
45
46 // set/get the control range
47 virtual void SetRange(int range);
48 virtual int GetRange() const;
49
50 // position
51 virtual void SetValue(int pos);
52 virtual int GetValue() const;
53
54 // simple accessors
55 bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
56
57
58 // appearance params (not implemented for most ports)
59 virtual void SetShadowWidth(int w);
60 virtual int GetShadowWidth() const;
61
62 virtual void SetBezelFace(int w);
63 virtual int GetBezelFace() const;
64
65 // overriden base class virtuals
66 virtual bool AcceptsFocus() const { return FALSE; }
67
68 protected:
69 // the max position
70 int m_rangeMax;
71
72 // the current position
73 int m_gaugePos;
74
75 DECLARE_NO_COPY_CLASS(wxGaugeBase)
76 };
77
78 #if defined(__WXUNIVERSAL__)
79 #include "wx/univ/gauge.h"
80 #elif defined(__WXMSW__)
81 #ifdef __WIN95__
82 #include "wx/msw/gauge95.h"
83 #define wxGauge wxGauge95
84 #define sm_classwxGauge sm_classwxGauge95
85 #else // !__WIN95__
86 // Gauge no longer supported on 16-bit Windows
87 #endif
88 #elif defined(__WXMOTIF__)
89 #include "wx/motif/gauge.h"
90 #elif defined(__WXGTK__)
91 #include "wx/gtk/gauge.h"
92 #elif defined(__WXMAC__)
93 #include "wx/mac/gauge.h"
94 #elif defined(__WXCOCOA__)
95 #include "wx/cocoa/gauge.h"
96 #elif defined(__WXPM__)
97 #include "wx/os2/gauge.h"
98 #endif
99
100 #endif // wxUSE_GAUGE
101
102 #endif
103 // _WX_GAUGE_H_BASE_