]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_functions.i
Docstrings
[wxWidgets.git] / wxPython / src / _functions.i
CommitLineData
d14a1e28
RD
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
b2dc1044
RD
18MAKE_CONST_WXSTRING(FileSelectorPromptStr);
19MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
20MAKE_CONST_WXSTRING(DirSelectorPromptStr);
d14a1e28
RD
21
22//---------------------------------------------------------------------------
23%newgroup;
24
25
26long wxNewId();
27void wxRegisterId(long id);
28long wxGetCurrentId();
29
30void wxBell();
31void wxEndBusyCursor();
32
dd9f7fea 33long wxGetElapsedTime(bool resetTimer = True);
322913ce
RD
34
35DocDeclA(
36 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
37 "GetMousePosition() -> (x,y)");
38
d14a1e28
RD
39bool wxIsBusy();
40wxString wxNow();
41bool wxShell(const wxString& command = wxPyEmptyString);
42void wxStartTimer();
322913ce
RD
43
44DocDeclA(
45 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
46 "GetOsVersion() -> (platform, major, minor)");
47
d14a1e28
RD
48wxString wxGetOsDescription();
49
50#if defined(__WXMSW__) || defined(__WXMAC__)
51long wxGetFreeMemory();
52#else
53%inline %{
54 long wxGetFreeMemory()
81cfe5e1 55 { wxPyRaiseNotImplemented(); return 0; }
d14a1e28
RD
56%}
57#endif
58
59enum wxShutdownFlags
60{
61 wxSHUTDOWN_POWEROFF, // power off the computer
62 wxSHUTDOWN_REBOOT // shutdown and reboot
63};
64
65// Shutdown or reboot the PC
66bool wxShutdown(wxShutdownFlags wFlags);
67
68
69void wxSleep(int secs);
70void wxUsleep(unsigned long milliseconds);
71void wxEnableTopLevelWindows(bool enable);
72
73wxString wxStripMenuCodes(const wxString& in);
74
75
76wxString wxGetEmailAddress();
77wxString wxGetHostName();
78wxString wxGetFullHostName();
79wxString wxGetUserId();
80wxString wxGetUserName();
81wxString wxGetHomeDir();
82wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
83
84unsigned long wxGetProcessId();
85
86void wxTrap();
87
88
89// Dialog Functions
90
91wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
92 const wxString& default_path = wxPyEmptyString,
93 const wxString& default_filename = wxPyEmptyString,
94 const wxString& default_extension = wxPyEmptyString,
95 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
96 int flags = 0,
97 wxWindow *parent = NULL,
98 int x = -1, int y = -1);
99
100// TODO: wxFileSelectorEx
101
102
103// Ask for filename to load
104wxString wxLoadFileSelector(const wxString& what,
105 const wxString& extension,
106 const wxString& default_name = wxPyEmptyString,
107 wxWindow *parent = NULL);
108
109// Ask for filename to save
110wxString wxSaveFileSelector(const wxString& what,
111 const wxString& extension,
112 const wxString& default_name = wxPyEmptyString,
113 wxWindow *parent = NULL);
114
115
116wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
117 const wxString& defaultPath = wxPyEmptyString,
118 long style = wxDD_DEFAULT_STYLE,
119 const wxPoint& pos = wxDefaultPosition,
120 wxWindow *parent = NULL);
121
122wxString wxGetTextFromUser(const wxString& message,
123 const wxString& caption = wxPyEmptyString,
124 const wxString& default_value = wxPyEmptyString,
125 wxWindow *parent = NULL,
126 int x = -1, int y = -1,
dd9f7fea 127 bool centre = True);
d14a1e28
RD
128
129wxString wxGetPasswordFromUser(const wxString& message,
130 const wxString& caption = wxPyEmptyString,
131 const wxString& default_value = wxPyEmptyString,
132 wxWindow *parent = NULL);
133
134
135// TODO: Need to custom wrap this one...
136// int wxGetMultipleChoice(char* message, char* caption,
137// int LCOUNT, char** choices,
138// int nsel, int *selection,
139// wxWindow *parent = NULL, int x = -1, int y = -1,
dd9f7fea 140// bool centre = True, int width=150, int height=200);
d14a1e28
RD
141
142
143wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
144 int choices, wxString* choices_array,
145 wxWindow *parent = NULL,
146 int x = -1, int y = -1,
dd9f7fea 147 bool centre = True,
d14a1e28
RD
148 int width=150, int height=200);
149
150int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
151 int choices, wxString* choices_array,
152 wxWindow *parent = NULL,
153 int x = -1, int y = -1,
dd9f7fea 154 bool centre = True,
d14a1e28
RD
155 int width=150, int height=200);
156
157
158int wxMessageBox(const wxString& message,
159 const wxString& caption = wxPyEmptyString,
160 int style = wxOK | wxCENTRE,
161 wxWindow *parent = NULL,
162 int x = -1, int y = -1);
163
164long wxGetNumberFromUser(const wxString& message,
165 const wxString& prompt,
166 const wxString& caption,
167 long value,
168 long min = 0, long max = 100,
169 wxWindow *parent = NULL,
170 const wxPoint& pos = wxDefaultPosition);
171
172// GDI Functions
173
174bool wxColourDisplay();
175
176int wxDisplayDepth();
177int wxGetDisplayDepth();
178
322913ce
RD
179DocDeclA(
180 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
181 "DisplaySize() -> (width, height)");
d14a1e28
RD
182wxSize wxGetDisplaySize();
183
322913ce
RD
184DocDeclA(
185 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
186 "DisplaySizeMM() -> (width, height)");
d14a1e28
RD
187wxSize wxGetDisplaySizeMM();
188
322913ce
RD
189DocDeclA(
190 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
191 "ClientDisplayRect() -> (x, y, width, height)");
d14a1e28
RD
192wxRect wxGetClientDisplayRect();
193
194void wxSetCursor(wxCursor& cursor);
195
196
197
198// Miscellaneous functions
199
200void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
201wxWindow * wxGetActiveWindow();
202
203wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
204wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
205
206wxWindow* wxGetTopLevelParent(wxWindow *win);
207
208//bool wxSpawnBrowser(wxWindow *parent, wxString href);
209
210
211
89c876de 212
ad411ab2
RD
213DocDeclStr(
214 bool , wxGetKeyState(wxKeyCode key),
215 "Get the state of a key (true if pressed or toggled on, false if not.)
216This is generally most useful getting the state of the modifier or
217toggle keys. On some platforms those may be the only keys that work.
218", "");
219
57b1892f
RD
220
221
d14a1e28
RD
222//---------------------------------------------------------------------------
223
224#if defined(__WXMSW__) || defined(__WXMAC__)
225void wxWakeUpMainThread();
226#else
227%inline %{
228 void wxWakeUpMainThread() {}
229%}
230#endif
231
232void wxMutexGuiEnter();
233void wxMutexGuiLeave();
234
235
236class wxMutexGuiLocker {
237public:
238 wxMutexGuiLocker();
239 ~wxMutexGuiLocker();
240};
241
242
243%inline %{
244 bool wxThread_IsMain() {
245#ifdef WXP_WITH_THREAD
246 return wxThread::IsMain();
247#else
dd9f7fea 248 return True;
d14a1e28
RD
249#endif
250 }
251%}
252
253//---------------------------------------------------------------------------
254//---------------------------------------------------------------------------