wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / univ / gauge.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/gauge.h
3 // Purpose: wxUniversal wxGauge declaration
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 20.02.01
7 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_UNIV_GAUGE_H_
12 #define _WX_UNIV_GAUGE_H_
13
14 // ----------------------------------------------------------------------------
15 // wxGauge: a progress bar
16 // ----------------------------------------------------------------------------
17
18 class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
19 {
20 public:
21 wxGauge() { Init(); }
22
23 wxGauge(wxWindow *parent,
24 wxWindowID id,
25 int range,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
28 long style = wxGA_HORIZONTAL,
29 const wxValidator& validator = wxDefaultValidator,
30 const wxString& name = wxGaugeNameStr)
31 {
32 Init();
33
34 (void)Create(parent, id, range, pos, size, style, validator, name);
35 }
36
37 bool Create(wxWindow *parent,
38 wxWindowID id,
39 int range,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxGA_HORIZONTAL,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxGaugeNameStr);
45
46 // implement base class virtuals
47 virtual void SetRange(int range);
48 virtual void SetValue(int pos);
49
50 // wxUniv-specific methods
51
52 // is it a smooth progress bar or a discrete one?
53 bool IsSmooth() const { return (GetWindowStyle() & wxGA_SMOOTH) != 0; }
54
55 // is it a vertica; progress bar or a horizontal one?
56 bool IsVertical() const { return (GetWindowStyle() & wxGA_VERTICAL) != 0; }
57
58 protected:
59 // common part of all ctors
60 void Init();
61
62 // return the def border for a progress bar
63 virtual wxBorder GetDefaultBorder() const;
64
65 // return the default size
66 virtual wxSize DoGetBestClientSize() const;
67
68 // draw the control
69 virtual void DoDraw(wxControlRenderer *renderer);
70
71 DECLARE_DYNAMIC_CLASS(wxGauge)
72 };
73
74 #endif // _WX_UNIV_GAUGE_H_