X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/18fd783ca852e77288a49bfdc9952e2035b4f312..33d28952b29818b6931d91984a7b612a072d843d:/include/wx/utils.h diff --git a/include/wx/utils.h b/include/wx/utils.h index 8c55231237..c18128a791 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -24,7 +24,7 @@ #include "wx/ioswrap.h" -class wxProcess; +class WXDLLEXPORT wxProcess; #ifdef __X__ #ifndef __VMS__ @@ -49,13 +49,13 @@ class WXDLLEXPORT wxFrame; #define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C)) // Return a string with the current date/time -WXDLLEXPORT wxString wxNow(void); +WXDLLEXPORT wxString wxNow(); // Make a copy of this string using 'new' WXDLLEXPORT char* copystring(const char *s); // Generate a unique ID -WXDLLEXPORT long wxNewId(void); +WXDLLEXPORT long wxNewId(); #define NewId wxNewId // Ensure subsequent IDs don't clash with this one @@ -63,7 +63,7 @@ WXDLLEXPORT void wxRegisterId(long id); #define RegisterId wxRegisterId // Return the current ID -WXDLLEXPORT long wxGetCurrentId(void); +WXDLLEXPORT long wxGetCurrentId(); // Useful buffer WXDLLEXPORT_DATA(extern char*) wxBuffer; @@ -111,11 +111,14 @@ WXDLLEXPORT bool wxShell(const wxString& command = wxEmptyString); // Sleep for nSecs seconds under UNIX, do nothing under Windows WXDLLEXPORT void wxSleep(int nSecs); +// Sleep for a given amount of milliseconds +WXDLLEXPORT void wxUsleep(unsigned long milliseconds); + // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -WXDLLEXPORT long wxGetFreeMemory(void); +WXDLLEXPORT long wxGetFreeMemory(); // Consume all events until no more left -WXDLLEXPORT void wxFlushEvents(void); +WXDLLEXPORT void wxFlushEvents(); /* * Network and username functions. @@ -166,7 +169,10 @@ WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, con #define wxMin(a,b) (((a) < (b)) ? (a) : (b)) // Yield to other apps/messages -WXDLLEXPORT bool wxYield(void); +WXDLLEXPORT bool wxYield(); + +// Yield to other apps/messages and disable user input +WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL); // Format a message on the standard error (UNIX) or the debugging // stream (Windows) @@ -184,20 +190,22 @@ WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); // Restore cursor to normal -WXDLLEXPORT void wxEndBusyCursor(void); +WXDLLEXPORT void wxEndBusyCursor(); // TRUE if we're between the above two calls -WXDLLEXPORT bool wxIsBusy(void); +WXDLLEXPORT bool wxIsBusy(); // Convenience class so we can just create a wxBusyCursor object on the stack class WXDLLEXPORT wxBusyCursor { - public: - inline wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) { wxBeginBusyCursor(cursor); } - inline ~wxBusyCursor() { wxEndBusyCursor(); } +public: + wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) + { wxBeginBusyCursor(cursor); } + ~wxBusyCursor() + { wxEndBusyCursor(); } }; -/* Error message functions used by wxWindows */ +// Error message functions used by wxWindows // Non-fatal error (continues) WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;