1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGauge interface
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 1996-2001 wxWidgets team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GAUGE_H_BASE_
12 #define _WX_GAUGE_H_BASE_
18 #include "wx/control.h"
20 // ----------------------------------------------------------------------------
21 // wxGauge style flags
22 // ----------------------------------------------------------------------------
24 #define wxGA_HORIZONTAL wxHORIZONTAL
25 #define wxGA_VERTICAL wxVERTICAL
27 // Win32 only, is default (and only) on some other platforms
28 #define wxGA_SMOOTH 0x0020
30 #if WXWIN_COMPATIBILITY_2_6
32 #define wxGA_PROGRESSBAR 0
33 #endif // WXWIN_COMPATIBILITY_2_6
35 // GTK and Mac always have native implementation of the indeterminate mode
36 // wxMSW has native implementation only if comctl32.dll >= 6.00
37 #if !defined(__WXGTK20__) && !defined(__WXMAC__) && !defined(__WXCOCOA__)
38 #define wxGAUGE_EMULATE_INDETERMINATE_MODE 1
40 #define wxGAUGE_EMULATE_INDETERMINATE_MODE 0
43 extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr
[];
45 // ----------------------------------------------------------------------------
46 // wxGauge: a progress bar
47 // ----------------------------------------------------------------------------
49 class WXDLLIMPEXP_CORE wxGaugeBase
: public wxControl
52 wxGaugeBase() { m_rangeMax
= m_gaugePos
= 0; }
53 virtual ~wxGaugeBase();
55 bool Create(wxWindow
*parent
,
58 const wxPoint
& pos
= wxDefaultPosition
,
59 const wxSize
& size
= wxDefaultSize
,
60 long style
= wxGA_HORIZONTAL
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxGaugeNameStr
);
64 // determinate mode API
66 // set/get the control range
67 virtual void SetRange(int range
);
68 virtual int GetRange() const;
70 virtual void SetValue(int pos
);
71 virtual int GetValue() const;
73 // indeterminate mode API
77 bool IsVertical() const { return HasFlag(wxGA_VERTICAL
); }
79 // appearance params (not implemented for most ports)
80 virtual void SetShadowWidth(int w
);
81 virtual int GetShadowWidth() const;
83 virtual void SetBezelFace(int w
);
84 virtual int GetBezelFace() const;
86 // overridden base class virtuals
87 virtual bool AcceptsFocus() const { return false; }
90 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
95 // the current position
98 #if wxGAUGE_EMULATE_INDETERMINATE_MODE
99 int m_nDirection
; // can be wxRIGHT or wxLEFT
102 wxDECLARE_NO_COPY_CLASS(wxGaugeBase
);
105 #if defined(__WXUNIVERSAL__)
106 #include "wx/univ/gauge.h"
107 #elif defined(__WXMSW__)
108 #include "wx/msw/gauge.h"
109 #elif defined(__WXMOTIF__)
110 #include "wx/motif/gauge.h"
111 #elif defined(__WXGTK20__)
112 #include "wx/gtk/gauge.h"
113 #elif defined(__WXGTK__)
114 #include "wx/gtk1/gauge.h"
115 #elif defined(__WXMAC__)
116 #include "wx/osx/gauge.h"
117 #elif defined(__WXCOCOA__)
118 #include "wx/cocoa/gauge.h"
119 #elif defined(__WXPM__)
120 #include "wx/os2/gauge.h"
123 #endif // wxUSE_GAUGE