1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGauge interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1996-2001 wxWidgets team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GAUGE_H_BASE_
13 #define _WX_GAUGE_H_BASE_
19 #include "wx/control.h"
21 // ----------------------------------------------------------------------------
22 // wxGauge style flags
23 // ----------------------------------------------------------------------------
25 #define wxGA_HORIZONTAL wxHORIZONTAL
26 #define wxGA_VERTICAL wxVERTICAL
28 // Win32 only, is default (and only) on some other platforms
29 #define wxGA_SMOOTH 0x0020
31 #if WXWIN_COMPATIBILITY_2_6
33 #define wxGA_PROGRESSBAR 0
34 #endif // WXWIN_COMPATIBILITY_2_6
36 // GTK and Mac always have native implementation of the indeterminate mode
37 // wxMSW has native implementation only if comctl32.dll >= 6.00
38 #if !defined(__WXGTK20__) && !defined(__WXMAC__) && !defined(__WXCOCOA__)
39 #define wxGAUGE_EMULATE_INDETERMINATE_MODE 1
41 #define wxGAUGE_EMULATE_INDETERMINATE_MODE 0
44 extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr
[];
46 // ----------------------------------------------------------------------------
47 // wxGauge: a progress bar
48 // ----------------------------------------------------------------------------
50 class WXDLLIMPEXP_CORE wxGaugeBase
: public wxControl
53 wxGaugeBase() { m_rangeMax
= m_gaugePos
= 0; }
54 virtual ~wxGaugeBase();
56 bool Create(wxWindow
*parent
,
59 const wxPoint
& pos
= wxDefaultPosition
,
60 const wxSize
& size
= wxDefaultSize
,
61 long style
= wxGA_HORIZONTAL
,
62 const wxValidator
& validator
= wxDefaultValidator
,
63 const wxString
& name
= wxGaugeNameStr
);
65 // determinate mode API
67 // set/get the control range
68 virtual void SetRange(int range
);
69 virtual int GetRange() const;
71 virtual void SetValue(int pos
);
72 virtual int GetValue() const;
74 // indeterminate mode API
78 bool IsVertical() const { return HasFlag(wxGA_VERTICAL
); }
80 // appearance params (not implemented for most ports)
81 virtual void SetShadowWidth(int w
);
82 virtual int GetShadowWidth() const;
84 virtual void SetBezelFace(int w
);
85 virtual int GetBezelFace() const;
87 // overridden base class virtuals
88 virtual bool AcceptsFocus() const { return false; }
91 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
96 // the current position
99 #if wxGAUGE_EMULATE_INDETERMINATE_MODE
100 int m_nDirection
; // can be wxRIGHT or wxLEFT
103 wxDECLARE_NO_COPY_CLASS(wxGaugeBase
);
106 #if defined(__WXUNIVERSAL__)
107 #include "wx/univ/gauge.h"
108 #elif defined(__WXMSW__)
109 #include "wx/msw/gauge.h"
110 #elif defined(__WXMOTIF__)
111 #include "wx/motif/gauge.h"
112 #elif defined(__WXGTK20__)
113 #include "wx/gtk/gauge.h"
114 #elif defined(__WXGTK__)
115 #include "wx/gtk1/gauge.h"
116 #elif defined(__WXMAC__)
117 #include "wx/osx/gauge.h"
118 #elif defined(__WXCOCOA__)
119 #include "wx/cocoa/gauge.h"
120 #elif defined(__WXPM__)
121 #include "wx/os2/gauge.h"
124 #endif // wxUSE_GAUGE