X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6244848856584171db8cd74a7ff227250e46cc54..e35d0039d37b1b785aab12d8ef55507d7879c232:/include/wx/utils.h diff --git a/include/wx/utils.h b/include/wx/utils.h index 10fc015dd7..483e0caf07 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -133,12 +133,15 @@ WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize); // Get hostname. WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize); +WXDLLEXPORT bool wxGetHostName(wxString& buf); // Get user ID e.g. jacs WXDLLEXPORT bool wxGetUserId(char *buf, int maxSize); +WXDLLEXPORT bool wxGetUserId(wxString& buf); // Get user name e.g. Julian Smart WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize); +WXDLLEXPORT bool wxGetUserName(wxString& buf); /* * Strip out any menu codes @@ -157,46 +160,6 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent // Returns menu item id or -1 if none. WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); -// A debugging stream buffer. -// Under Windows, this writes to the Windows debug output. -// Under other platforms, it writes to cerr. - -// ALl this horrible gubbins required for Borland, because the calling -// convention needs to be the same as for streambuf. -// Thanks to Gerhard.Vogt@embl-heidelberg.de for this solution. - -#if defined(__BORLANDC__) && defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__) -#pragma option -po- -#endif - -// Can't export a class derived from a non-export class -#if !defined(_WINDLL) && !defined(WXUSINGDLL) - -// #ifdef new -// #undef new -// #endif - -class WXDLLEXPORT wxDebugStreamBuf: public streambuf -{ - public: - wxDebugStreamBuf(void); - ~wxDebugStreamBuf(void) {} - - int overflow(int i); - inline int underflow(void) { return EOF; } - int sync(void); -}; - -// #if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS -// #define new WXDEBUG_NEW -// #endif - -#endif - -#if defined(__BORLANDC__) && defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__) -#pragma option -po. -#endif - /* #if (!defined(__MINMAX_DEFINED) && !defined(max)) #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -204,6 +167,7 @@ class WXDLLEXPORT wxDebugStreamBuf: public streambuf #define __MINMAX_DEFINED 1 #endif */ + #define wxMax(a,b) (((a) > (b)) ? (a) : (b)) #define wxMin(a,b) (((a) < (b)) ? (a) : (b)) @@ -224,13 +188,21 @@ WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int * class WXDLLEXPORT wxCursor; WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); - + // Restore cursor to normal WXDLLEXPORT void wxEndBusyCursor(void); // TRUE if we're between the above two calls WXDLLEXPORT bool wxIsBusy(void); +// 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(); } +}; + /* Error message functions used by wxWindows */ // Non-fatal error (continues)