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