Give wxSafeYield an onlyIfNeeded parameter
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -371,7 +371,8 @@ call to this function.
|
||||
|
||||
\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
|
||||
|
@@ -370,7 +370,7 @@ WXDLLEXPORT bool wxYield();
|
||||
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);
|
||||
|
@@ -872,10 +872,13 @@ wxWindowDisabler::~wxWindowDisabler()
|
||||
|
||||
// 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);
|
||||
|
||||
if (onlyIfNeeded)
|
||||
bool rc = wxYieldIfNeeded();
|
||||
else
|
||||
bool rc = wxYield();
|
||||
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user