]>
Commit | Line | Data |
---|---|---|
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 | enum { | |
29 | wxSL_HORIZONTAL, | |
30 | wxSL_VERTICAL, | |
31 | wxSL_TICKS, | |
32 | wxSL_AUTOTICKS, | |
33 | wxSL_LABELS, | |
34 | wxSL_LEFT, | |
35 | wxSL_TOP, | |
36 | wxSL_RIGHT, | |
37 | wxSL_BOTTOM, | |
38 | wxSL_BOTH, | |
39 | wxSL_SELRANGE, | |
40 | wxSL_INVERSE | |
41 | }; | |
42 | ||
43 | ||
44 | MustHaveApp(wxSlider); | |
45 | ||
46 | class wxSlider : public wxControl { | |
47 | public: | |
48 | %pythonPrepend wxSlider "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point'];del kwargs['point']" | |
49 | %pythonPrepend wxSlider() "" | |
50 | %pythonAppend wxSlider "self._setOORInfo(self)" | |
51 | %pythonAppend wxSlider() "" | |
52 | ||
53 | wxSlider(wxWindow* parent, wxWindowID id=-1, | |
54 | int value=0, int minValue=0, int maxValue=100, | |
55 | const wxPoint& pos = wxDefaultPosition, | |
56 | const wxSize& size = wxDefaultSize, | |
57 | long style = wxSL_HORIZONTAL, | |
58 | const wxValidator& validator = wxDefaultValidator, | |
59 | const wxString& name = wxPySliderNameStr); | |
60 | %RenameCtor(PreSlider, wxSlider()); | |
61 | ||
62 | bool Create(wxWindow* parent, wxWindowID id=-1, | |
63 | int value=0, int minValue=0, int maxValue=100, | |
64 | const wxPoint& pos = wxDefaultPosition, | |
65 | const wxSize& size = wxDefaultSize, | |
66 | long style = wxSL_HORIZONTAL, | |
67 | const wxValidator& validator = wxDefaultValidator, | |
68 | const wxString& name = wxPySliderNameStr); | |
69 | ||
70 | // get/set the current slider value (should be in range) | |
71 | virtual int GetValue() const; | |
72 | virtual void SetValue(int value); | |
73 | ||
74 | // retrieve/change the range | |
75 | virtual void SetRange(int minValue, int maxValue); | |
76 | virtual int GetMin() const; | |
77 | virtual int GetMax() const; | |
78 | ||
79 | void SetMin( int minValue ); | |
80 | void SetMax( int maxValue ); | |
81 | ||
82 | // the line/page size is the increment by which the slider moves when | |
83 | // cursor arrow key/page up or down are pressed (clicking the mouse is like | |
84 | // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range | |
85 | virtual void SetLineSize(int lineSize); | |
86 | virtual void SetPageSize(int pageSize); | |
87 | virtual int GetLineSize() const; | |
88 | virtual int GetPageSize() const; | |
89 | ||
90 | // these methods get/set the length of the slider pointer in pixels | |
91 | virtual void SetThumbLength(int lenPixels); | |
92 | virtual int GetThumbLength() const; | |
93 | ||
94 | virtual void SetTickFreq(int n, int pos=1); | |
95 | virtual int GetTickFreq() const; | |
96 | virtual void ClearTicks(); | |
97 | virtual void SetTick(int tickPos); | |
98 | ||
99 | virtual void ClearSel(); | |
100 | virtual int GetSelEnd() const; | |
101 | virtual int GetSelStart() const; | |
102 | virtual void SetSelection(int min, int max); | |
103 | ||
104 | ||
105 | static wxVisualAttributes | |
106 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
107 | ||
108 | %property(LineSize, GetLineSize, SetLineSize, doc="See `GetLineSize` and `SetLineSize`"); | |
109 | %property(Max, GetMax, SetMax, doc="See `GetMax` and `SetMax`"); | |
110 | %property(Min, GetMin, SetMin, doc="See `GetMin` and `SetMin`"); | |
111 | %property(PageSize, GetPageSize, SetPageSize, doc="See `GetPageSize` and `SetPageSize`"); | |
112 | %property(SelEnd, GetSelEnd, doc="See `GetSelEnd`"); | |
113 | %property(SelStart, GetSelStart, doc="See `GetSelStart`"); | |
114 | %property(ThumbLength, GetThumbLength, SetThumbLength, doc="See `GetThumbLength` and `SetThumbLength`"); | |
115 | %property(TickFreq, GetTickFreq, SetTickFreq, doc="See `GetTickFreq` and `SetTickFreq`"); | |
116 | %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`"); | |
117 | }; | |
118 | ||
119 | //--------------------------------------------------------------------------- |