]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: _combobox.i | |
3 | // Purpose: SWIG interface defs for wxComboBox | |
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(ComboBoxNameStr); | |
19 | ||
20 | //--------------------------------------------------------------------------- | |
21 | %newgroup; | |
22 | ||
23 | ||
24 | DocStr(wxComboBox, | |
25 | "A combobox is like a combination of an edit control and a listbox. It can be | |
26 | displayed as static list with editable or read-only text field; or a drop-down | |
27 | list with text field."); | |
28 | ||
29 | RefDoc(wxComboBox, " | |
30 | Styles | |
31 | wx.CB_SIMPLE: Creates a combobox with a permanently displayed list. | |
32 | Windows only. | |
33 | ||
34 | wx.CB_DROPDOWN: Creates a combobox with a drop-down list. | |
35 | ||
36 | wx.CB_READONLY: Same as wxCB_DROPDOWN but only the strings specified as | |
37 | the combobox choices can be selected, it is impossible | |
38 | to select (even from a program) a string which is not in | |
39 | the choices list. | |
40 | ||
41 | wx.CB_SORT: Sorts the entries in the list alphabetically. | |
42 | ||
43 | Events | |
44 | ||
45 | EVT_COMBOBOX: Sent when an item on the list is selected. | |
46 | EVT_TEXT: Sent when the combobox text changes. | |
47 | "); | |
48 | ||
49 | ||
50 | ||
51 | #ifdef __WXMSW__ | |
52 | class wxComboBox : public wxChoice | |
53 | #else | |
54 | class wxComboBox : public wxControl, public wxItemContainer | |
55 | #endif | |
56 | { | |
57 | public: | |
58 | %pythonAppend wxComboBox "self._setOORInfo(self)" | |
59 | %pythonAppend wxComboBox() "" | |
60 | ||
61 | DocCtorAStr( | |
62 | wxComboBox(wxWindow* parent, wxWindowID id, | |
63 | const wxString& value = wxPyEmptyString, | |
64 | const wxPoint& pos = wxDefaultPosition, | |
65 | const wxSize& size = wxDefaultSize, | |
66 | const wxArrayString& choices = wxPyEmptyStringArray, | |
67 | long style = 0, | |
68 | const wxValidator& validator = wxDefaultValidator, | |
69 | const wxString& name = wxPyComboBoxNameStr), | |
70 | "__init__(Window parent, int id, String value=EmptyString,\n" | |
71 | " Point pos=DefaultPosition, Size size=DefaultSize,\n" | |
72 | " List choices=[], long style=0, Validator validator=DefaultValidator,\n" | |
73 | " String name=ComboBoxNameStr) -> ComboBox", | |
74 | "Constructor, creates and shows a ComboBox control."); | |
75 | ||
76 | DocCtorStrName( | |
77 | wxComboBox(), | |
78 | "Precreate a ComboBox control for 2-phase creation.", | |
79 | PreComboBox); | |
80 | ||
81 | ||
82 | DocDeclAStr( | |
83 | bool, Create(wxWindow *parent, wxWindowID id, | |
84 | const wxString& value = wxPyEmptyString, | |
85 | const wxPoint& pos = wxDefaultPosition, | |
86 | const wxSize& size = wxDefaultSize, | |
87 | const wxArrayString& choices = wxPyEmptyStringArray, | |
88 | long style = 0, | |
89 | const wxValidator& validator = wxDefaultValidator, | |
90 | const wxString& name = wxPyChoiceNameStr), | |
91 | "Create(Window parent, int id, String value=EmptyString,\n" | |
92 | " Point pos=DefaultPosition, Size size=DefaultSize,\n" | |
93 | " List choices=[], long style=0, Validator validator=DefaultValidator,\n" | |
94 | " String name=ChoiceNameStr) -> bool", | |
95 | "Actually create the GUI wxComboBox control for 2-phase creation"); | |
96 | ||
97 | ||
98 | DocDeclStr( | |
99 | virtual wxString , GetValue() const, | |
100 | "Returns the current value in the combobox text field."); | |
101 | ||
102 | DocDeclStr( | |
103 | virtual void , SetValue(const wxString& value), | |
104 | ""); | |
105 | ||
106 | ||
107 | DocDeclStr( | |
108 | virtual void , Copy(), | |
109 | "Copies the selected text to the clipboard."); | |
110 | ||
111 | DocDeclStr( | |
112 | virtual void , Cut(), | |
113 | "Copies the selected text to the clipboard and removes the selection."); | |
114 | ||
115 | DocDeclStr( | |
116 | virtual void , Paste(), | |
117 | "Pastes text from the clipboard to the text field."); | |
118 | ||
119 | ||
120 | DocDeclStr( | |
121 | virtual void , SetInsertionPoint(long pos), | |
122 | "Sets the insertion point in the combobox text field."); | |
123 | ||
124 | DocDeclStr( | |
125 | virtual long , GetInsertionPoint() const, | |
126 | "Returns the insertion point for the combobox's text field."); | |
127 | ||
128 | DocDeclStr( | |
129 | virtual long , GetLastPosition() const, | |
130 | "Returns the last position in the combobox text field."); | |
131 | ||
132 | DocDeclStr( | |
133 | virtual void , Replace(long from, long to, const wxString& value), | |
134 | "Replaces the text between two positions with the given text, in the\n" | |
135 | "combobox text field."); | |
136 | ||
137 | DocDeclStr( | |
138 | void , SetSelection(int n), | |
139 | "Selects the text between the two positions, in the combobox text field."); | |
140 | ||
141 | %name(SetMark) virtual void SetSelection(long from, long to); | |
142 | ||
143 | DocDeclStr( | |
144 | virtual void , SetEditable(bool editable), | |
145 | ""); | |
146 | ||
147 | ||
148 | DocDeclStr( | |
149 | virtual void , SetInsertionPointEnd(), | |
150 | "Sets the insertion point at the end of the combobox text field."); | |
151 | ||
152 | DocDeclStr( | |
153 | virtual void , Remove(long from, long to), | |
154 | "Removes the text between the two positions in the combobox text field."); | |
155 | ||
156 | }; | |
157 | ||
158 | //--------------------------------------------------------------------------- |