1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11%ModuleHeaderCode
12#include <wx/spinctrl.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18wxEventType wxEVT_SPINCTRL   /PyName=wxEVT_SPINCTRL/;
19
20wxEventType wxEVT_SPINCTRLDOUBLE   /PyName=wxEVT_SPINCTRLDOUBLE/;
21
22class wxSpinCtrl : wxControl
23{
24    %Docstring
25        SpinCtrl()
26        SpinCtrl(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, name="wxSpinCtrl")
27
28        wxSpinCtrl combines wxTextCtrl and wxSpinButton in one control.
29    %End
30    %TypeHeaderCode
31        #include <wx/spinctrl.h>
32    %End
33
34public:
35    wxSpinCtrl();
36    %PreMethodCode
37        if (!wxPyCheckForApp()) return NULL;
38    %End
39
40    wxSpinCtrl(
41        wxWindow * parent   /TransferThis/,
42        wxWindowID id = wxID_ANY,
43        const wxString & value = wxEmptyString,
44        const wxPoint & pos = wxDefaultPosition,
45        const wxSize & size = wxDefaultSize,
46        long style = wxSP_ARROW_KEYS,
47        int min = 0,
48        int max = 100,
49        int initial = 0,
50        const wxString & name = "wxSpinCtrl"
51    );
52    %PreMethodCode
53        if (!wxPyCheckForApp()) return NULL;
54    %End
55
56    bool Create(
57        wxWindow * parent   /TransferThis/,
58        wxWindowID id = wxID_ANY,
59        const wxString & value = wxEmptyString,
60        const wxPoint & pos = wxDefaultPosition,
61        const wxSize & size = wxDefaultSize,
62        long style = wxSP_ARROW_KEYS,
63        int min = 0,
64        int max = 100,
65        int initial = 0,
66        const wxString & name = "wxSpinCtrl"
67    );
68    %Docstring
69        Create(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, name="wxSpinCtrl") -> bool
70
71        Creation function called by the spin control constructor.
72    %End
73
74    int GetBase() const;
75    %Docstring
76        GetBase() -> int
77
78        Returns the numerical base being currently used, 10 by default.
79    %End
80
81    int GetMax() const;
82    %Docstring
83        GetMax() -> int
84
85        Gets maximal allowable value.
86    %End
87
88    int GetMin() const;
89    %Docstring
90        GetMin() -> int
91
92        Gets minimal allowable value.
93    %End
94
95    int GetValue() const;
96    %Docstring
97        GetValue() -> int
98
99        Gets the value of the spin control.
100    %End
101
102    bool SetBase(
103        int base
104    );
105    %Docstring
106        SetBase(base) -> bool
107
108        Sets the base to use for the numbers in this control.
109    %End
110
111    void SetRange(
112        int minVal,
113        int maxVal
114    );
115    %Docstring
116        SetRange(minVal, maxVal)
117
118        Sets range of allowable values.
119    %End
120
121    void SetSelection(
122        long from_,
123        long to_
124    );
125    %Docstring
126        SetSelection(from_, to_)
127
128        Select the text in the text part of the control between positions from
129        (inclusive) and to (exclusive).
130    %End
131
132    void SetValue(
133        const wxString & text
134    );
135    %Docstring
136        SetValue(text)
137        SetValue(value)
138
139        Sets the value of the spin control.
140    %End
141
142    void SetValue(
143        int value
144    );
145
146    public:
147    virtual wxPoint GetClientAreaOrigin() const;
148    virtual bool Validate();
149    virtual bool TransferDataToWindow();
150    virtual bool TransferDataFromWindow();
151    virtual void InitDialog();
152    virtual bool AcceptsFocus() const;
153    virtual bool AcceptsFocusRecursively() const;
154    virtual bool AcceptsFocusFromKeyboard() const;
155    virtual void AddChild( wxWindowBase *child );
156    virtual void RemoveChild( wxWindowBase *child );
157    virtual void InheritAttributes();
158    virtual bool ShouldInheritColours() const;
159    virtual void OnInternalIdle();
160    virtual wxWindow *GetMainWindowOfCompositeControl();
161    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
162    virtual void SetCanFocus(bool canFocus);
163    virtual bool Destroy();
164    virtual void SetValidator( const wxValidator &validator );
165    virtual wxValidator* GetValidator();
166
167
168    protected:
169    virtual bool ProcessEvent(wxEvent & event);
170    virtual void DoEnable(bool enable);
171    virtual void DoGetPosition(int *x, int *y) const;
172    virtual void DoGetSize(int *width, int *height) const;
173    virtual void DoGetClientSize(int *width, int *height) const;
174    virtual wxSize DoGetBestSize() const;
175    virtual wxSize DoGetBestClientSize() const;
176    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
177    virtual void DoSetClientSize(int width, int height);
178    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
179    virtual wxSize DoGetBorderSize() const;
180    virtual void DoMoveWindow(int x, int y, int width, int height);
181    virtual void DoSetWindowVariant( wxWindowVariant variant);
182    virtual wxBorder GetDefaultBorder() const;
183    virtual wxBorder GetDefaultBorderForControl() const;
184    virtual void DoFreeze();
185    virtual void DoThaw();
186    virtual bool HasTransparentBackground();
187    virtual bool TryBefore(wxEvent& event);
188    virtual bool TryAfter(wxEvent& event);
189
190
191    public:
192
193
194    static
195    wxVisualAttributes GetClassDefaultAttributes(
196        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
197    );
198    %Docstring
199        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
200    %End
201    %PreMethodCode
202        if (!wxPyCheckForApp()) return NULL;
203    %End
204
205    public:
206
207
208    %Property(name=Base, get=GetBase, set=SetBase)
209    %Property(name=Value, get=GetValue, set=SetValue)
210};  // end of class wxSpinCtrl
211
212
213%Extract(id=pycode_core)
214def _SpinCtrl_GetRange(self):
215    return (self.GetMin(), self.GetMax())
216SpinCtrl.GetRange = _SpinCtrl_GetRange
217del _SpinCtrl_GetRange
218%End
219
220%Extract(id=pycode_core)
221def _SpinCtrl_SetMin(self, minVal):
222    self.SetRange(minVal, self.GetMax())
223SpinCtrl.SetMin = _SpinCtrl_SetMin
224del _SpinCtrl_SetMin
225%End
226
227%Extract(id=pycode_core)
228def _SpinCtrl_SetMax(self, maxVal):
229    self.SetRange(self.GetMin(), maxVal)
230SpinCtrl.SetMax = _SpinCtrl_SetMax
231del _SpinCtrl_SetMax
232%End
233
234%Extract(id=pycode_core)
235SpinCtrl.Max = property(SpinCtrl.GetMax, SpinCtrl.SetMax)
236%End
237
238%Extract(id=pycode_core)
239SpinCtrl.Min = property(SpinCtrl.GetMin, SpinCtrl.SetMin)
240%End
241
242%Extract(id=pycode_core)
243SpinCtrl.Range = property(SpinCtrl.GetRange)
244%End
245
246class wxSpinCtrlDouble : wxControl
247{
248    %Docstring
249        SpinCtrlDouble()
250        SpinCtrlDouble(parent, id=-1, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, inc=1, name=T("wxSpinCtrlDouble"))
251
252        wxSpinCtrlDouble combines wxTextCtrl and wxSpinButton in one control
253        and displays a real number.
254    %End
255    %TypeHeaderCode
256        #include <wx/spinctrl.h>
257    %End
258
259public:
260    wxSpinCtrlDouble();
261    %PreMethodCode
262        if (!wxPyCheckForApp()) return NULL;
263    %End
264
265    wxSpinCtrlDouble(
266        wxWindow * parent   /TransferThis/,
267        wxWindowID id = -1,
268        const wxString & value = wxEmptyString,
269        const wxPoint & pos = wxDefaultPosition,
270        const wxSize & size = wxDefaultSize,
271        long style = wxSP_ARROW_KEYS,
272        double min = 0,
273        double max = 100,
274        double initial = 0,
275        double inc = 1,
276        const wxString & name = wxT("wxSpinCtrlDouble")
277    );
278    %PreMethodCode
279        if (!wxPyCheckForApp()) return NULL;
280    %End
281
282    bool Create(
283        wxWindow * parent   /TransferThis/,
284        wxWindowID id = wxID_ANY,
285        const wxString & value = wxEmptyString,
286        const wxPoint & pos = wxDefaultPosition,
287        const wxSize & size = wxDefaultSize,
288        long style = wxSP_ARROW_KEYS,
289        double min = 0,
290        double max = 100,
291        double initial = 0,
292        double inc = 1,
293        const wxString & name = "wxSpinCtrlDouble"
294    );
295    %Docstring
296        Create(parent, id=ID_ANY, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, inc=1, name="wxSpinCtrlDouble") -> bool
297
298        Creation function called by the spin control constructor.
299    %End
300
301    unsigned int GetDigits() const;
302    %Docstring
303        GetDigits() -> unsignedint
304
305        Gets the number of digits in the display.
306    %End
307
308    double GetIncrement() const;
309    %Docstring
310        GetIncrement() -> double
311
312        Gets the increment value.
313    %End
314
315    double GetMax() const;
316    %Docstring
317        GetMax() -> double
318
319        Gets maximal allowable value.
320    %End
321
322    double GetMin() const;
323    %Docstring
324        GetMin() -> double
325
326        Gets minimal allowable value.
327    %End
328
329    double GetValue() const;
330    %Docstring
331        GetValue() -> double
332
333        Gets the value of the spin control.
334    %End
335
336    void SetDigits(
337        unsigned int digits
338    );
339    %Docstring
340        SetDigits(digits)
341
342        Sets the number of digits in the display.
343    %End
344
345    void SetIncrement(
346        double inc
347    );
348    %Docstring
349        SetIncrement(inc)
350
351        Sets the increment value.
352    %End
353
354    void SetRange(
355        double minVal,
356        double maxVal
357    );
358    %Docstring
359        SetRange(minVal, maxVal)
360
361        Sets range of allowable values.
362    %End
363
364    void SetValue(
365        const wxString & text
366    );
367    %Docstring
368        SetValue(text)
369        SetValue(value)
370
371        Sets the value of the spin control.
372    %End
373
374    void SetValue(
375        double value
376    );
377
378    public:
379    virtual wxPoint GetClientAreaOrigin() const;
380    virtual bool Validate();
381    virtual bool TransferDataToWindow();
382    virtual bool TransferDataFromWindow();
383    virtual void InitDialog();
384    virtual bool AcceptsFocus() const;
385    virtual bool AcceptsFocusRecursively() const;
386    virtual bool AcceptsFocusFromKeyboard() const;
387    virtual void AddChild( wxWindowBase *child );
388    virtual void RemoveChild( wxWindowBase *child );
389    virtual void InheritAttributes();
390    virtual bool ShouldInheritColours() const;
391    virtual void OnInternalIdle();
392    virtual wxWindow *GetMainWindowOfCompositeControl();
393    virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
394    virtual void SetCanFocus(bool canFocus);
395    virtual bool Destroy();
396    virtual void SetValidator( const wxValidator &validator );
397    virtual wxValidator* GetValidator();
398
399
400    protected:
401    virtual bool ProcessEvent(wxEvent & event);
402    virtual void DoEnable(bool enable);
403    virtual void DoGetPosition(int *x, int *y) const;
404    virtual void DoGetSize(int *width, int *height) const;
405    virtual void DoGetClientSize(int *width, int *height) const;
406    virtual wxSize DoGetBestSize() const;
407    virtual wxSize DoGetBestClientSize() const;
408    virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
409    virtual void DoSetClientSize(int width, int height);
410    virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH );
411    virtual wxSize DoGetBorderSize() const;
412    virtual void DoMoveWindow(int x, int y, int width, int height);
413    virtual void DoSetWindowVariant( wxWindowVariant variant);
414    virtual wxBorder GetDefaultBorder() const;
415    virtual wxBorder GetDefaultBorderForControl() const;
416    virtual void DoFreeze();
417    virtual void DoThaw();
418    virtual bool HasTransparentBackground();
419    virtual bool TryBefore(wxEvent& event);
420    virtual bool TryAfter(wxEvent& event);
421
422
423    public:
424
425
426    static
427    wxVisualAttributes GetClassDefaultAttributes(
428        wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL
429    );
430    %Docstring
431        GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
432    %End
433    %PreMethodCode
434        if (!wxPyCheckForApp()) return NULL;
435    %End
436
437    public:
438
439
440    %Property(name=Digits, get=GetDigits, set=SetDigits)
441    %Property(name=Increment, get=GetIncrement, set=SetIncrement)
442    %Property(name=Value, get=GetValue, set=SetValue)
443};  // end of class wxSpinCtrlDouble
444
445
446%Extract(id=pycode_core)
447def _SpinCtrlDouble_GetRange(self):
448    return (self.GetMin(), self.GetMax())
449SpinCtrlDouble.GetRange = _SpinCtrlDouble_GetRange
450del _SpinCtrlDouble_GetRange
451%End
452
453%Extract(id=pycode_core)
454def _SpinCtrlDouble_SetMin(self, minVal):
455    self.SetRange(minVal, self.GetMax())
456SpinCtrlDouble.SetMin = _SpinCtrlDouble_SetMin
457del _SpinCtrlDouble_SetMin
458%End
459
460%Extract(id=pycode_core)
461def _SpinCtrlDouble_SetMax(self, maxVal):
462    self.SetRange(self.GetMin(), maxVal)
463SpinCtrlDouble.SetMax = _SpinCtrlDouble_SetMax
464del _SpinCtrlDouble_SetMax
465%End
466
467%Extract(id=pycode_core)
468SpinCtrlDouble.Max = property(SpinCtrlDouble.GetMax, SpinCtrlDouble.SetMax)
469%End
470
471%Extract(id=pycode_core)
472SpinCtrlDouble.Min = property(SpinCtrlDouble.GetMin, SpinCtrlDouble.SetMin)
473%End
474
475%Extract(id=pycode_core)
476SpinCtrlDouble.Range = property(SpinCtrlDouble.GetRange)
477%End
478
479class wxSpinDoubleEvent : wxNotifyEvent
480{
481    %Docstring
482        SpinDoubleEvent(commandType=wxEVT_NULL, winid=0, value=0)
483        SpinDoubleEvent(event)
484
485        This event class is used for the events generated by wxSpinCtrlDouble.
486    %End
487    %TypeHeaderCode
488        #include <wx/spinctrl.h>
489    %End
490
491public:
492    wxSpinDoubleEvent(
493        wxEventType commandType = wxEVT_NULL,
494        int winid = 0,
495        double value = 0
496    );
497
498    wxSpinDoubleEvent(
499        const wxSpinDoubleEvent & event
500    );
501
502    double GetValue() const;
503    %Docstring
504        GetValue() -> double
505
506        Returns the value associated with this spin control event.
507    %End
508
509    void SetValue(
510        double value
511    );
512    %Docstring
513        SetValue(value)
514
515        Set the value associated with the event.
516    %End
517
518    public:
519    virtual wxEvent* Clone() const /Factory/;
520
521
522    private:
523        wxSpinDoubleEvent& operator=(const wxSpinDoubleEvent&);
524
525
526    public:
527
528
529    %Property(name=Value, get=GetValue, set=SetValue)
530};  // end of class wxSpinDoubleEvent
531
532
533%Extract(id=pycode_core)
534EVT_SPINCTRL = wx.PyEventBinder( wxEVT_SPINCTRL, 1)
535EVT_SPINCTRLDOUBLE = wx.PyEventBinder( wxEVT_SPINCTRLDOUBLE, 1)
536
537# deprecated wxEVT aliases
538wxEVT_COMMAND_SPINCTRL_UPDATED        = wxEVT_SPINCTRL
539wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED  = wxEVT_SPINCTRLDOUBLE
540
541%End
542
543
544//---------------------------------------------------------------------------
545
546