- Shows a message box with the information about the wxWidgets build used,
- including its version, most important build parameters and the version of the
- underlying GUI toolkit. This is mainly used for diagnostic purposes and can be
- invoked by Ctrl-Alt-middle clicking on any wxWindow which doesn't otherwise
- handle this event.
-
- @wxsince{2.9.0}
-*/
-void wxInfoMessageBox(wxWindow ( parent = NULL);
-
- /**
- Find a menu item identifier associated with the given frame's menu bar.
- */
- int wxFindMenuItemId(wxFrame* frame, const wxString& menuString,
- const wxString& itemString);
-
- /**
- This function enables or disables all top level windows. It is used by
- ::wxSafeYield.
- */
- void wxEnableTopLevelWindows(bool enable = true);
-
- /**
- Strips any menu codes from @a str and returns the result.
- By default, the functions strips both the mnemonics character (@c '')
- which is used to indicate a keyboard shortkey, and the accelerators, which are
- used only in the menu items and are separated from the main text by the
- @c \t (TAB) character. By using @a flags of
- @c wxStrip_Mnemonics or @c wxStrip_Accel to strip only the former
- or the latter part, respectively.
- Notice that in most cases
- wxMenuItem::GetLabelFromText or
- wxControl::GetLabelText can be used instead.
- */
- wxString wxStripMenuCodes(const wxString& str,
- int flags = wxStrip_All);
-
- /**
- @b NB: This function is now obsolete, please use wxLogError()
- instead.
- Displays @a msg and continues. This writes to standard error under
- Unix, and pops up a message box under Windows. Used for internal
- wxWidgets errors. See also wxFatalError().
- */
- void wxError(const wxString& msg,
- const wxString& title = "wxWidgets Internal Error");
-
- /**
- Open the @a url in user's default browser. If @a flags parameter contains
- @c wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL
- (currently this is only supported under Windows). The @a url may also be a
- local file path (with or without @c file:// prefix), if it doesn't
- correspond to an existing file and the URL has no scheme @c http:// is
- prepended to it by default.
- Returns @true if the application was successfully launched.
- Note that for some configurations of the running user, the application which
- is launched to open the given URL may be URL-dependent (e.g. a browser may be
- used for
- local URLs while another one may be used for remote URLs).
- */
- bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0);
-
- /**
- Executes a command in an interactive shell window. If no command is
- specified, then just the shell is spawned.
- See also wxExecute(), @ref overview_sampleexec "Exec sample".
- */
- bool wxShell(const wxString& command = NULL);
-
- /**
- Gets the version and the operating system ID for currently running OS.
- See wxPlatformInfo for more details about wxOperatingSystemId.
-
- @see ::wxGetOsDescription, wxPlatformInfo
- */
- wxOperatingSystemId wxGetOsVersion(int* major = NULL,
- int* minor = NULL);
-
- /**
- Returns the FQDN (fully qualified domain host name) or an empty string on
- error.
-
- @see wxGetHostName()
- */
- wxString wxGetFullHostName();
-
- /**
- Changes the cursor to the given cursor for all windows in the application.
- Use wxEndBusyCursor() to revert the cursor back
- to its previous state. These two calls can be nested, and a counter
- ensures that only the outer calls take effect.
- See also wxIsBusy(), wxBusyCursor.
- */
- void wxBeginBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
-
- /**
- Tells the system to delete the specified object when
- all other events have been processed. In some environments, it is
- necessary to use this instead of deleting a frame directly with the
- delete operator, because some GUIs will still send events to a deleted window.
- Now obsolete: use wxWindow::Close instead.
- */
- void wxPostDelete(wxObject* object);
-
- /**
- @b NB: This function is obsolete, please use
- wxWindow::FindWindowByLabel instead.
- Find a window by its label. Depending on the type of window, the label may be a
- window title
- or panel item label. If @a parent is @NULL, the search will start from all
- top-level
- frames and dialog boxes; if non-@NULL, the search will be limited to the given
- window hierarchy.
- The search is recursive in both cases.
- */
- wxWindow* wxFindWindowByLabel(const wxString& label,
- wxWindow* parent = NULL);
-
- /**
- This function is similar to wxYield, except that it disables the user input to
- all program windows before calling wxYield and re-enables it again
- afterwards. If @a win is not @NULL, this window will remain enabled,
- allowing the implementation of some limited user interaction.
- Returns the result of the call to ::wxYield.
- */
- bool wxSafeYield(wxWindow* win = NULL, bool onlyIfNeeded = false);
-
- /**
- Returns the mouse position in screen coordinates.
- */
- wxPoint wxGetMousePosition();
-
- /**
- Loads a user-defined Windows resource as a string. If the resource is found,
- the function creates
- a new character array and copies the data into it. A pointer to this data is
- returned. If unsuccessful, @NULL is returned.
- The resource must be defined in the @c .rc file using the following syntax:
-
- @code
- myResource TEXT file.ext
- @endcode
-
- where @c file.ext is a file that the resource compiler can find.
- This function is available under Windows only.
- */
- wxString wxLoadUserResource(const wxString& resourceName,
- const wxString& resourceType = "TEXT");
-
- /**
- Returns the amount of free memory in bytes under environments which
- support it, and -1 if not supported or failed to perform measurement.
- */
- wxMemorySize wxGetFreeMemory();
-
- /**
- This is a macro defined as @c getenv() or its wide char version in Unicode
- mode.
- Note that under Win32 it may not return correct value for the variables set
- with wxSetEnv(), use wxGetEnv() function
- instead.
- */
- wxChar* wxGetEnv(const wxString& var);
+ Returns the home directory for the given user. If the @a user is empty
+ (default value), this function behaves like wxGetHomeDir() (i.e. returns
+ the current user home directory).
+
+ If the home directory couldn't be determined, an empty string is returned.
+
+ @header{wx/utils.h}
+*/
+wxString wxGetUserHome(const wxString& user = "");
+
+/**
+ This function returns the "user id" also known as "login name" under Unix
+ (i.e. something like "jsmith"). It uniquely identifies the current user (on
+ this system). Under Windows or NT, this function first looks in the
+ environment variables USER and LOGNAME; if neither of these is found, the
+ entry @b UserId in the @b wxWidgets section of the WIN.INI file is tried.
+
+ @returns The login name if successful or an empty string otherwise.
+
+ @see wxGetUserName()
+
+ @header{wx/utils.h}
+*/
+wxString wxGetUserId();
+
+/**
+ @deprecated Use wxGetUserId() instead.
+
+ @param buf Buffer to store the login name in.
+ @param sz Size of the buffer.
+
+ @returns @true if successful, @false otherwise.
+
+ @header{wx/utils.h}
+*/
+bool wxGetUserId(char* buf, int sz);
+
+/**
+ This function returns the full user name (something like "Mr. John Smith").
+
+ Under Windows or NT, this function looks for the entry UserName in the
+ wxWidgets section of the WIN.INI file. If PenWindows is running, the entry
+ Current in the section User of the PENWIN.INI file is used.
+
+ @returns The full user name if successful or an empty string otherwise.
+
+ @see wxGetUserId()
+
+ @header{wx/utils.h}
+*/
+wxString wxGetUserName();
+
+/**
+ @deprecated Use wxGetUserName() instead.
+
+ @param buf Buffer to store the full user name in.
+ @param sz Size of the buffer.
+
+ @returns @true if successful, @false otherwise.
+
+ @header{wx/utils.h}
+*/
+bool wxGetUserName(char* buf, int sz);
+
+/**
+ Returns the string containing the description of the current platform in a
+ user-readable form. For example, this function may return strings like
+ "Windows NT Version 4.0" or "Linux 2.2.2 i386".
+
+ @see wxGetOsVersion()
+
+ @header{wx/utils.h}
+*/
+wxString wxGetOsDescription();
+
+/**
+ Gets the version and the operating system ID for currently running OS. See
+ wxPlatformInfo for more details about wxOperatingSystemId.
+
+ @see wxGetOsDescription(), wxPlatformInfo
+
+ @header{wx/utils.h}
+*/
+wxOperatingSystemId wxGetOsVersion(int* major = NULL, int* minor = NULL);
+
+/**
+ Returns @true if the operating system the program is running under is 64
+ bit. The check is performed at run-time and may differ from the value
+ available at compile-time (at compile-time you can just check if
+ <tt>sizeof(void*) == 8</tt>) since the program could be running in
+ emulation mode or in a mixed 32/64 bit system (bi-architecture operating
+ system).
+
+ @note This function is not 100% reliable on some systems given the fact
+ that there isn't always a standard way to do a reliable check on the
+ OS architecture.
+
+ @header{wx/utils.h}
+*/
+bool wxIsPlatform64Bit();
+
+/**
+ Returns @true if the current platform is little endian (instead of big
+ endian). The check is performed at run-time.
+
+ @see @ref group_funcmacro_byteorder "Byte Order Functions and Macros"
+
+ @header{wx/utils.h}
+*/
+bool wxIsPlatformLittleEndian();