X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..83b18bab391d242907d18b4b040720eae6202f76:/wxPython/src/misc2.i diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 7a7f49ad58..e68acb89f9 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -21,6 +21,8 @@ #include #include #include +#include +#include %} //---------------------------------------------------------------------- @@ -34,6 +36,11 @@ %import misc.i %import gdi.i %import events.i +%import streams.i + +%{ + static wxString wxPyEmptyStr(""); +%} //--------------------------------------------------------------------------- // Dialog Functions @@ -54,6 +61,11 @@ wxString wxGetTextFromUser(const wxString& message, int x = -1, int y = -1, bool centre = TRUE); +wxString wxGetPasswordFromUser(const wxString& message, + const wxString& caption = wxPyEmptyStr, + const wxString& default_value = wxPyEmptyStr, + wxWindow *parent = NULL); + // TODO: Need to custom wrap this one... // int wxGetMultipleChoice(char* message, char* caption, @@ -90,13 +102,22 @@ long wxGetNumberFromUser(const wxString& message, long value, long min = 0, long max = 100, wxWindow *parent = NULL, - const wxPoint& pos = wxPyDefaultPosition); + const wxPoint& pos = wxDefaultPosition); //--------------------------------------------------------------------------- // GDI Functions bool wxColourDisplay(); + int wxDisplayDepth(); +int wxGetDisplayDepth(); + +void wxDisplaySize(int* OUTPUT, int* OUTPUT); +wxSize wxGetDisplaySize(); + +void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT); +wxSize wxGetDisplaySizeMM(); + void wxSetCursor(wxCursor& cursor); //---------------------------------------------------------------------- @@ -353,9 +374,19 @@ public: //---------------------------------------------------------------------- +class wxWindowDisabler { +public: + wxWindowDisabler(wxWindow *winToSkip = NULL); + ~wxWindowDisabler(); +}; + +//---------------------------------------------------------------------- + void wxPostEvent(wxEvtHandler *dest, wxEvent& event); void wxWakeUpIdle(); +bool wxSafeYield(wxWindow* win=NULL); + //---------------------------------------------------------------------- @@ -597,6 +628,125 @@ void wxLogStatus(const char *szFormat); void wxLogSysError(const char *szFormat); + +//---------------------------------------------------------------------- + + +enum { + /* event type */ + wxEVT_END_PROCESS +}; + + +class wxProcessEvent : public wxEvent { +public: + wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0); + int GetPid(); + int GetExitCode(); + int m_pid, m_exitcode; +}; + + + + +%{ // C++ version of wxProcess derived class + +class wxPyProcess : public wxProcess { +public: + wxPyProcess(wxEvtHandler *parent = NULL, int id = -1) + : wxProcess(parent, id) + {} + + DEC_PYCALLBACK_VOID_INTINT(OnTerminate); + + PYPRIVATE; +}; + +IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate); +%} + + +%name(wxProcess)class wxPyProcess : public wxEvtHandler { +public: + wxPyProcess(wxEvtHandler *parent = NULL, int id = -1); + %addmethods { void Destroy() { delete self; } } + + void _setSelf(PyObject* self, PyObject* _class); + %pragma(python) addtomethod = "__init__:self._setSelf(self, wxProcess)" + + void base_OnTerminate(int pid, int status); + + void Redirect(); + bool IsRedirected(); + void Detach(); + + wxInputStream *GetInputStream(); + wxInputStream *GetErrorStream(); + wxOutputStream *GetOutputStream(); + + void CloseOutput(); +}; + + + +long wxExecute(const wxString& command, + int sync = FALSE, + wxPyProcess *process = NULL); + +//---------------------------------------------------------------------- + +#ifdef __WXMSW__ +class wxJoystick { +public: + wxJoystick(int joystick = wxJOYSTICK1); + wxPoint GetPosition(); + int GetZPosition(); + int GetButtonState(); + int GetPOVPosition(); + int GetPOVCTSPosition(); + int GetRudderPosition(); + int GetUPosition(); + int GetVPosition(); + int GetMovementThreshold(); + void SetMovementThreshold(int threshold) ; + + bool IsOk(void); + int GetNumberJoysticks(); + int GetManufacturerId(); + int GetProductId(); + wxString GetProductName(); + int GetXMin(); + int GetYMin(); + int GetZMin(); + int GetXMax(); + int GetYMax(); + int GetZMax(); + int GetNumberButtons(); + int GetNumberAxes(); + int GetMaxButtons(); + int GetMaxAxes(); + int GetPollingMin(); + int GetPollingMax(); + int GetRudderMin(); + int GetRudderMax(); + int GetUMin(); + int GetUMax(); + int GetVMin(); + int GetVMax(); + + bool HasRudder(); + bool HasZ(); + bool HasU(); + bool HasV(); + bool HasPOV(); + bool HasPOV4Dir(); + bool HasPOVCTS(); + + bool SetCapture(wxWindow* win, int pollingFreq = 0); + bool ReleaseCapture(); +}; +#endif + //---------------------------------------------------------------------- //----------------------------------------------------------------------