]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/gauge.h
use wxArrayString instead of wxStringList
[wxWidgets.git] / include / wx / gtk / gauge.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/gauge.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GTK_GAUGE_H_
11 #define _WX_GTK_GAUGE_H_
12
13 //-----------------------------------------------------------------------------
14 // wxGauge
15 //-----------------------------------------------------------------------------
16
17 class WXDLLIMPEXP_CORE wxGauge: public wxControl
18 {
19 public:
20 wxGauge() { Init(); }
21
22 wxGauge( wxWindow *parent,
23 wxWindowID id,
24 int range,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 long style = wxGA_HORIZONTAL,
28 const wxValidator& validator = wxDefaultValidator,
29 const wxString& name = wxGaugeNameStr )
30 {
31 Init();
32
33 Create(parent, id, range, pos, size, style, validator, name);
34 }
35
36 bool Create( wxWindow *parent,
37 wxWindowID id, int range,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxGA_HORIZONTAL,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxGaugeNameStr );
43
44 void SetShadowWidth( int WXUNUSED(w) ) { }
45 void SetBezelFace( int WXUNUSED(w) ) { }
46 int GetShadowWidth() const { return 0; };
47 int GetBezelFace() const { return 0; };
48
49 // determinate mode API
50 void SetRange( int r );
51 void SetValue( int pos );
52
53 int GetRange() const;
54 int GetValue() const;
55
56 // indeterminate mode API
57 virtual void Pulse();
58
59 bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
60
61 static wxVisualAttributes
62 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
63
64 virtual wxVisualAttributes GetDefaultAttributes() const;
65
66 // implementation
67 // -------------
68
69 // the max and current gauge values
70 int m_rangeMax,
71 m_gaugePos;
72
73 protected:
74 // common part of all ctors
75 void Init() { m_rangeMax = m_gaugePos = 0; }
76
77 // set the gauge value to the value of m_gaugePos
78 void DoSetGauge();
79
80 virtual wxSize DoGetBestSize() const;
81
82 private:
83 DECLARE_DYNAMIC_CLASS(wxGauge)
84 };
85
86 #endif
87 // _WX_GTK_GAUGE_H_