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();
|
bool ProcessIdle();
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
|
||||||
|
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
@@ -65,8 +65,18 @@ void wxExit()
|
|||||||
|
|
||||||
static bool gs_inYield = FALSE;
|
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 wxUSE_THREADS
|
||||||
if ( !wxThread::IsMain() )
|
if ( !wxThread::IsMain() )
|
||||||
{
|
{
|
||||||
@@ -97,14 +107,6 @@ bool wxYield()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxYieldIfNeeded()
|
|
||||||
{
|
|
||||||
if (gs_inYield)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return wxYield();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxWakeUpIdle
|
// wxWakeUpIdle
|
||||||
|
Reference in New Issue
Block a user