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