1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for various functions and such
7 // Created: 3-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 DECLARE_DEF_STRING(FileSelectorPromptStr);
20 DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
21 DECLARE_DEF_STRING(DirSelectorPromptStr);
24 //---------------------------------------------------------------------------
29 void wxRegisterId(long id);
30 long wxGetCurrentId();
33 void wxEndBusyCursor();
35 long wxGetElapsedTime(bool resetTimer = True);
38 void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
39 "GetMousePosition() -> (x,y)");
43 bool wxShell(const wxString& command = wxPyEmptyString);
47 int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
48 "GetOsVersion() -> (platform, major, minor)");
50 wxString wxGetOsDescription();
52 #if defined(__WXMSW__) || defined(__WXMAC__)
53 long wxGetFreeMemory();
56 long wxGetFreeMemory()
57 { PyErr_SetNone(PyExc_NotImplementedError); return 0; }
63 wxSHUTDOWN_POWEROFF, // power off the computer
64 wxSHUTDOWN_REBOOT // shutdown and reboot
67 // Shutdown or reboot the PC
68 bool wxShutdown(wxShutdownFlags wFlags);
71 void wxSleep(int secs);
72 void wxUsleep(unsigned long milliseconds);
73 void wxEnableTopLevelWindows(bool enable);
75 wxString wxStripMenuCodes(const wxString& in);
78 wxString wxGetEmailAddress();
79 wxString wxGetHostName();
80 wxString wxGetFullHostName();
81 wxString wxGetUserId();
82 wxString wxGetUserName();
83 wxString wxGetHomeDir();
84 wxString wxGetUserHome(const wxString& user = wxPyEmptyString);
86 unsigned long wxGetProcessId();
93 wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr,
94 const wxString& default_path = wxPyEmptyString,
95 const wxString& default_filename = wxPyEmptyString,
96 const wxString& default_extension = wxPyEmptyString,
97 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
99 wxWindow *parent = NULL,
100 int x = -1, int y = -1);
102 // TODO: wxFileSelectorEx
105 // Ask for filename to load
106 wxString wxLoadFileSelector(const wxString& what,
107 const wxString& extension,
108 const wxString& default_name = wxPyEmptyString,
109 wxWindow *parent = NULL);
111 // Ask for filename to save
112 wxString wxSaveFileSelector(const wxString& what,
113 const wxString& extension,
114 const wxString& default_name = wxPyEmptyString,
115 wxWindow *parent = NULL);
118 wxString wxDirSelector(const wxString& message = wxPyDirSelectorPromptStr,
119 const wxString& defaultPath = wxPyEmptyString,
120 long style = wxDD_DEFAULT_STYLE,
121 const wxPoint& pos = wxDefaultPosition,
122 wxWindow *parent = NULL);
124 wxString wxGetTextFromUser(const wxString& message,
125 const wxString& caption = wxPyEmptyString,
126 const wxString& default_value = wxPyEmptyString,
127 wxWindow *parent = NULL,
128 int x = -1, int y = -1,
131 wxString wxGetPasswordFromUser(const wxString& message,
132 const wxString& caption = wxPyEmptyString,
133 const wxString& default_value = wxPyEmptyString,
134 wxWindow *parent = NULL);
137 // TODO: Need to custom wrap this one...
138 // int wxGetMultipleChoice(char* message, char* caption,
139 // int LCOUNT, char** choices,
140 // int nsel, int *selection,
141 // wxWindow *parent = NULL, int x = -1, int y = -1,
142 // bool centre = True, int width=150, int height=200);
145 wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
146 int choices, wxString* choices_array,
147 wxWindow *parent = NULL,
148 int x = -1, int y = -1,
150 int width=150, int height=200);
152 int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
153 int choices, wxString* choices_array,
154 wxWindow *parent = NULL,
155 int x = -1, int y = -1,
157 int width=150, int height=200);
160 int wxMessageBox(const wxString& message,
161 const wxString& caption = wxPyEmptyString,
162 int style = wxOK | wxCENTRE,
163 wxWindow *parent = NULL,
164 int x = -1, int y = -1);
166 long wxGetNumberFromUser(const wxString& message,
167 const wxString& prompt,
168 const wxString& caption,
170 long min = 0, long max = 100,
171 wxWindow *parent = NULL,
172 const wxPoint& pos = wxDefaultPosition);
176 bool wxColourDisplay();
178 int wxDisplayDepth();
179 int wxGetDisplayDepth();
182 void, wxDisplaySize(int* OUTPUT, int* OUTPUT),
183 "DisplaySize() -> (width, height)");
184 wxSize wxGetDisplaySize();
187 void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT),
188 "DisplaySizeMM() -> (width, height)");
189 wxSize wxGetDisplaySizeMM();
192 void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
193 "ClientDisplayRect() -> (x, y, width, height)");
194 wxRect wxGetClientDisplayRect();
196 void wxSetCursor(wxCursor& cursor);
200 // Miscellaneous functions
202 void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
203 wxWindow * wxGetActiveWindow();
205 wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
206 wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
208 wxWindow* wxGetTopLevelParent(wxWindow *win);
210 //bool wxSpawnBrowser(wxWindow *parent, wxString href);
214 #if defined(__WXMSW__) || defined(__WXMAC__)
215 // Get the state of a key (true if pressed, false if not)
216 // This is generally most useful getting the state of
217 // Caps Lock, Num Lock and Scroll Lock...
218 bool wxGetKeyState(wxKeyCode key);
222 //---------------------------------------------------------------------------
224 #if defined(__WXMSW__) || defined(__WXMAC__)
225 void wxWakeUpMainThread();
228 void wxWakeUpMainThread() {}
232 void wxMutexGuiEnter();
233 void wxMutexGuiLeave();
236 class wxMutexGuiLocker {
244 bool wxThread_IsMain() {
245 #ifdef WXP_WITH_THREAD
246 return wxThread::IsMain();
253 //---------------------------------------------------------------------------
254 //---------------------------------------------------------------------------