]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gauge.h
Use an enum for the colour/string conversion flags
[wxWidgets.git] / include / wx / gauge.h
CommitLineData
1e6feb95
VZ
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$
77ffb593 8// Copyright: (c) 1996-2001 wxWidgets team
65571936 9// Licence: wxWindows licence
1e6feb95
VZ
10///////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_GAUGE_H_BASE_
13#define _WX_GAUGE_H_BASE_
c801d85f 14
1e6feb95
VZ
15#include "wx/defs.h"
16
17#if wxUSE_GAUGE
18
19#include "wx/control.h"
20
014c5a64
VZ
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
40ff126a
WS
31#if WXWIN_COMPATIBILITY_2_6
32 // obsolete style
33 #define wxGA_PROGRESSBAR 0
34#endif // WXWIN_COMPATIBILITY_2_6
014c5a64 35
fe8635a7
RR
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
40#else
41 #define wxGAUGE_EMULATE_INDETERMINATE_MODE 0
42#endif
014c5a64 43
53a2db12 44extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
1e6feb95
VZ
45
46// ----------------------------------------------------------------------------
47// wxGauge: a progress bar
48// ----------------------------------------------------------------------------
49
53a2db12 50class WXDLLIMPEXP_CORE wxGaugeBase : public wxControl
1e6feb95
VZ
51{
52public:
9446dc26 53 wxGaugeBase() { m_rangeMax = m_gaugePos = 0; }
799ea011
GD
54 virtual ~wxGaugeBase();
55
1e6feb95
VZ
56 bool Create(wxWindow *parent,
57 wxWindowID id,
58 int range,
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);
64
fe8635a7
RR
65 // determinate mode API
66
1e6feb95
VZ
67 // set/get the control range
68 virtual void SetRange(int range);
69 virtual int GetRange() const;
70
1e6feb95
VZ
71 virtual void SetValue(int pos);
72 virtual int GetValue() const;
73
fe8635a7
RR
74 // indeterminate mode API
75 virtual void Pulse();
76
9446dc26
VZ
77 // simple accessors
78 bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
79
9446dc26 80 // appearance params (not implemented for most ports)
1e6feb95
VZ
81 virtual void SetShadowWidth(int w);
82 virtual int GetShadowWidth() const;
83
84 virtual void SetBezelFace(int w);
85 virtual int GetBezelFace() const;
86
87 // overriden base class virtuals
5d3e7b52 88 virtual bool AcceptsFocus() const { return false; }
1e6feb95
VZ
89
90protected:
dc797d8e
JS
91 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
92
1e6feb95
VZ
93 // the max position
94 int m_rangeMax;
95
96 // the current position
97 int m_gaugePos;
fc7a2a60 98
fe8635a7
RR
99#if wxGAUGE_EMULATE_INDETERMINATE_MODE
100 int m_nDirection; // can be wxRIGHT or wxLEFT
101#endif
102
c0c133e1 103 wxDECLARE_NO_COPY_CLASS(wxGaugeBase);
1e6feb95
VZ
104};
105
106#if defined(__WXUNIVERSAL__)
107 #include "wx/univ/gauge.h"
108#elif defined(__WXMSW__)
936f6353 109 #include "wx/msw/gauge.h"
2049ba38 110#elif defined(__WXMOTIF__)
1e6feb95 111 #include "wx/motif/gauge.h"
1be7a35c 112#elif defined(__WXGTK20__)
1e6feb95 113 #include "wx/gtk/gauge.h"
1be7a35c
MR
114#elif defined(__WXGTK__)
115 #include "wx/gtk1/gauge.h"
34138703 116#elif defined(__WXMAC__)
ef0e9220 117 #include "wx/osx/gauge.h"
24e97652
DE
118#elif defined(__WXCOCOA__)
119 #include "wx/cocoa/gauge.h"
1777b9bb 120#elif defined(__WXPM__)
1e6feb95 121 #include "wx/os2/gauge.h"
c801d85f
KB
122#endif
123
1e6feb95
VZ
124#endif // wxUSE_GAUGE
125
c801d85f 126#endif
34138703 127 // _WX_GAUGE_H_BASE_