]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_radio.i
reSWIGged
[wxWidgets.git] / wxPython / src / _radio.i
CommitLineData
d14a1e28
RD
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
b2dc1044
RD
18MAKE_CONST_WXSTRING(RadioBoxNameStr);
19MAKE_CONST_WXSTRING(RadioButtonNameStr);
d14a1e28
RD
20
21//---------------------------------------------------------------------------
22%newgroup
23
ab1f7d2a
RD
24MustHaveApp(wxRadioBox);
25
d14a1e28
RD
26class wxRadioBox : public wxControl
27{
28public:
94eaeb1b 29 %pythonPrepend wxRadioBox "if kwargs.has_key('point'): kwargs['pos'] = kwargs['point'];del kwargs['point']"
2b9048c5
RD
30 %pythonPrepend wxRadioBox() ""
31 %pythonAppend wxRadioBox "self._setOORInfo(self)"
32 %pythonAppend wxRadioBox() ""
d14a1e28 33
d5573410
RD
34 wxRadioBox(wxWindow* parent, wxWindowID id=-1,
35 const wxString& label = wxPyEmptyString,
2b9048c5 36 const wxPoint& pos = wxDefaultPosition,
d14a1e28 37 const wxSize& size = wxDefaultSize,
699e192b 38 const wxArrayString& choices = wxPyEmptyStringArray,
d14a1e28
RD
39 int majorDimension = 0,
40 long style = wxRA_HORIZONTAL,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxPyRadioBoxNameStr);
1b8c7ba6 43 %RenameCtor(PreRadioBox, wxRadioBox());
d14a1e28 44
d5573410
RD
45 bool Create(wxWindow* parent, wxWindowID id=-1,
46 const wxString& label = wxPyEmptyString,
699e192b
RD
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
699e192b
RD
49 const wxArrayString& choices = wxPyEmptyStringArray,
50 int majorDimension = 0,
51 long style = wxRA_HORIZONTAL,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxPyRadioBoxNameStr);
d14a1e28
RD
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
f8dda225 62 virtual size_t GetCount() const;
d14a1e28
RD
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
3f5ec806
RD
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;
d14a1e28 75
d14a1e28 76 // layout parameters
3f5ec806
RD
77 virtual unsigned int GetColumnCount() const;
78 virtual unsigned int GetRowCount() const;
d14a1e28
RD
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;
69e8c95a 82
ab0c9822
RD
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
a3532702
RD
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;
8942133a
RD
94
95// Hmmm... This is protected on wxMSW.
96// virtual int GetItemFromPoint(const wxPoint& pt) const;
a3532702 97
5207975f 98// bool IsValid(int n) const; ** not public
d14a1e28 99
880715c9
RD
100 static wxVisualAttributes
101 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
7012bb9f
RD
102
103 %property(ColumnCount, GetColumnCount, doc="See `GetColumnCount`");
104 %property(Count, GetCount, doc="See `GetCount`");
105 %property(RowCount, GetRowCount, doc="See `GetRowCount`");
106 %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
107 %property(StringSelection, GetStringSelection, SetStringSelection, doc="See `GetStringSelection` and `SetStringSelection`");
d14a1e28
RD
108};
109
110
111//---------------------------------------------------------------------------
112%newgroup
113
ab1f7d2a
RD
114MustHaveApp(wxRadioButton);
115
d14a1e28
RD
116class wxRadioButton : public wxControl
117{
118public:
2b9048c5
RD
119 %pythonAppend wxRadioButton "self._setOORInfo(self)"
120 %pythonAppend wxRadioButton() ""
d14a1e28 121
d5573410
RD
122 wxRadioButton(wxWindow* parent, wxWindowID id=-1,
123 const wxString& label = wxPyEmptyString,
d14a1e28
RD
124 const wxPoint& pos = wxDefaultPosition,
125 const wxSize& size = wxDefaultSize,
126 long style = 0,
127 const wxValidator& validator = wxDefaultValidator,
128 const wxString& name = wxPyRadioButtonNameStr);
1b8c7ba6 129 %RenameCtor(PreRadioButton, wxRadioButton());
d14a1e28 130
d5573410
RD
131 bool Create(wxWindow* parent, wxWindowID id=-1,
132 const wxString& label = wxPyEmptyString,
d14a1e28
RD
133 const wxPoint& pos = wxDefaultPosition,
134 const wxSize& size = wxDefaultSize,
135 long style = 0,
136 const wxValidator& validator = wxDefaultValidator,
137 const wxString& name = wxPyRadioButtonNameStr);
138
139 bool GetValue();
140 void SetValue(bool value);
880715c9
RD
141
142 static wxVisualAttributes
143 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
7012bb9f
RD
144
145 %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
d14a1e28
RD
146};
147
148//---------------------------------------------------------------------------
149//---------------------------------------------------------------------------