]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/_functions.i
Added Bakefile conditions used by recently updated samples/dialogs/Makefile.in
[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 wxParseWildcard(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 wxUsleep(unsigned long milliseconds);
84void wxEnableTopLevelWindows(bool enable);
85
86wxString wxStripMenuCodes(const wxString& in);
87
88
89wxString wxGetEmailAddress();
90wxString wxGetHostName();
91wxString wxGetFullHostName();
92wxString wxGetUserId();
93wxString wxGetUserName();
94wxString wxGetHomeDir();
95wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
96
97unsigned long wxGetProcessId();
98
99void wxTrap();
100
101
102// Dialog Functions
103
104MustHaveApp(wxFileSelector);
105wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
106 const wxString& default_path = wxPyEmptyString,
107 const wxString& default_filename = wxPyEmptyString,
108 const wxString& default_extension = wxPyEmptyString,
109 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
110 int flags = 0,
111 wxWindow *parent = NULL,
112 int x = -1, int y = -1);
113
114// TODO: wxFileSelectorEx
115
116
117// Ask for filename to load
118MustHaveApp(wxLoadFileSelector);
119wxString wxLoadFileSelector(const wxString& what,
120 const wxString& extension,
121 const wxString& default_name = wxPyEmptyString,
122 wxWindow *parent = NULL);
123
124// Ask for filename to save
125MustHaveApp(wxSaveFileSelector);
126wxString wxSaveFileSelector(const wxString& what,
127 const wxString& extension,
128 const wxString& default_name = wxPyEmptyString,
129 wxWindow *parent = NULL);
130
131
132MustHaveApp(wxDirSelector);
133wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
134 const wxString& defaultPath = wxPyEmptyString,
135 long style = wxDD_DEFAULT_STYLE,
136 const wxPoint& pos = wxDefaultPosition,
137 wxWindow *parent = NULL);
138
139MustHaveApp(wxGetTextFromUser);
140wxString wxGetTextFromUser(const wxString& message,
141 const wxString& caption = wxPyEmptyString,
142 const wxString& default_value = wxPyEmptyString,
143 wxWindow *parent = NULL,
144 int x = -1, int y = -1,
145 bool centre = True);
146
147MustHaveApp(wxGetPasswordFromUser);
148wxString wxGetPasswordFromUser(const wxString& message,
149 const wxString& caption = wxPyEmptyString,
150 const wxString& default_value = wxPyEmptyString,
151 wxWindow *parent = NULL);
152
153
154// TODO: Need to custom wrap this one...
155// int wxGetMultipleChoice(char* message, char* caption,
156// int LCOUNT, char** choices,
157// int nsel, int *selection,
158// wxWindow *parent = NULL, int x = -1, int y = -1,
159// bool centre = True, int width=150, int height=200);
160
161
162MustHaveApp(wxGetSingleChoice);
163wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
164 int choices, wxString* choices_array,
165 wxWindow *parent = NULL,
166 int x = -1, int y = -1,
167 bool centre = True,
168 int width=150, int height=200);
169
170MustHaveApp(wxGetSingleChoiceIndex);
171int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
172 int choices, wxString* choices_array,
173 wxWindow *parent = NULL,
174 int x = -1, int y = -1,
175 bool centre = True,
176 int width=150, int height=200);
177
178
179MustHaveApp(wxMessageBox);
180int wxMessageBox(const wxString& message,
181 const wxString& caption = wxPyEmptyString,
182 int style = wxOK | wxCENTRE,
183 wxWindow *parent = NULL,
184 int x = -1, int y = -1);
185
186MustHaveApp(wxGetNumberFromUser);
187long wxGetNumberFromUser(const wxString& message,
188 const wxString& prompt,
189 const wxString& caption,
190 long value,
191 long min = 0, long max = 100,
192 wxWindow *parent = NULL,
193 const wxPoint& pos = wxDefaultPosition);
194
195// GDI Functions
196
197MustHaveApp(wxColourDisplay);
198bool wxColourDisplay();
199
200MustHaveApp(wxDisplayDepth);
201int wxDisplayDepth();
202
203MustHaveApp(wxGetDisplayDepth);
204int wxGetDisplayDepth();
205
206MustHaveApp(wxDisplaySize);
207DocDeclA(
208 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
209 "DisplaySize() -> (width, height)");
210
211MustHaveApp(wxGetDisplaySize);
212wxSize wxGetDisplaySize();
213
214MustHaveApp(wxDisplaySizeMM);
215DocDeclA(
216 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
217 "DisplaySizeMM() -> (width, height)");
218
219MustHaveApp(wxGetDisplaySizeMM);
220wxSize wxGetDisplaySizeMM();
221
222MustHaveApp(wxClientDisplayRect);
223DocDeclA(
224 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
225 "ClientDisplayRect() -> (x, y, width, height)");
226
227MustHaveApp(wxGetClientDisplayRect);
228wxRect wxGetClientDisplayRect();
229
230
231MustHaveApp(wxSetCursor);
232void wxSetCursor(wxCursor& cursor);
233
234
235
236// Miscellaneous functions
237
238MustHaveApp(wxBeginBusyCursor);
239void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
240
241MustHaveApp(wxGetActiveWindow);
242wxWindow * wxGetActiveWindow();
243
244MustHaveApp(wxGenericFindWindowAtPoint);
245wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
246
247MustHaveApp(wxFindWindowAtPoint);
248wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
249
250MustHaveApp(wxGetTopLevelParent);
251wxWindow* wxGetTopLevelParent(wxWindow *win);
252
253//bool wxSpawnBrowser(wxWindow *parent, wxString href);
254
255
256
257
258MustHaveApp(wxGetKeyState);
259DocDeclStr(
260 bool , wxGetKeyState(wxKeyCode key),
261 "Get the state of a key (true if pressed or toggled on, false if not.)
262This is generally most useful getting the state of the modifier or
263toggle keys. On some platforms those may be the only keys that work.
264", "");
265
266
267
268//---------------------------------------------------------------------------
269
270MustHaveApp(wxWakeUpMainThread);
271
272#if defined(__WXMSW__) || defined(__WXMAC__)
273void wxWakeUpMainThread();
274#else
275%inline %{
276 void wxWakeUpMainThread() {}
277%}
278#endif
279
280
281MustHaveApp(wxMutexGuiEnter);
282void wxMutexGuiEnter();
283
284MustHaveApp(wxMutexGuiLeave);
285void wxMutexGuiLeave();
286
287
288MustHaveApp(wxMutexGuiLocker);
289class wxMutexGuiLocker {
290public:
291 wxMutexGuiLocker();
292 ~wxMutexGuiLocker();
293};
294
295
296MustHaveApp(wxThread);
297%inline %{
298 bool wxThread_IsMain() {
299#ifdef WXP_WITH_THREAD
300 return wxThread::IsMain();
301#else
302 return True;
303#endif
304 }
305%}
306
307//---------------------------------------------------------------------------
308//---------------------------------------------------------------------------