]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/controls.i
Added typemap for wxArrayString
[wxWidgets.git] / wxPython / src / controls.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: controls.i
3 // Purpose: Control (widget) classes for wxPython
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 6/10/98
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module controls
14
15 %{
16 #include "helpers.h"
17 #include <wx/slider.h>
18 #include <wx/spinbutt.h>
19 #include <wx/spinctrl.h>
20 #include <wx/dynarray.h>
21 #include <wx/statline.h>
22 #include <wx/tglbtn.h>
23
24 #ifdef __WXMSW__
25 #if wxUSE_OWNER_DRAWN
26 #include <wx/checklst.h>
27 #endif
28 #endif
29
30 #ifdef __WXGTK__
31 #include <wx/checklst.h>
32 #endif
33
34 %}
35
36 //----------------------------------------------------------------------
37
38 %include typemaps.i
39 %include my_typemaps.i
40
41 // Import some definitions of other classes, etc.
42 %import _defs.i
43 %import misc.i
44 %import windows.i
45 %import gdi.i
46 %import events.i
47
48 %pragma(python) code = "import wx"
49
50 //----------------------------------------------------------------------
51
52 %readonly
53 wxValidator wxDefaultValidator;
54 %readwrite
55
56 //----------------------------------------------------------------------
57
58 class wxControl : public wxWindow {
59 public:
60 wxControl(wxWindow *parent,
61 wxWindowID id,
62 const wxPoint& pos=wxDefaultPosition,
63 const wxSize& size=wxDefaultSize,
64 long style=0,
65 const wxValidator& validator=wxDefaultValidator,
66 const char* name="control");
67 %name(wxPreControl)wxControl();
68
69 bool Create(wxWindow *parent,
70 wxWindowID id,
71 const wxPoint& pos=wxDefaultPosition,
72 const wxSize& size=wxDefaultSize,
73 long style=0,
74 const wxValidator& validator=wxDefaultValidator,
75 const char* name="control");
76
77 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
78 %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)"
79
80 void Command(wxCommandEvent& event);
81 wxString GetLabel();
82 void SetLabel(const wxString& label);
83 };
84
85
86 //----------------------------------------------------------------------
87
88
89 class wxControlWithItems : public wxControl {
90 public:
91
92 // void Clear(); ambiguous, redefine below...
93 void Delete(int n);
94
95 int GetCount();
96 %pragma(python) addtoclass = "Number = GetCount"
97 wxString GetString(int n);
98 void SetString(int n, const wxString& s);
99 int FindString(const wxString& s);
100
101 void Select(int n);
102 int GetSelection();
103
104 wxString GetStringSelection() const;
105
106 // void Append(const wxString& item);
107 // void Append(const wxString& item, char* clientData);
108 // char* GetClientData(const int n);
109 // void SetClientData(const int n, char* data);
110 %addmethods {
111 void Append(const wxString& item, PyObject* clientData=NULL) {
112 if (clientData) {
113 wxPyClientData* data = new wxPyClientData(clientData);
114 self->Append(item, data);
115 } else
116 self->Append(item);
117 }
118
119 PyObject* GetClientData(int n) {
120 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
121 if (data) {
122 Py_INCREF(data->m_obj);
123 return data->m_obj;
124 } else {
125 Py_INCREF(Py_None);
126 return Py_None;
127 }
128 }
129
130 void SetClientData(int n, PyObject* clientData) {
131 wxPyClientData* data = new wxPyClientData(clientData);
132 self->SetClientObject(n, data);
133 }
134 }
135
136 };
137 //----------------------------------------------------------------------
138
139 class wxButton : public wxControl {
140 public:
141 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
142 const wxPoint& pos = wxDefaultPosition,
143 const wxSize& size = wxDefaultSize,
144 long style = 0,
145 const wxValidator& validator = wxDefaultValidator,
146 char* name = "button");
147 %name(wxPreButton)wxButton();
148
149 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
150 const wxPoint& pos = wxDefaultPosition,
151 const wxSize& size = wxDefaultSize,
152 long style = 0,
153 const wxValidator& validator = wxDefaultValidator,
154 char* name = "button");
155
156 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
157 %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)"
158
159 void SetDefault();
160 void SetBackgroundColour(const wxColour& colour);
161 void SetForegroundColour(const wxColour& colour);
162 #ifdef __WXMSW__
163 void SetImageLabel(const wxBitmap& bitmap);
164 void SetImageMargins(wxCoord x, wxCoord y);
165 #endif
166 static wxSize GetDefaultSize();
167 };
168
169 //----------------------------------------------------------------------
170
171 class wxBitmapButton : public wxButton {
172 public:
173 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
174 const wxPoint& pos = wxDefaultPosition,
175 const wxSize& size = wxDefaultSize,
176 long style = wxBU_AUTODRAW,
177 const wxValidator& validator = wxDefaultValidator,
178 char* name = "button");
179 %name(wxPreBitmapButton)wxBitmapButton();
180
181 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
182 const wxPoint& pos = wxDefaultPosition,
183 const wxSize& size = wxDefaultSize,
184 long style = wxBU_AUTODRAW,
185 const wxValidator& validator = wxDefaultValidator,
186 char* name = "button");
187
188 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
189 %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
190
191 wxBitmap& GetBitmapLabel();
192 wxBitmap& GetBitmapDisabled();
193 wxBitmap& GetBitmapFocus();
194 wxBitmap& GetBitmapSelected();
195 void SetBitmapDisabled(const wxBitmap& bitmap);
196 void SetBitmapFocus(const wxBitmap& bitmap);
197 void SetBitmapSelected(const wxBitmap& bitmap);
198 void SetBitmapLabel(const wxBitmap& bitmap);
199
200 void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
201 int GetMarginX() const { return m_marginX; }
202 int GetMarginY() const { return m_marginY; }
203 };
204
205 //----------------------------------------------------------------------
206
207 class wxCheckBox : public wxControl {
208 public:
209 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
210 const wxPoint& pos = wxDefaultPosition,
211 const wxSize& size = wxDefaultSize,
212 long style = 0,
213 const wxValidator& val = wxDefaultValidator,
214 char* name = "checkBox");
215 %name(wxPreCheckBox)wxCheckBox();
216
217 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
218 const wxPoint& pos = wxDefaultPosition,
219 const wxSize& size = wxDefaultSize,
220 long style = 0,
221 const wxValidator& val = wxDefaultValidator,
222 char* name = "checkBox");
223
224 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
225 %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)"
226
227 bool GetValue();
228 void SetValue(const bool state);
229 };
230
231 //----------------------------------------------------------------------
232
233 class wxChoice : public wxControlWithItems {
234 public:
235 wxChoice(wxWindow *parent, wxWindowID id,
236 const wxPoint& pos = wxDefaultPosition,
237 const wxSize& size = wxDefaultSize,
238 int LCOUNT=0, wxString* choices=NULL,
239 long style = 0,
240 const wxValidator& validator = wxDefaultValidator,
241 char* name = "choice");
242 %name(wxPreChoice)wxChoice();
243
244 bool Create(wxWindow *parent, wxWindowID id,
245 const wxPoint& pos = wxDefaultPosition,
246 const wxSize& size = wxDefaultSize,
247 int LCOUNT=0, wxString* choices=NULL,
248 long style = 0,
249 const wxValidator& validator = wxDefaultValidator,
250 char* name = "choice");
251
252 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
253 %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)"
254
255 void Clear();
256
257 int GetColumns();
258 void SetColumns(const int n = 1);
259 void SetSelection(const int n);
260 void SetStringSelection(const wxString& string);
261 void SetString(int n, const wxString& s);
262
263 %pragma(python) addtoclass = "
264 Select = SetSelection
265 "
266 };
267
268 //----------------------------------------------------------------------
269
270 class wxComboBox : public wxChoice {
271 public:
272 wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
273 const wxPoint& pos = wxDefaultPosition,
274 const wxSize& size = wxDefaultSize,
275 int LCOUNT=0, wxString* choices=NULL,
276 long style = 0,
277 const wxValidator& validator = wxDefaultValidator,
278 char* name = "comboBox");
279 %name(wxPreComboBox)wxComboBox();
280
281 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
282 const wxPoint& pos = wxDefaultPosition,
283 const wxSize& size = wxDefaultSize,
284 int LCOUNT=0, wxString* choices=NULL,
285 long style = 0,
286 const wxValidator& validator = wxDefaultValidator,
287 char* name = "comboBox");
288
289 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
290 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
291
292 void Copy();
293 void Cut();
294 long GetInsertionPoint();
295 long GetLastPosition();
296 wxString GetValue();
297 void Paste();
298 void Replace(long from, long to, const wxString& text);
299 void Remove(long from, long to);
300 void SetInsertionPoint(long pos);
301 void SetInsertionPointEnd();
302 void SetSelection(int n);
303 %name(SetMark)void SetSelection(long from, long to);
304 void SetValue(const wxString& text);
305 void SetEditable(bool editable);
306 };
307
308 //----------------------------------------------------------------------
309
310 class wxGauge : public wxControl {
311 public:
312 wxGauge(wxWindow* parent, wxWindowID id, int range,
313 const wxPoint& pos = wxDefaultPosition,
314 const wxSize& size = wxDefaultSize,
315 long style = wxGA_HORIZONTAL,
316 const wxValidator& validator = wxDefaultValidator,
317 char* name = "gauge");
318 %name(wxPreGauge)wxGauge();
319
320 bool Create(wxWindow* parent, wxWindowID id, int range,
321 const wxPoint& pos = wxDefaultPosition,
322 const wxSize& size = wxDefaultSize,
323 long style = wxGA_HORIZONTAL,
324 const wxValidator& validator = wxDefaultValidator,
325 char* name = "gauge");
326
327 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
328 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
329
330 int GetBezelFace();
331 int GetRange();
332 int GetShadowWidth();
333 int GetValue();
334 void SetBezelFace(int width);
335 void SetRange(int range);
336 void SetShadowWidth(int width);
337 void SetValue(int pos);
338 };
339
340 //----------------------------------------------------------------------
341
342 class wxStaticBox : public wxControl {
343 public:
344 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
345 const wxPoint& pos = wxDefaultPosition,
346 const wxSize& size = wxDefaultSize,
347 long style = 0,
348 char* name = "staticBox");
349 %name(wxPreStaticBox)wxStaticBox();
350
351 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
352 const wxPoint& pos = wxDefaultPosition,
353 const wxSize& size = wxDefaultSize,
354 long style = 0,
355 char* name = "staticBox");
356
357 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
358 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
359 };
360
361
362 //----------------------------------------------------------------------
363
364
365 class wxStaticLine : public wxControl {
366 public:
367 wxStaticLine( wxWindow *parent, wxWindowID id,
368 const wxPoint &pos = wxDefaultPosition,
369 const wxSize &size = wxDefaultSize,
370 long style = wxLI_HORIZONTAL,
371 const char* name = "staticLine" );
372 %name(wxPreStaticLine)wxStaticLine();
373
374 bool Create( wxWindow *parent, wxWindowID id,
375 const wxPoint &pos = wxDefaultPosition,
376 const wxSize &size = wxDefaultSize,
377 long style = wxLI_HORIZONTAL,
378 const char* name = "staticLine" );
379
380 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
381 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
382 };
383
384
385 //----------------------------------------------------------------------
386
387 class wxStaticText : public wxControl {
388 public:
389 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
390 const wxPoint& pos = wxDefaultPosition,
391 const wxSize& size = wxDefaultSize,
392 long style = 0,
393 char* name = "staticText");
394 %name(wxPreStaticText)wxStaticText();
395
396 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
397 const wxPoint& pos = wxDefaultPosition,
398 const wxSize& size = wxDefaultSize,
399 long style = 0,
400 char* name = "staticText");
401
402 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
403 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
404
405 wxString GetLabel();
406 void SetLabel(const wxString& label);
407 };
408
409 //----------------------------------------------------------------------
410
411 class wxListBox : public wxControlWithItems {
412 public:
413 wxListBox(wxWindow* parent, wxWindowID id,
414 const wxPoint& pos = wxDefaultPosition,
415 const wxSize& size = wxDefaultSize,
416 int LCOUNT, wxString* choices = NULL,
417 long style = 0,
418 const wxValidator& validator = wxDefaultValidator,
419 char* name = "listBox");
420 %name(wxPreListBox)wxListBox();
421
422 bool Create(wxWindow* parent, wxWindowID id,
423 const wxPoint& pos = wxDefaultPosition,
424 const wxSize& size = wxDefaultSize,
425 int LCOUNT, wxString* choices = NULL,
426 long style = 0,
427 const wxValidator& validator = wxDefaultValidator,
428 char* name = "listBox");
429
430 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
431 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
432
433 void Clear();
434 void Deselect(int n);
435
436 // int GetSelections(int **selections);
437 %addmethods {
438 PyObject* GetSelections() {
439 wxArrayInt lst;
440 self->GetSelections(lst);
441 PyObject *tup = PyTuple_New(lst.GetCount());
442 for(size_t i=0; i<lst.GetCount(); i++) {
443 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
444 }
445 return tup;
446 }
447 }
448
449
450 void InsertItems(int LCOUNT, wxString* choices, int pos);
451
452 bool IsSelected(const int n);
453 bool Selected(const int n);
454 void Set(int LCOUNT, wxString* choices);
455 void SetFirstItem(int n);
456 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
457 void SetSelection(int n, bool select = TRUE);
458 void SetString(int n, const wxString& string);
459 void SetStringSelection(const wxString& string, bool select = TRUE);
460 };
461
462
463 //----------------------------------------------------------------------
464
465 class wxCheckListBox : public wxListBox {
466 public:
467 wxCheckListBox(wxWindow *parent, wxWindowID id,
468 const wxPoint& pos = wxDefaultPosition,
469 const wxSize& size = wxDefaultSize,
470 int LCOUNT = 0,
471 wxString* choices = NULL,
472 long style = 0,
473 const wxValidator& validator = wxDefaultValidator,
474 char* name = "listBox");
475 %name(wxPreCheckListBox)wxCheckListBox();
476
477 bool Create(wxWindow *parent, wxWindowID id,
478 const wxPoint& pos = wxDefaultPosition,
479 const wxSize& size = wxDefaultSize,
480 int LCOUNT = 0,
481 wxString* choices = NULL,
482 long style = 0,
483 const wxValidator& validator = wxDefaultValidator,
484 char* name = "listBox");
485
486 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
487 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
488
489 bool IsChecked(int uiIndex);
490 void Check(int uiIndex, int bCheck = TRUE);
491 void InsertItems(int LCOUNT, wxString* choices, int pos);
492
493 #ifndef __WXMAC__
494 int GetItemHeight();
495 #endif
496 };
497
498 //----------------------------------------------------------------------
499
500
501 class wxTextAttr
502 {
503 public:
504 // ctors
505 wxTextAttr(const wxColour& colText = wxNullColour,
506 const wxColour& colBack = wxNullColour,
507 const wxFont& font = wxNullFont);
508 ~wxTextAttr();
509
510 // setters
511 void SetTextColour(const wxColour& colText);
512 void SetBackgroundColour(const wxColour& colBack);
513 void SetFont(const wxFont& font);
514
515 // accessors
516 bool HasTextColour() const;
517 bool HasBackgroundColour() const;
518 bool HasFont() const;
519
520 const wxColour& GetTextColour() const;
521 const wxColour& GetBackgroundColour() const;
522 const wxFont& GetFont() const;
523 };
524
525
526
527 class wxTextCtrl : public wxControl {
528 public:
529 wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "",
530 const wxPoint& pos = wxDefaultPosition,
531 const wxSize& size = wxDefaultSize,
532 long style = 0,
533 const wxValidator& validator = wxDefaultValidator,
534 char* name = "text");
535 %name(wxPreTextCtrl)wxTextCtrl();
536
537 bool Create(wxWindow* parent, wxWindowID id, char* value = "",
538 const wxPoint& pos = wxDefaultPosition,
539 const wxSize& size = wxDefaultSize,
540 long style = 0,
541 const wxValidator& validator = wxDefaultValidator,
542 char* name = "text");
543
544 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
545 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
546
547 void Clear();
548 void Copy();
549 void Cut();
550 void DiscardEdits();
551 long GetInsertionPoint();
552 long GetLastPosition();
553 int GetLineLength(long lineNo);
554 wxString GetLineText(long lineNo);
555 int GetNumberOfLines();
556 wxString GetValue();
557 bool IsModified();
558 bool LoadFile(const wxString& filename);
559 void Paste();
560 void PositionToXY(long pos, long *OUTPUT, long *OUTPUT);
561 void Remove(long from, long to);
562 void Replace(long from, long to, const wxString& value);
563 bool SaveFile(const wxString& filename);
564 void SetEditable(bool editable);
565 void SetInsertionPoint(long pos);
566 void SetInsertionPointEnd();
567 void SetSelection(long from, long to);
568 void SetValue(const wxString& value);
569 void ShowPosition(long pos);
570 void WriteText(const wxString& text);
571 void AppendText(const wxString& text);
572 long XYToPosition(long x, long y);
573
574 bool CanCopy();
575 bool CanCut();
576 bool CanPaste();
577 bool CanRedo();
578 bool CanUndo();
579 void GetSelection(long* OUTPUT, long* OUTPUT);
580 bool IsEditable();
581 void Undo();
582 void Redo();
583
584 bool SetStyle(long start, long end, const wxTextAttr& style);
585 bool SetDefaultStyle(const wxTextAttr& style);
586 const wxTextAttr& GetDefaultStyle() const;
587
588 void SetMaxLength(unsigned long len);
589
590 %addmethods {
591 void write(const wxString& text) {
592 self->AppendText(text);
593 }
594 }
595 };
596
597 //----------------------------------------------------------------------
598
599 class wxScrollBar : public wxControl {
600 public:
601 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
602 const wxPoint& pos = wxDefaultPosition,
603 const wxSize& size = wxDefaultSize,
604 long style = wxSB_HORIZONTAL,
605 const wxValidator& validator = wxDefaultValidator,
606 char* name = "scrollBar");
607 %name(wxPreScrollBar)wxScrollBar();
608
609 bool Create(wxWindow* parent, wxWindowID id = -1,
610 const wxPoint& pos = wxDefaultPosition,
611 const wxSize& size = wxDefaultSize,
612 long style = wxSB_HORIZONTAL,
613 const wxValidator& validator = wxDefaultValidator,
614 char* name = "scrollBar");
615
616 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
617 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
618
619 int GetRange();
620 int GetPageSize();
621 int GetThumbPosition();
622 int GetThumbSize();
623 %name(GetThumbLength) int GetThumbSize(); // to match the docs
624 void SetThumbPosition(int viewStart);
625 void SetScrollbar(int position, int thumbSize,
626 int range, int pageSize,
627 bool refresh = TRUE);
628 };
629
630 //----------------------------------------------------------------------
631
632 class wxSpinButton : public wxControl {
633 public:
634 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
635 const wxPoint& pos = wxDefaultPosition,
636 const wxSize& size = wxDefaultSize,
637 long style = wxSP_HORIZONTAL,
638 char* name = "spinButton");
639 %name(wxPreSpinButton)wxSpinButton();
640
641 bool Create(wxWindow* parent, wxWindowID id = -1,
642 const wxPoint& pos = wxDefaultPosition,
643 const wxSize& size = wxDefaultSize,
644 long style = wxSP_HORIZONTAL,
645 char* name = "spinButton");
646
647 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
648 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
649
650 int GetMax();
651 int GetMin();
652 int GetValue();
653 void SetRange(int min, int max);
654 void SetValue(int value);
655 };
656
657 //----------------------------------------------------------------------
658
659 class wxStaticBitmap : public wxControl {
660 public:
661 wxStaticBitmap(wxWindow* parent, wxWindowID id,
662 const wxBitmap& bitmap,
663 const wxPoint& pos = wxDefaultPosition,
664 const wxSize& size = wxDefaultSize,
665 long style = 0,
666 char* name = "staticBitmap");
667 %name(wxPreStaticBitmap)wxStaticBitmap();
668
669 bool Create(wxWindow* parent, wxWindowID id,
670 const wxBitmap& bitmap,
671 const wxPoint& pos = wxDefaultPosition,
672 const wxSize& size = wxDefaultSize,
673 long style = 0,
674 char* name = "staticBitmap");
675
676 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
677 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
678
679 const wxBitmap& GetBitmap();
680 void SetBitmap(const wxBitmap& bitmap);
681 void SetIcon(const wxIcon& icon);
682 };
683
684 //----------------------------------------------------------------------
685
686 class wxRadioBox : public wxControl {
687 public:
688 wxRadioBox(wxWindow* parent, wxWindowID id,
689 const wxString& label,
690 const wxPoint& point = wxDefaultPosition,
691 const wxSize& size = wxDefaultSize,
692 int LCOUNT = 0, wxString* choices = NULL,
693 int majorDimension = 0,
694 long style = wxRA_HORIZONTAL,
695 const wxValidator& validator = wxDefaultValidator,
696 char* name = "radioBox");
697 %name(wxPreRadioBox)wxRadioBox();
698
699 bool Create(wxWindow* parent, wxWindowID id,
700 const wxString& label,
701 const wxPoint& point = wxDefaultPosition,
702 const wxSize& size = wxDefaultSize,
703 int LCOUNT = 0, wxString* choices = NULL,
704 int majorDimension = 0,
705 long style = wxRA_HORIZONTAL,
706 const wxValidator& validator = wxDefaultValidator,
707 char* name = "radioBox");
708
709 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
710 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
711
712 void Enable(bool enable);
713 %name(EnableItem)void Enable(int n, bool enable);
714 int FindString(const wxString& string);
715
716 wxString GetString(int n);
717
718 #ifdef __WXGTK__
719 %name(GetItemLabel)wxString GetLabel( int item );
720 %name(SetItemLabel)void SetLabel( int item, const wxString& label );
721 #else
722 void SetString(int n, const wxString& label);
723 %pragma(python) addtoclass = "
724 GetItemLabel = GetString
725 SetItemLabel = SetString
726 "
727 int GetColumnCount();
728 int GetRowCount();
729 #endif
730
731 int GetSelection();
732 wxString GetStringSelection();
733 int GetCount();
734 %pragma(python) addtoclass = "Number = GetCount"
735
736 void SetSelection(int n);
737 void SetStringSelection(const wxString& string);
738 void Show(bool show);
739 %name(ShowItem)void Show(int item, bool show);
740 };
741
742 //----------------------------------------------------------------------
743
744 class wxRadioButton : public wxControl {
745 public:
746 wxRadioButton(wxWindow* parent, wxWindowID id,
747 const wxString& label,
748 const wxPoint& pos = wxDefaultPosition,
749 const wxSize& size = wxDefaultSize,
750 long style = 0,
751 const wxValidator& validator = wxDefaultValidator,
752 char* name = "radioButton");
753 %name(wxPreRadioButton)wxRadioButton();
754
755 bool Create(wxWindow* parent, wxWindowID id,
756 const wxString& label,
757 const wxPoint& pos = wxDefaultPosition,
758 const wxSize& size = wxDefaultSize,
759 long style = 0,
760 const wxValidator& validator = wxDefaultValidator,
761 char* name = "radioButton");
762
763 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
764 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
765
766 bool GetValue();
767 void SetValue(bool value);
768 };
769
770 //----------------------------------------------------------------------
771
772 class wxSlider : public wxControl {
773 public:
774 wxSlider(wxWindow* parent, wxWindowID id,
775 int value, int minValue, int maxValue,
776 const wxPoint& point = wxDefaultPosition,
777 const wxSize& size = wxDefaultSize,
778 long style = wxSL_HORIZONTAL,
779 const wxValidator& validator = wxDefaultValidator,
780 char* name = "slider");
781 %name(wxPreSlider)wxSlider();
782
783 bool Create(wxWindow* parent, wxWindowID id,
784 int value, int minValue, int maxValue,
785 const wxPoint& point = wxDefaultPosition,
786 const wxSize& size = wxDefaultSize,
787 long style = wxSL_HORIZONTAL,
788 const wxValidator& validator = wxDefaultValidator,
789 char* name = "slider");
790
791 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
792 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
793
794 void ClearSel();
795 void ClearTicks();
796 int GetLineSize();
797 int GetMax();
798 int GetMin();
799 int GetPageSize();
800 int GetSelEnd();
801 int GetSelStart();
802 int GetThumbLength();
803 int GetTickFreq();
804 int GetValue();
805 void SetRange(int minValue, int maxValue);
806 void SetTickFreq(int n, int pos);
807 void SetLineSize(int lineSize);
808 void SetPageSize(int pageSize);
809 void SetSelection(int startPos, int endPos);
810 void SetThumbLength(int len);
811 void SetTick(int tickPos);
812 void SetValue(int value);
813 };
814
815
816 //----------------------------------------------------------------------
817
818 class wxSpinCtrl : public wxSpinButton {
819 public:
820 wxSpinCtrl(wxWindow *parent,
821 wxWindowID id = -1,
822 const char* value = "",
823 const wxPoint& pos = wxDefaultPosition,
824 const wxSize& size = wxDefaultSize,
825 long style = wxSP_ARROW_KEYS,
826 int min = 0, int max = 100, int initial = 0,
827 const char* name = "wxSpinCtrl");
828 %name(wxPreSpinCtrl)wxSpinCtrl();
829
830 bool Create(wxWindow *parent,
831 wxWindowID id = -1,
832 const char* value = "",
833 const wxPoint& pos = wxDefaultPosition,
834 const wxSize& size = wxDefaultSize,
835 long style = wxSP_ARROW_KEYS,
836 int min = 0, int max = 100, int initial = 0,
837 const char* name = "wxSpinCtrl");
838
839 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
840 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
841
842 int GetMax();
843 int GetMin();
844 int GetValue();
845 void SetRange(int min, int max);
846 void SetValue(int value);
847
848 };
849
850
851 //----------------------------------------------------------------------
852
853 #ifndef __WXMAC__
854 enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
855
856 class wxToggleButton : public wxControl {
857 public:
858 wxToggleButton(wxWindow *parent,
859 wxWindowID id,
860 const wxString& label,
861 const wxPoint& pos = wxDefaultPosition,
862 const wxSize& size = wxDefaultSize,
863 long style = 0,
864 const wxValidator& validator = wxDefaultValidator,
865 const char* name = "toggle");
866 %name(wxPreToggleButton)wxToggleButton();
867
868 bool Create(wxWindow *parent,
869 wxWindowID id,
870 const wxString& label,
871 const wxPoint& pos = wxDefaultPosition,
872 const wxSize& size = wxDefaultSize,
873 long style = 0,
874 const wxValidator& validator = wxDefaultValidator,
875 const char* name = "toggle");
876
877 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
878 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
879
880 void SetValue(bool value);
881 bool GetValue() const ;
882 void SetLabel(const wxString& label);
883
884 };
885
886 #endif
887 //----------------------------------------------------------------------
888 //----------------------------------------------------------------------
889 //----------------------------------------------------------------------
890
891
892