]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gauge.h
More details about the internal module name changes
[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 // ----------------------------------------------------------------------------
26 // wxGauge style flags
27 // ----------------------------------------------------------------------------
28
29 #define wxGA_HORIZONTAL wxHORIZONTAL
30 #define wxGA_VERTICAL wxVERTICAL
31
32 // Win32 only, is default (and only) on some other platforms
33 #define wxGA_SMOOTH 0x0020
34
35 // obsolete style
36 #define wxGA_PROGRESSBAR 0
37
38
39 WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
40
41 // ----------------------------------------------------------------------------
42 // wxGauge: a progress bar
43 // ----------------------------------------------------------------------------
44
45 class WXDLLEXPORT wxGaugeBase : public wxControl
46 {
47 public:
48 wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
49 virtual ~wxGaugeBase();
50
51 bool Create(wxWindow *parent,
52 wxWindowID id,
53 int range,
54 const wxPoint& pos = wxDefaultPosition,
55 const wxSize& size = wxDefaultSize,
56 long style = wxGA_HORIZONTAL,
57 const wxValidator& validator = wxDefaultValidator,
58 const wxString& name = wxGaugeNameStr);
59
60 // set/get the control range
61 virtual void SetRange(int range);
62 virtual int GetRange() const;
63
64 // position
65 virtual void SetValue(int pos);
66 virtual int GetValue() const;
67
68 // simple accessors
69 bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
70
71
72 // appearance params (not implemented for most ports)
73 virtual void SetShadowWidth(int w);
74 virtual int GetShadowWidth() const;
75
76 virtual void SetBezelFace(int w);
77 virtual int GetBezelFace() const;
78
79 // overriden base class virtuals
80 virtual bool AcceptsFocus() const { return FALSE; }
81
82 protected:
83 // the max position
84 int m_rangeMax;
85
86 // the current position
87 int m_gaugePos;
88
89 DECLARE_NO_COPY_CLASS(wxGaugeBase)
90 };
91
92 #if defined(__WXUNIVERSAL__)
93 #include "wx/univ/gauge.h"
94 #elif defined(__WXMSW__)
95 #ifdef __WIN95__
96 #include "wx/msw/gauge95.h"
97 #define wxGauge wxGauge95
98 #else // !__WIN95__
99 // Gauge no longer supported on 16-bit Windows
100 #endif
101 #elif defined(__WXMOTIF__)
102 #include "wx/motif/gauge.h"
103 #elif defined(__WXGTK__)
104 #include "wx/gtk/gauge.h"
105 #elif defined(__WXMAC__)
106 #include "wx/mac/gauge.h"
107 #elif defined(__WXCOCOA__)
108 #include "wx/cocoa/gauge.h"
109 #elif defined(__WXPM__)
110 #include "wx/os2/gauge.h"
111 #endif
112
113 #endif // wxUSE_GAUGE
114
115 #endif
116 // _WX_GAUGE_H_BASE_