use wxEventLoop in wxApp under wxMSW; factored out common code from wxX11/wxMotif/wxMGL to wxAppBase; changed wxApp::Dispatch() return type
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -228,7 +228,6 @@ wxApp::wxApp()
|
|||||||
m_mainColormap = (WXColormap) NULL;
|
m_mainColormap = (WXColormap) NULL;
|
||||||
m_topLevelWidget = (WXWindow) NULL;
|
m_topLevelWidget = (WXWindow) NULL;
|
||||||
m_maxRequestSize = 0;
|
m_maxRequestSize = 0;
|
||||||
m_mainLoop = NULL;
|
|
||||||
m_showIconic = FALSE;
|
m_showIconic = FALSE;
|
||||||
m_initialSize = wxDefaultSize;
|
m_initialSize = wxDefaultSize;
|
||||||
|
|
||||||
@@ -252,18 +251,6 @@ bool wxApp::Initialized()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxApp::MainLoop()
|
|
||||||
{
|
|
||||||
int rt;
|
|
||||||
m_mainLoop = new wxEventLoop;
|
|
||||||
|
|
||||||
rt = m_mainLoop->Run();
|
|
||||||
|
|
||||||
delete m_mainLoop;
|
|
||||||
m_mainLoop = NULL;
|
|
||||||
return rt;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// X11 predicate function for exposure compression
|
// X11 predicate function for exposure compression
|
||||||
@@ -615,7 +602,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
return win->GetEventHandler()->ProcessEvent( wxevent );
|
return win->GetEventHandler()->ProcessEvent( wxevent );
|
||||||
}
|
}
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
{
|
|
||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
if ((event->xfocus.detail != NotifyPointer) &&
|
if ((event->xfocus.detail != NotifyPointer) &&
|
||||||
(event->xfocus.mode == NotifyNormal))
|
(event->xfocus.mode == NotifyNormal))
|
||||||
@@ -643,10 +629,8 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
|
||||||
}
|
|
||||||
case FocusOut:
|
case FocusOut:
|
||||||
{
|
|
||||||
#if !wxUSE_NANOX
|
#if !wxUSE_NANOX
|
||||||
if ((event->xfocus.detail != NotifyPointer) &&
|
if ((event->xfocus.detail != NotifyPointer) &&
|
||||||
(event->xfocus.mode == NotifyNormal))
|
(event->xfocus.mode == NotifyNormal))
|
||||||
@@ -661,37 +645,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
|
|||||||
return win->GetEventHandler()->ProcessEvent(focusEvent);
|
return win->GetEventHandler()->ProcessEvent(focusEvent);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
default:
|
||||||
//wxString eventName = wxGetXEventName(XEvent& event);
|
//wxString eventName = wxGetXEventName(XEvent& event);
|
||||||
//wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
|
//wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
|
||||||
#endif
|
#endif // __WXDEBUG__
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxApp::ExitMainLoop()
|
|
||||||
{
|
|
||||||
if (m_mainLoop)
|
|
||||||
m_mainLoop->Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is a message/event pending?
|
|
||||||
bool wxApp::Pending()
|
|
||||||
{
|
|
||||||
return wxEventLoop::GetActive()->Pending();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dispatch a message.
|
|
||||||
void wxApp::Dispatch()
|
|
||||||
{
|
|
||||||
wxEventLoop::GetActive()->Dispatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This should be redefined in a derived class for
|
// This should be redefined in a derived class for
|
||||||
|
Reference in New Issue
Block a user