]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_slider.i
Some error recovery and other tweaks
[wxWidgets.git] / wxPython / src / _slider.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _slider.i
3 // Purpose: SWIG interface defs for wxSlider
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 10-June-1998
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17
18 %{
19 #include <wx/slider.h>
20
21 %}
22
23 MAKE_CONST_WXSTRING(SliderNameStr);
24
25 //---------------------------------------------------------------------------
26 %newgroup
27
28 class wxSlider : public wxControl {
29 public:
30 %pythonPrepend wxSlider "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point'];del kwargs['point']"
31 %pythonPrepend wxSlider() ""
32 %pythonAppend wxSlider "self._setOORInfo(self)"
33 %pythonAppend wxSlider() ""
34
35 wxSlider(wxWindow* parent, wxWindowID id,
36 int value, int minValue, int maxValue,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 long style = wxSL_HORIZONTAL,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxPySliderNameStr);
42 %name(PreSlider)wxSlider();
43
44 bool Create(wxWindow* parent, wxWindowID id,
45 int value, int minValue, int maxValue,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxSL_HORIZONTAL,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxPySliderNameStr);
51
52 // get/set the current slider value (should be in range)
53 virtual int GetValue() const;
54 virtual void SetValue(int value);
55
56 // retrieve/change the range
57 virtual void SetRange(int minValue, int maxValue);
58 virtual int GetMin() const;
59 virtual int GetMax() const;
60
61 void SetMin( int minValue );
62 void SetMax( int maxValue );
63
64 // the line/page size is the increment by which the slider moves when
65 // cursor arrow key/page up or down are pressed (clicking the mouse is like
66 // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
67 virtual void SetLineSize(int lineSize);
68 virtual void SetPageSize(int pageSize);
69 virtual int GetLineSize() const;
70 virtual int GetPageSize() const;
71
72 // these methods get/set the length of the slider pointer in pixels
73 virtual void SetThumbLength(int lenPixels);
74 virtual int GetThumbLength() const;
75
76 virtual void SetTickFreq(int n, int pos=1);
77 virtual int GetTickFreq() const;
78 virtual void ClearTicks();
79 virtual void SetTick(int tickPos);
80
81 virtual void ClearSel();
82 virtual int GetSelEnd() const;
83 virtual int GetSelStart() const;
84 virtual void SetSelection(int min, int max);
85
86
87 static wxVisualAttributes
88 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
89 };
90
91 //---------------------------------------------------------------------------