]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gauge.h
Export the event types.
[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 wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GAUGE_H_BASE_
13 #define _WX_GAUGE_H_BASE_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_GAUGE
18
19 #include "wx/control.h"
20
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 #if WXWIN_COMPATIBILITY_2_6
32 // obsolete style
33 #define wxGA_PROGRESSBAR 0
34 #endif // WXWIN_COMPATIBILITY_2_6
35
36
37 extern WXDLLEXPORT_DATA(const wxChar) wxGaugeNameStr[];
38
39 // ----------------------------------------------------------------------------
40 // wxGauge: a progress bar
41 // ----------------------------------------------------------------------------
42
43 class WXDLLEXPORT wxGaugeBase : public wxControl
44 {
45 public:
46 wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
47 virtual ~wxGaugeBase();
48
49 bool Create(wxWindow *parent,
50 wxWindowID id,
51 int range,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize,
54 long style = wxGA_HORIZONTAL,
55 const wxValidator& validator = wxDefaultValidator,
56 const wxString& name = wxGaugeNameStr);
57
58 // set/get the control range
59 virtual void SetRange(int range);
60 virtual int GetRange() const;
61
62 // position
63 virtual void SetValue(int pos);
64 virtual int GetValue() const;
65
66 // simple accessors
67 bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
68
69
70 // appearance params (not implemented for most ports)
71 virtual void SetShadowWidth(int w);
72 virtual int GetShadowWidth() const;
73
74 virtual void SetBezelFace(int w);
75 virtual int GetBezelFace() const;
76
77 // overriden base class virtuals
78 virtual bool AcceptsFocus() const { return false; }
79
80 protected:
81 // the max position
82 int m_rangeMax;
83
84 // the current position
85 int m_gaugePos;
86
87 DECLARE_NO_COPY_CLASS(wxGaugeBase)
88 };
89
90 #if defined(__WXUNIVERSAL__)
91 #include "wx/univ/gauge.h"
92 #elif defined(__WXMSW__)
93 #include "wx/msw/gauge95.h"
94 #define wxGauge wxGauge95
95 #elif defined(__WXMOTIF__)
96 #include "wx/motif/gauge.h"
97 #elif defined(__WXGTK20__)
98 #include "wx/gtk/gauge.h"
99 #elif defined(__WXGTK__)
100 #include "wx/gtk1/gauge.h"
101 #elif defined(__WXMAC__)
102 #include "wx/mac/gauge.h"
103 #elif defined(__WXCOCOA__)
104 #include "wx/cocoa/gauge.h"
105 #elif defined(__WXPM__)
106 #include "wx/os2/gauge.h"
107 #endif
108
109 #endif // wxUSE_GAUGE
110
111 #endif
112 // _WX_GAUGE_H_BASE_