X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..5cd7ab8dd8af0c17ce9dad88830a8d7aefd4f73b:/wxPython/src/_functions.i diff --git a/wxPython/src/_functions.i b/wxPython/src/_functions.i index 8d56c0229c..aa33a105b9 100644 --- a/wxPython/src/_functions.i +++ b/wxPython/src/_functions.i @@ -15,11 +15,9 @@ //--------------------------------------------------------------------------- -%{ - DECLARE_DEF_STRING(FileSelectorPromptStr); - DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); - DECLARE_DEF_STRING(DirSelectorPromptStr); -%} +MAKE_CONST_WXSTRING(FileSelectorPromptStr); +MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr); +MAKE_CONST_WXSTRING(DirSelectorPromptStr); //--------------------------------------------------------------------------- %newgroup; @@ -32,13 +30,21 @@ long wxGetCurrentId(); void wxBell(); void wxEndBusyCursor(); -long wxGetElapsedTime(bool resetTimer = TRUE); -void wxGetMousePosition(int* OUTPUT, int* OUTPUT); +long wxGetElapsedTime(bool resetTimer = True); + +DocDeclA( + void, wxGetMousePosition(int* OUTPUT, int* OUTPUT), + "GetMousePosition() -> (x,y)"); + bool wxIsBusy(); wxString wxNow(); bool wxShell(const wxString& command = wxPyEmptyString); void wxStartTimer(); -int wxGetOsVersion(int *OUTPUT, int *OUTPUT); + +DocDeclA( + int, wxGetOsVersion(int *OUTPUT, int *OUTPUT), + "GetOsVersion() -> (platform, major, minor)"); + wxString wxGetOsDescription(); #if defined(__WXMSW__) || defined(__WXMAC__) @@ -46,7 +52,7 @@ long wxGetFreeMemory(); #else %inline %{ long wxGetFreeMemory() - { PyErr_SetNone(PyExc_NotImplementedError); return 0; } + { wxPyRaiseNotImplemented(); return 0; } %} #endif @@ -118,7 +124,7 @@ wxString wxGetTextFromUser(const wxString& message, const wxString& default_value = wxPyEmptyString, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = TRUE); + bool centre = True); wxString wxGetPasswordFromUser(const wxString& message, const wxString& caption = wxPyEmptyString, @@ -131,21 +137,21 @@ wxString wxGetPasswordFromUser(const wxString& message, // int LCOUNT, char** choices, // int nsel, int *selection, // wxWindow *parent = NULL, int x = -1, int y = -1, -// bool centre = TRUE, int width=150, int height=200); +// bool centre = True, int width=150, int height=200); wxString wxGetSingleChoice(const wxString& message, const wxString& caption, int choices, wxString* choices_array, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = TRUE, + bool centre = True, int width=150, int height=200); int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, int choices, wxString* choices_array, wxWindow *parent = NULL, int x = -1, int y = -1, - bool centre = TRUE, + bool centre = True, int width=150, int height=200); @@ -170,13 +176,19 @@ bool wxColourDisplay(); int wxDisplayDepth(); int wxGetDisplayDepth(); -void wxDisplaySize(int* OUTPUT, int* OUTPUT); +DocDeclA( + void, wxDisplaySize(int* OUTPUT, int* OUTPUT), + "DisplaySize() -> (width, height)"); wxSize wxGetDisplaySize(); -void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT); +DocDeclA( + void, wxDisplaySizeMM(int* OUTPUT, int* OUTPUT), + "DisplaySizeMM() -> (width, height)"); wxSize wxGetDisplaySizeMM(); -void wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT); +DocDeclA( + void, wxClientDisplayRect(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT), + "ClientDisplayRect() -> (x, y, width, height)"); wxRect wxGetClientDisplayRect(); void wxSetCursor(wxCursor& cursor); @@ -197,6 +209,19 @@ wxWindow* wxGetTopLevelParent(wxWindow *win); +#if defined(__WXMSW__) || defined(__WXMAC__) +// Get the state of a key (true if pressed, false if not) +// This is generally most useful getting the state of +// Caps Lock, Num Lock and Scroll Lock... +bool wxGetKeyState(wxKeyCode key); +#else +%inline %{ + bool wxGetKeyState(wxKeyCode key) + { wxPyRaiseNotImplemented(); return False; } +%} +#endif + + //--------------------------------------------------------------------------- #if defined(__WXMSW__) || defined(__WXMAC__) @@ -223,7 +248,7 @@ public: #ifdef WXP_WITH_THREAD return wxThread::IsMain(); #else - return TRUE; + return True; #endif } %}