git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18278
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\membersection{::wxSafeYield}\label{wxsafeyield}
\membersection{::wxSafeYield}\label{wxsafeyield}
-\func{bool}{wxSafeYield}{\param{wxWindow*}{ win = NULL}}
+\func{bool}{wxSafeYield}{\param{wxWindow*}{ win = NULL}, \param{bool}{
+ onlyIfNeeded = FALSE}}
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
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
Calls \helpref{wxApp::Yield}{wxappyield}.
Calls \helpref{wxApp::Yield}{wxappyield}.
-This function is kept only for backwards compatibility. Please use
+This function is kept only for backwards compatibility. Please use
the \helpref{wxApp::Yield}{wxappyield} method instead in any new code.
\wxheading{Include files}
the \helpref{wxApp::Yield}{wxappyield} method instead in any new code.
\wxheading{Include files}
and only this, case the calling code will not get the notification about
process termination.
and only this, case the calling code will not get the notification about
process termination.
-If callback isn't NULL and if execution is asynchronous,
+If callback isn't NULL and if execution is asynchronous,
\helpref{wxProcess::OnTerminate}{wxprocessonterminate} will be called when
the process finishes. Specifying this parameter also allows you to redirect the
\helpref{wxProcess::OnTerminate}{wxprocessonterminate} 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
+standard input and/or output of the process being launched by calling
\helpref{Redirect}{wxprocessredirect}. 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
\helpref{Redirect}{wxprocessredirect}. 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
array, any additional ones are the command parameters and the array must be
terminated with a NULL pointer.}
array, any additional ones are the command parameters and the array must be
terminated with a NULL pointer.}
-\docparam{flags}{Combination of bit masks {\tt wxEXEC\_ASYNC},
+\docparam{flags}{Combination of bit masks {\tt wxEXEC\_ASYNC},
{\tt wxEXEC\_SYNC} and {\tt wxEXEC\_NOHIDE}}
\docparam{callback}{An optional pointer to \helpref{wxProcess}{wxprocess}}
{\tt wxEXEC\_SYNC} and {\tt wxEXEC\_NOHIDE}}
\docparam{callback}{An optional pointer to \helpref{wxProcess}{wxprocess}}
\func{bool}{wxShutdown}{\param{wxShutdownFlags}{flags}}
\func{bool}{wxShutdown}{\param{wxShutdownFlags}{flags}}
-This function shuts down or reboots the computer depending on the value of the
+This function shuts down or reboots the computer depending on the value of the
{\it flags}. Please notice that doing this requires the corresponding access
rights (superuser under Unix, {\tt SE\_SHUTDOWN} privelege under Windows NT)
and that this function is only implemented under Unix and Win32.
{\it flags}. Please notice that doing this requires the corresponding access
rights (superuser under Unix, {\tt SE\_SHUTDOWN} privelege under Windows NT)
and that this function is only implemented under Unix and Win32.
\func{char *}{wxFileNameFromPath}{\param{char *}{path}}
\func{char *}{wxFileNameFromPath}{\param{char *}{path}}
-{\bf NB:} This function is obsolete, please use
+{\bf NB:} This function is obsolete, please use
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
Returns the filename for a full path. The second form returns a pointer to
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
Returns the filename for a full path. The second form returns a pointer to
\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
-{\bf NB:} This function is obsolete, please use
+{\bf NB:} This function is obsolete, please use
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
This function splits a full file name into components: the path (including possible disk/drive
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
This function splits a full file name into components: the path (including possible disk/drive
\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
Returns the home directory for the given user. If the username is empty
\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
Returns the home directory for the given user. If the username is empty
-(default value), this function behaves like
+(default value), this function behaves like
\helpref{wxGetHomeDir}{wxgethomedir}.
\wxheading{Include files}
\helpref{wxGetHomeDir}{wxgethomedir}.
\wxheading{Include files}
\func{wxWindow *}{wxFindWindowByLabel}{\param{const wxString\& }{label}, \param{wxWindow *}{parent=NULL}}
\func{wxWindow *}{wxFindWindowByLabel}{\param{const wxString\& }{label}, \param{wxWindow *}{parent=NULL}}
-{\bf NB:} This function is obsolete, please use
+{\bf NB:} This function is obsolete, please use
\helpref{wxWindow::FindWindowByLabel}{wxwindowfindwindowbylabel} instead.
Find a window by its label. Depending on the type of window, the label may be a window title
\helpref{wxWindow::FindWindowByLabel}{wxwindowfindwindowbylabel} instead.
Find a window by its label. Depending on the type of window, the label may be a window title
\func{wxWindow *}{wxFindWindowByName}{\param{const wxString\& }{name}, \param{wxWindow *}{parent=NULL}}
\func{wxWindow *}{wxFindWindowByName}{\param{const wxString\& }{name}, \param{wxWindow *}{parent=NULL}}
-{\bf NB:} This function is obsolete, please use
+{\bf NB:} This function is obsolete, please use
\helpref{wxWindow::FindWindowByName}{wxwindowfindwindowbyname} instead.
Find a window by its name (as given in a window constructor or {\bf Create} function call).
\helpref{wxWindow::FindWindowByName}{wxwindowfindwindowbyname} instead.
Find a window by its name (as given in a window constructor or {\bf Create} function call).
\func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}}
\func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}}
-{\bf NB:} This function is obsolete, please use
+{\bf NB:} This function is obsolete, please use
\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead.
Strips any menu codes from {\it in} and places the result
\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead.
Strips any menu codes from {\it in} and places the result
\func{void}{wxError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Internal Error"}}
\func{void}{wxError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Internal Error"}}
-{\bf NB:} This function is now obsolete, please use \helpref{wxLogError}{wxlogerror}
+{\bf NB:} This function is now obsolete, please use \helpref{wxLogError}{wxlogerror}
instead.
Displays {\it msg} and continues. This writes to standard error under
instead.
Displays {\it msg} and continues. This writes to standard error under
\func{void}{wxFatalError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Fatal Error"}}
\func{void}{wxFatalError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Fatal Error"}}
-{\bf NB:} This function is now obsolete, please use
+{\bf NB:} This function is now obsolete, please use
\helpref{wxLogFatalError}{wxlogfatalerror} instead.
Displays {\it msg} and exits. This writes to standard error under Unix,
\helpref{wxLogFatalError}{wxlogfatalerror} instead.
Displays {\it msg} and exits. This writes to standard error under Unix,
This function shows a message to the user in a safe way and should be safe to
call even before the application has been initialized or if it is currently in
some other strange state (for example, about to crash). Under Windows this
This function shows a message to the user in a safe way and should be safe to
call even before the application has been initialized or if it is currently in
some other strange state (for example, about to crash). Under Windows this
-function shows a message box using a native dialog instead of
+function shows a message box using a native dialog instead of
\helpref{wxMessageBox}{wxmessagebox} (which might be unsafe to call), elsewhere
it simply prints the message to the standard output using the title as prefix.
\helpref{wxMessageBox}{wxmessagebox} (which might be unsafe to call), elsewhere
it simply prints the message to the standard output using the title as prefix.
To override the default behaviour in the debug builds which is to show the user
a dialog asking whether he wants to abort the program, continue or continue
To override the default behaviour in the debug builds which is to show the user
a dialog asking whether he wants to abort the program, continue or continue
-ignoring any subsequent assert failures, you may override
+ignoring any subsequent assert failures, you may override
\helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if
the global application object exists.
\helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if
the global application object exists.
\func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}}
\func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}}
\helpref{compile time assertion failure}{wxcompiletimeassert} if the size
of the given type {\it type} is less than {\it size} bits.
\helpref{compile time assertion failure}{wxcompiletimeassert} if the size
of the given type {\it type} is less than {\it size} bits.
the {\it msg} identifier - please note that it must be a valid C++ identifier
and not a string unlike in the other cases.
the {\it msg} identifier - please note that it must be a valid C++ identifier
and not a string unlike in the other cases.
-This macro is mostly useful for testing the expressions involving the
+This macro is mostly useful for testing the expressions involving the
{\tt sizeof} operator as they can't be tested by the preprocessor but it is
sometimes desirable to test them at the compile time.
Note that this macro internally declares a struct whose name it tries to make
unique by using the {\tt \_\_LINE\_\_} in it but it may still not work if you
use it on the same line in two different source files. In this case you may
{\tt sizeof} operator as they can't be tested by the preprocessor but it is
sometimes desirable to test them at the compile time.
Note that this macro internally declares a struct whose name it tries to make
unique by using the {\tt \_\_LINE\_\_} in it but it may still not work if you
use it on the same line in two different source files. In this case you may
-either change the line in which either of them appears on or use the
+either change the line in which either of them appears on or use the
\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} macro.
\wxheading{See also}
\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} macro.
\wxheading{See also}
\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}, \param{}{name}}
\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}, \param{}{name}}
-This macro is identical to \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}
+This macro is identical to \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}
except that it allows you to specify a unique {\it name} for the struct
internally defined by this macro to avoid getting the compilation errors
described \helpref{above}{wxcompiletimeassert}.
except that it allows you to specify a unique {\it name} for the struct
internally defined by this macro to avoid getting the compilation errors
described \helpref{above}{wxcompiletimeassert}.
WXDLLEXPORT bool wxYieldIfNeeded();
// Yield to other apps/messages and disable user input
WXDLLEXPORT bool wxYieldIfNeeded();
// Yield to other apps/messages and disable user input
-WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
+WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = FALSE);
// Enable or disable input to all top level windows
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE);
// Enable or disable input to all top level windows
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE);
// Yield to other apps/messages and disable user input to all windows except
// the given one
// Yield to other apps/messages and disable user input to all windows except
// the given one
-bool wxSafeYield(wxWindow *win)
+bool wxSafeYield(wxWindow *win, bool onlyIfNeeded = FALSE)
{
wxWindowDisabler wd(win);
{
wxWindowDisabler wd(win);
+ if (onlyIfNeeded)
+ bool rc = wxYieldIfNeeded();
+ else
+ bool rc = wxYield();
const wxChar *wxGetInstallPrefix()
{
wxString prefix;
const wxChar *wxGetInstallPrefix()
{
wxString prefix;
if ( wxGetEnv(wxT("WXPREFIX"), &prefix) )
return prefix.c_str();
if ( wxGetEnv(wxT("WXPREFIX"), &prefix) )
return prefix.c_str();
#ifdef wxINSTALL_PREFIX
return wxT(wxINSTALL_PREFIX);
#ifdef wxINSTALL_PREFIX
return wxT(wxINSTALL_PREFIX);