]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_radio.i
Ensure we have the capture before releasing it.
[wxWidgets.git] / wxPython / src / _radio.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _radio.i
3 // Purpose: SWIG interface defs for wxRadioButton and wxRadioBox
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 MAKE_CONST_WXSTRING(RadioBoxNameStr);
19 MAKE_CONST_WXSTRING(RadioButtonNameStr);
20
21 //---------------------------------------------------------------------------
22 %newgroup
23
24 class wxRadioBox : public wxControl
25 {
26 public:
27 %addtofunc wxRadioBox "self._setOORInfo(self)"
28 %addtofunc wxRadioBox() ""
29
30 wxRadioBox(wxWindow* parent, wxWindowID id,
31 const wxString& label,
32 const wxPoint& point = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int choices = 0, wxString* choices_array = NULL,
35 int majorDimension = 0,
36 long style = wxRA_HORIZONTAL,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxPyRadioBoxNameStr);
39 %name(PreRadioBox)wxRadioBox();
40
41 bool Create(wxWindow* parent, wxWindowID id,
42 const wxString& label,
43 const wxPoint& point = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 int choices = 0, wxString* choices_array = NULL,
46 int majorDimension = 0,
47 long style = wxRA_HORIZONTAL,
48 const wxValidator& validator = wxDefaultValidator,
49 const wxString& name = wxPyRadioBoxNameStr);
50
51 virtual void SetSelection(int n);
52 virtual int GetSelection() const;
53
54 virtual wxString GetStringSelection() const;
55 virtual bool SetStringSelection(const wxString& s);
56
57 // string access
58 virtual int GetCount() const;
59 virtual int FindString(const wxString& s) const;
60
61 virtual wxString GetString(int n) const;
62 virtual void SetString(int n, const wxString& label);
63 %pythoncode { GetItemLabel = GetString };
64 %pythoncode { SetItemLabel = SetString };
65
66 // change the individual radio button state
67 %name(EnableItem) virtual void Enable(int n, bool enable = True);
68 %name(ShowItem) virtual void Show(int n, bool show = True);
69
70 #ifndef __WXGTK__
71 // layout parameters
72 virtual int GetColumnCount() const;
73 virtual int GetRowCount() const;
74
75 // return the item above/below/to the left/right of the given one
76 int GetNextItem(int item, wxDirection dir, long style) const;
77 #else
78 %extend {
79 int GetColumnCount() const { return -1; }
80 int GetRowCount() const { return -1; }
81 int GetNextItem(int item, wxDirection dir, long style) const { return -1; }
82 }
83 #endif
84
85 };
86
87
88 //---------------------------------------------------------------------------
89 %newgroup
90
91 class wxRadioButton : public wxControl
92 {
93 public:
94 %addtofunc wxRadioButton "self._setOORInfo(self)"
95 %addtofunc wxRadioButton() ""
96
97 wxRadioButton(wxWindow* parent, wxWindowID id,
98 const wxString& label,
99 const wxPoint& pos = wxDefaultPosition,
100 const wxSize& size = wxDefaultSize,
101 long style = 0,
102 const wxValidator& validator = wxDefaultValidator,
103 const wxString& name = wxPyRadioButtonNameStr);
104 %name(PreRadioButton)wxRadioButton();
105
106 bool Create(wxWindow* parent, wxWindowID id,
107 const wxString& label,
108 const wxPoint& pos = wxDefaultPosition,
109 const wxSize& size = wxDefaultSize,
110 long style = 0,
111 const wxValidator& validator = wxDefaultValidator,
112 const wxString& name = wxPyRadioButtonNameStr);
113
114 bool GetValue();
115 void SetValue(bool value);
116 };
117
118 //---------------------------------------------------------------------------
119 //---------------------------------------------------------------------------