]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/_functions.i
fixed TABs handling
[wxWidgets.git] / wxPython / src / _functions.i
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: _functions.i
3// Purpose: SWIG interface defs for various functions and such
4//
5// Author: Robin Dunn
6//
7// Created: 3-July-1997
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
18MAKE_CONST_WXSTRING(FileSelectorPromptStr);
19MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
20MAKE_CONST_WXSTRING(DirSelectorPromptStr);
21
22//---------------------------------------------------------------------------
23%newgroup;
24
25
26long wxNewId();
27void wxRegisterId(long id);
28long wxGetCurrentId();
29
30MustHaveApp(wxBell);
31void wxBell();
32
33MustHaveApp(wxEndBusyCursor);
34void wxEndBusyCursor();
35
36long wxGetElapsedTime(bool resetTimer = True);
37
38MustHaveApp(wxGetMousePosition);
39DocDeclA(
40 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
41 "GetMousePosition() -> (x,y)");
42
43bool wxIsBusy();
44wxString wxNow();
45bool wxShell(const wxString& command = wxPyEmptyString);
46void wxStartTimer();
47
48DocDeclA(
49 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
50 "GetOsVersion() -> (platform, major, minor)");
51
52wxString wxGetOsDescription();
53
54// TODO:
55// // Parses the wildCard, returning the number of filters.
56// // Returns 0 if none or if there's a problem,
57// // The arrays will contain an equal number of items found before the error.
58// // wildCard is in the form:
59// // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
60// int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
61
62#if defined(__WXMSW__) || defined(__WXMAC__)
63long wxGetFreeMemory();
64#else
65%inline %{
66 long wxGetFreeMemory()
67 { wxPyRaiseNotImplemented(); return 0; }
68%}
69#endif
70
71enum wxShutdownFlags
72{
73 wxSHUTDOWN_POWEROFF, // power off the computer
74 wxSHUTDOWN_REBOOT // shutdown and reboot
75};
76
77// Shutdown or reboot the PC
78MustHaveApp(wxShutdown);
79bool wxShutdown(wxShutdownFlags wFlags);
80
81
82void wxSleep(int secs);
83void wxMilliSleep(unsigned long milliseconds);
84void wxMicroSleep(unsigned long microseconds);
85%pythoncode { Usleep = MilliSleep }
86
87void wxEnableTopLevelWindows(bool enable);
88
89wxString wxStripMenuCodes(const wxString& in);
90
91
92wxString wxGetEmailAddress();
93wxString wxGetHostName();
94wxString wxGetFullHostName();
95wxString wxGetUserId();
96wxString wxGetUserName();
97wxString wxGetHomeDir();
98wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
99
100unsigned long wxGetProcessId();
101
102void wxTrap();
103
104
105// Dialog Functions
106
107MustHaveApp(wxFileSelector);
108wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
109 const wxString& default_path = wxPyEmptyString,
110 const wxString& default_filename = wxPyEmptyString,
111 const wxString& default_extension = wxPyEmptyString,
112 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
113 int flags = 0,
114 wxWindow *parent = NULL,
115 int x = -1, int y = -1);
116
117// TODO: wxFileSelectorEx
118
119
120// Ask for filename to load
121MustHaveApp(wxLoadFileSelector);
122wxString wxLoadFileSelector(const wxString& what,
123 const wxString& extension,
124 const wxString& default_name = wxPyEmptyString,
125 wxWindow *parent = NULL);
126
127// Ask for filename to save
128MustHaveApp(wxSaveFileSelector);
129wxString wxSaveFileSelector(const wxString& what,
130 const wxString& extension,
131 const wxString& default_name = wxPyEmptyString,
132 wxWindow *parent = NULL);
133
134
135MustHaveApp(wxDirSelector);
136wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
137 const wxString& defaultPath = wxPyEmptyString,
138 long style = wxDD_DEFAULT_STYLE,
139 const wxPoint& pos = wxDefaultPosition,
140 wxWindow *parent = NULL);
141
142MustHaveApp(wxGetTextFromUser);
143wxString wxGetTextFromUser(const wxString& message,
144 const wxString& caption = wxPyEmptyString,
145 const wxString& default_value = wxPyEmptyString,
146 wxWindow *parent = NULL,
147 int x = -1, int y = -1,
148 bool centre = True);
149
150MustHaveApp(wxGetPasswordFromUser);
151wxString wxGetPasswordFromUser(const wxString& message,
152 const wxString& caption = wxPyEmptyString,
153 const wxString& default_value = wxPyEmptyString,
154 wxWindow *parent = NULL);
155
156
157// TODO: Need to custom wrap this one...
158// int wxGetMultipleChoice(char* message, char* caption,
159// int LCOUNT, char** choices,
160// int nsel, int *selection,
161// wxWindow *parent = NULL, int x = -1, int y = -1,
162// bool centre = True, int width=150, int height=200);
163
164
165MustHaveApp(wxGetSingleChoice);
166wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
167 int choices, wxString* choices_array,
168 wxWindow *parent = NULL,
169 int x = -1, int y = -1,
170 bool centre = True,
171 int width=150, int height=200);
172
173MustHaveApp(wxGetSingleChoiceIndex);
174int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
175 int choices, wxString* choices_array,
176 wxWindow *parent = NULL,
177 int x = -1, int y = -1,
178 bool centre = True,
179 int width=150, int height=200);
180
181
182MustHaveApp(wxMessageBox);
183int wxMessageBox(const wxString& message,
184 const wxString& caption = wxPyEmptyString,
185 int style = wxOK | wxCENTRE,
186 wxWindow *parent = NULL,
187 int x = -1, int y = -1);
188
189MustHaveApp(wxGetNumberFromUser);
190long wxGetNumberFromUser(const wxString& message,
191 const wxString& prompt,
192 const wxString& caption,
193 long value,
194 long min = 0, long max = 100,
195 wxWindow *parent = NULL,
196 const wxPoint& pos = wxDefaultPosition);
197
198// GDI Functions
199
200MustHaveApp(wxColourDisplay);
201bool wxColourDisplay();
202
203MustHaveApp(wxDisplayDepth);
204int wxDisplayDepth();
205
206MustHaveApp(wxGetDisplayDepth);
207int wxGetDisplayDepth();
208
209MustHaveApp(wxDisplaySize);
210DocDeclA(
211 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
212 "DisplaySize() -> (width, height)");
213
214MustHaveApp(wxGetDisplaySize);
215wxSize wxGetDisplaySize();
216
217MustHaveApp(wxDisplaySizeMM);
218DocDeclA(
219 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
220 "DisplaySizeMM() -> (width, height)");
221
222MustHaveApp(wxGetDisplaySizeMM);
223wxSize wxGetDisplaySizeMM();
224
225MustHaveApp(wxClientDisplayRect);
226DocDeclA(
227 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
228 "ClientDisplayRect() -> (x, y, width, height)");
229
230MustHaveApp(wxGetClientDisplayRect);
231wxRect wxGetClientDisplayRect();
232
233
234MustHaveApp(wxSetCursor);
235void wxSetCursor(wxCursor& cursor);
236
237
238
239// Miscellaneous functions
240
241MustHaveApp(wxBeginBusyCursor);
242void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
243
244MustHaveApp(wxGetActiveWindow);
245wxWindow * wxGetActiveWindow();
246
247MustHaveApp(wxGenericFindWindowAtPoint);
248wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
249
250MustHaveApp(wxFindWindowAtPoint);
251wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
252
253MustHaveApp(wxGetTopLevelParent);
254wxWindow* wxGetTopLevelParent(wxWindow *win);
255
256//bool wxSpawnBrowser(wxWindow *parent, wxString href);
257
258
259
260
261MustHaveApp(wxGetKeyState);
262DocDeclStr(
263 bool , wxGetKeyState(wxKeyCode key),
264 "Get the state of a key (true if pressed or toggled on, false if not.)
265This is generally most useful getting the state of the modifier or
266toggle keys. On some platforms those may be the only keys that work.
267", "");
268
269
270
271//---------------------------------------------------------------------------
272
273MustHaveApp(wxWakeUpMainThread);
274
275#if defined(__WXMSW__) || defined(__WXMAC__)
276void wxWakeUpMainThread();
277#else
278%inline %{
279 void wxWakeUpMainThread() {}
280%}
281#endif
282
283
284MustHaveApp(wxMutexGuiEnter);
285void wxMutexGuiEnter();
286
287MustHaveApp(wxMutexGuiLeave);
288void wxMutexGuiLeave();
289
290
291MustHaveApp(wxMutexGuiLocker);
292class wxMutexGuiLocker {
293public:
294 wxMutexGuiLocker();
295 ~wxMutexGuiLocker();
296};
297
298
299MustHaveApp(wxThread);
300%inline %{
301 bool wxThread_IsMain() {
302#ifdef WXP_WITH_THREAD
303 return wxThread::IsMain();
304#else
305 return True;
306#endif
307 }
308%}
309
310//---------------------------------------------------------------------------
311//---------------------------------------------------------------------------