- 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.
-
- This function is new since wxWidgets version 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 @e 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 @e 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 @e 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 @e url in user's default browser. If @e flags parameter contains
- @c wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL
- (currently this is only supported under Windows). The @e 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.
-
- @sa ::wxGetOsDescription, wxPlatformInfo
- */
- wxOperatingSystemId wxGetOsVersion(int * major = @NULL,
- int * minor = @NULL);
-
- /**
- Returns the FQDN (fully qualified domain host name) or an empty string on
- error.
-
- @sa 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 @e 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 @e 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);
+ Executes another program in Unix or Windows.
+
+ In the overloaded versions of this function, if @a flags parameter contains
+ @c wxEXEC_ASYNC flag (the default), flow of control immediately returns. If
+ it contains @c wxEXEC_SYNC, the current application waits until the other
+ program has terminated.
+
+ In the case of synchronous execution, the return value is the exit code of
+ the process (which terminates by the moment the function returns) and will
+ be -1 if the process couldn't be started and typically 0 if the process
+ terminated successfully. Also, while waiting for the process to terminate,
+ wxExecute() will call wxYield(). Because of this, by default this function
+ disables all application windows to avoid unexpected reentrancies which
+ could result from the users interaction with the program while the child
+ process is running. If you are sure that it is safe to not disable the
+ program windows, you may pass @c wxEXEC_NODISABLE flag to prevent this
+ automatic disabling from happening.
+
+ For asynchronous execution, however, the return value is the process id and
+ zero value indicates that the command could not be executed. As an added
+ complication, the return value of -1 in this case indicates that we didn't
+ launch a new process, but connected to the running one (this can only
+ happen when using DDE under Windows for command execution). In particular,
+ in this case only, the calling code will not get the notification about
+ process termination.
+
+ If @a callback isn't @NULL and if execution is asynchronous,
+ wxProcess::OnTerminate() will be called when the process finishes.
+ Specifying this parameter also allows you to redirect the standard input
+ and/or output of the process being launched by calling
+ wxProcess::Redirect(). If the child process IO is redirected, under Windows
+ the process window is not shown by default (this avoids having to flush an
+ unnecessary console for the processes which don't create any windows
+ anyhow) but a @c wxEXEC_NOHIDE flag can be used to prevent this from
+ happening, i.e. with this flag the child process window will be shown
+ normally.
+
+ Under Unix the flag @c wxEXEC_MAKE_GROUP_LEADER may be used to ensure that
+ the new process is a group leader (this will create a new session if
+ needed). Calling wxKill() passing wxKILL_CHILDREN will kill this process as
+ well as all of its children (except those which have started their own
+ session).
+
+ The @c wxEXEC_NOEVENTS flag prevents processing of any events from taking
+ place while the child process is running. It should be only used for very
+ short-lived processes as otherwise the application windows risk becoming
+ unresponsive from the users point of view. As this flag only makes sense
+ with @c wxEXEC_SYNC, @c wxEXEC_BLOCK equal to the sum of both of these
+ flags is provided as a convenience.
+
+ @note Currently wxExecute() can only be used from the main thread, calling
+ this function from another thread will result in an assert failure in
+ debug build and won't work.
+
+ @param command
+ The command to execute and any parameters to pass to it as a single
+ string, i.e. "emacs file.txt".
+ @param flags
+ Must include either wxEXEC_ASYNC or wxEXEC_SYNC and can also include
+ wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
+ wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
+ their combination, in wxEXEC_SYNC case.
+ @param callback
+ An optional pointer to wxProcess.
+
+ @see wxShell(), wxProcess, @ref page_samples_exec
+
+ @header{wx/utils.h}
+
+ @beginWxPerlOnly
+ This function is called @c Wx::ExecuteStdoutStderr and it only takes the
+ @a command argument, and returns a 3-element list (@c status, @c output,
+ @c errors), where @c output and @c errors are array references.
+ @endWxPerlOnly
+*/
+long wxExecute(const wxString& command, int flags = wxEXEC_ASYNC,
+ wxProcess* callback = NULL);