]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_radio.i
Docview and IDE patch from Morag Hua with fix for bug #1217890
[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
62 virtual int 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
1b8c7ba6
RD
71 %Rename(EnableItem, virtual void, Enable(int n, bool enable = true));
72 %Rename(ShowItem, virtual void, Show(int n, bool show = true));
d14a1e28
RD
73
74#ifndef __WXGTK__
75 // layout parameters
76 virtual int GetColumnCount() const;
77 virtual int GetRowCount() const;
78
79 // return the item above/below/to the left/right of the given one
80 int GetNextItem(int item, wxDirection dir, long style) const;
81#else
82 %extend {
83 int GetColumnCount() const { return -1; }
84 int GetRowCount() const { return -1; }
85 int GetNextItem(int item, wxDirection dir, long style) const { return -1; }
86 }
87#endif
69e8c95a 88
5207975f 89// bool IsValid(int n) const; ** not public
d14a1e28 90
880715c9
RD
91 static wxVisualAttributes
92 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
d14a1e28
RD
93};
94
95
96//---------------------------------------------------------------------------
97%newgroup
98
ab1f7d2a
RD
99MustHaveApp(wxRadioButton);
100
d14a1e28
RD
101class wxRadioButton : public wxControl
102{
103public:
2b9048c5
RD
104 %pythonAppend wxRadioButton "self._setOORInfo(self)"
105 %pythonAppend wxRadioButton() ""
d14a1e28 106
d5573410
RD
107 wxRadioButton(wxWindow* parent, wxWindowID id=-1,
108 const wxString& label = wxPyEmptyString,
d14a1e28
RD
109 const wxPoint& pos = wxDefaultPosition,
110 const wxSize& size = wxDefaultSize,
111 long style = 0,
112 const wxValidator& validator = wxDefaultValidator,
113 const wxString& name = wxPyRadioButtonNameStr);
1b8c7ba6 114 %RenameCtor(PreRadioButton, wxRadioButton());
d14a1e28 115
d5573410
RD
116 bool Create(wxWindow* parent, wxWindowID id=-1,
117 const wxString& label = wxPyEmptyString,
d14a1e28
RD
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
124 bool GetValue();
125 void SetValue(bool value);
880715c9
RD
126
127 static wxVisualAttributes
128 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
d14a1e28
RD
129};
130
131//---------------------------------------------------------------------------
132//---------------------------------------------------------------------------