added wxApp::Yield
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,6 +61,8 @@ public:
|
||||
bool ProcessIdle();
|
||||
void DeletePendingObjects();
|
||||
|
||||
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -65,8 +65,18 @@ void wxExit()
|
||||
|
||||
static bool gs_inYield = FALSE;
|
||||
|
||||
bool wxYield()
|
||||
bool wxApp::Yield(bool onlyIfNeeded)
|
||||
{
|
||||
if ( gs_inYield )
|
||||
{
|
||||
if ( !onlyIfNeeded )
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxYield called recursively" ) );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if wxUSE_THREADS
|
||||
if ( !wxThread::IsMain() )
|
||||
{
|
||||
@@ -97,14 +107,6 @@ bool wxYield()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxYieldIfNeeded()
|
||||
{
|
||||
if (gs_inYield)
|
||||
return FALSE;
|
||||
|
||||
return wxYield();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWakeUpIdle
|
||||
|
Reference in New Issue
Block a user