]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_radio.i
wxCheckListBox doesn't require wxUSE_OWNER_DRAWN when using WXUNIVERSAL
[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
RD
38 //int choices = 0, wxString* choices_array = NULL,
39 const wxArrayString& choices = wxPyEmptyStringArray,
d14a1e28
RD
40 int majorDimension = 0,
41 long style = wxRA_HORIZONTAL,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxPyRadioBoxNameStr);
1b8c7ba6 44 %RenameCtor(PreRadioBox, wxRadioBox());
d14a1e28 45
d5573410
RD
46 bool Create(wxWindow* parent, wxWindowID id=-1,
47 const wxString& label = wxPyEmptyString,
699e192b
RD
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 //int choices = 0, wxString* choices_array = NULL,
51 const wxArrayString& choices = wxPyEmptyStringArray,
52 int majorDimension = 0,
53 long style = wxRA_HORIZONTAL,
54 const wxValidator& validator = wxDefaultValidator,
55 const wxString& name = wxPyRadioBoxNameStr);
d14a1e28
RD
56
57 virtual void SetSelection(int n);
58 virtual int GetSelection() const;
59
60 virtual wxString GetStringSelection() const;
61 virtual bool SetStringSelection(const wxString& s);
62
63 // string access
64 virtual int GetCount() const;
65 virtual int FindString(const wxString& s) const;
66
67 virtual wxString GetString(int n) const;
68 virtual void SetString(int n, const wxString& label);
69 %pythoncode { GetItemLabel = GetString };
70 %pythoncode { SetItemLabel = SetString };
71
72 // change the individual radio button state
1b8c7ba6
RD
73 %Rename(EnableItem, virtual void, Enable(int n, bool enable = true));
74 %Rename(ShowItem, virtual void, Show(int n, bool show = true));
d14a1e28
RD
75
76#ifndef __WXGTK__
77 // layout parameters
78 virtual int GetColumnCount() const;
79 virtual int GetRowCount() const;
80
81 // return the item above/below/to the left/right of the given one
82 int GetNextItem(int item, wxDirection dir, long style) const;
83#else
84 %extend {
85 int GetColumnCount() const { return -1; }
86 int GetRowCount() const { return -1; }
87 int GetNextItem(int item, wxDirection dir, long style) const { return -1; }
88 }
89#endif
69e8c95a 90
5207975f 91// bool IsValid(int n) const; ** not public
d14a1e28 92
880715c9
RD
93 static wxVisualAttributes
94 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
d14a1e28
RD
95};
96
97
98//---------------------------------------------------------------------------
99%newgroup
100
ab1f7d2a
RD
101MustHaveApp(wxRadioButton);
102
d14a1e28
RD
103class wxRadioButton : public wxControl
104{
105public:
2b9048c5
RD
106 %pythonAppend wxRadioButton "self._setOORInfo(self)"
107 %pythonAppend wxRadioButton() ""
d14a1e28 108
d5573410
RD
109 wxRadioButton(wxWindow* parent, wxWindowID id=-1,
110 const wxString& label = wxPyEmptyString,
d14a1e28
RD
111 const wxPoint& pos = wxDefaultPosition,
112 const wxSize& size = wxDefaultSize,
113 long style = 0,
114 const wxValidator& validator = wxDefaultValidator,
115 const wxString& name = wxPyRadioButtonNameStr);
1b8c7ba6 116 %RenameCtor(PreRadioButton, wxRadioButton());
d14a1e28 117
d5573410
RD
118 bool Create(wxWindow* parent, wxWindowID id=-1,
119 const wxString& label = wxPyEmptyString,
d14a1e28
RD
120 const wxPoint& pos = wxDefaultPosition,
121 const wxSize& size = wxDefaultSize,
122 long style = 0,
123 const wxValidator& validator = wxDefaultValidator,
124 const wxString& name = wxPyRadioButtonNameStr);
125
126 bool GetValue();
127 void SetValue(bool value);
880715c9
RD
128
129 static wxVisualAttributes
130 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
d14a1e28
RD
131};
132
133//---------------------------------------------------------------------------
134//---------------------------------------------------------------------------