]>
Commit | Line | Data |
---|---|---|
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 | MustHaveApp(wxRadioBox); | |
25 | ||
26 | class wxRadioBox : public wxControl | |
27 | { | |
28 | public: | |
29 | %pythonPrepend wxRadioBox "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point'];del kwargs['point']" | |
30 | %pythonPrepend wxRadioBox() "" | |
31 | %pythonAppend wxRadioBox "self._setOORInfo(self)" | |
32 | %pythonAppend wxRadioBox() "" | |
33 | ||
34 | wxRadioBox(wxWindow* parent, wxWindowID id=-1, | |
35 | const wxString& label = wxPyEmptyString, | |
36 | const wxPoint& pos = wxDefaultPosition, | |
37 | const wxSize& size = wxDefaultSize, | |
38 | const wxArrayString& choices = wxPyEmptyStringArray, | |
39 | int majorDimension = 0, | |
40 | long style = wxRA_HORIZONTAL, | |
41 | const wxValidator& validator = wxDefaultValidator, | |
42 | const wxString& name = wxPyRadioBoxNameStr); | |
43 | %RenameCtor(PreRadioBox, wxRadioBox()); | |
44 | ||
45 | bool Create(wxWindow* parent, wxWindowID id=-1, | |
46 | const wxString& label = wxPyEmptyString, | |
47 | const wxPoint& pos = wxDefaultPosition, | |
48 | const wxSize& size = wxDefaultSize, | |
49 | const wxArrayString& choices = wxPyEmptyStringArray, | |
50 | int majorDimension = 0, | |
51 | long style = wxRA_HORIZONTAL, | |
52 | const wxValidator& validator = wxDefaultValidator, | |
53 | const wxString& name = wxPyRadioBoxNameStr); | |
54 | ||
55 | virtual void SetSelection(int n); | |
56 | virtual int GetSelection() const; | |
57 | ||
58 | virtual wxString GetStringSelection() const; | |
59 | virtual bool SetStringSelection(const wxString& s); | |
60 | ||
61 | // string access | |
62 | virtual size_t GetCount() const; | |
63 | virtual int FindString(const wxString& s) const; | |
64 | ||
65 | virtual wxString GetString(int n) const; | |
66 | virtual void SetString(int n, const wxString& label); | |
67 | %pythoncode { GetItemLabel = GetString }; | |
68 | %pythoncode { SetItemLabel = SetString }; | |
69 | ||
70 | // change the individual radio button state | |
71 | %Rename(EnableItem, virtual void, Enable(unsigned int n, bool enable = true)); | |
72 | %Rename(ShowItem, virtual void, Show(unsigned int n, bool show = true)); | |
73 | virtual bool IsItemEnabled(unsigned int n) const; | |
74 | virtual bool IsItemShown(unsigned int n) const; | |
75 | ||
76 | // layout parameters | |
77 | virtual unsigned int GetColumnCount() const; | |
78 | virtual unsigned int GetRowCount() const; | |
79 | ||
80 | // return the item above/below/to the left/right of the given one | |
81 | int GetNextItem(int item, wxDirection dir, long style) const; | |
82 | ||
83 | // set the tooltip text for a radio item, empty string unsets any tooltip | |
84 | void SetItemToolTip(unsigned int item, const wxString& text); | |
85 | ||
86 | // get the individual items tooltip; returns NULL if none | |
87 | wxToolTip *GetItemToolTip(unsigned int item) const; | |
88 | ||
89 | // set helptext for a particular item, pass an empty string to erase it | |
90 | void SetItemHelpText(unsigned int n, const wxString& helpText); | |
91 | ||
92 | // retrieve helptext for a particular item, empty string means no help text | |
93 | wxString GetItemHelpText(unsigned int n) const; | |
94 | ||
95 | // Hmmm... This is protected on wxMSW. | |
96 | // virtual int GetItemFromPoint(const wxPoint& pt) const; | |
97 | ||
98 | // bool IsValid(int n) const; ** not public | |
99 | ||
100 | static wxVisualAttributes | |
101 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
102 | }; | |
103 | ||
104 | ||
105 | //--------------------------------------------------------------------------- | |
106 | %newgroup | |
107 | ||
108 | MustHaveApp(wxRadioButton); | |
109 | ||
110 | class wxRadioButton : public wxControl | |
111 | { | |
112 | public: | |
113 | %pythonAppend wxRadioButton "self._setOORInfo(self)" | |
114 | %pythonAppend wxRadioButton() "" | |
115 | ||
116 | wxRadioButton(wxWindow* parent, wxWindowID id=-1, | |
117 | const wxString& label = wxPyEmptyString, | |
118 | const wxPoint& pos = wxDefaultPosition, | |
119 | const wxSize& size = wxDefaultSize, | |
120 | long style = 0, | |
121 | const wxValidator& validator = wxDefaultValidator, | |
122 | const wxString& name = wxPyRadioButtonNameStr); | |
123 | %RenameCtor(PreRadioButton, wxRadioButton()); | |
124 | ||
125 | bool Create(wxWindow* parent, wxWindowID id=-1, | |
126 | const wxString& label = wxPyEmptyString, | |
127 | const wxPoint& pos = wxDefaultPosition, | |
128 | const wxSize& size = wxDefaultSize, | |
129 | long style = 0, | |
130 | const wxValidator& validator = wxDefaultValidator, | |
131 | const wxString& name = wxPyRadioButtonNameStr); | |
132 | ||
133 | bool GetValue(); | |
134 | void SetValue(bool value); | |
135 | ||
136 | static wxVisualAttributes | |
137 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
138 | }; | |
139 | ||
140 | //--------------------------------------------------------------------------- | |
141 | //--------------------------------------------------------------------------- |