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:
Vadim Zeitlin 2003-09-15 19:53:18 +00:00
parent 1bf77ee556
commit bcd3832a82

View File

@ -228,7 +228,6 @@ wxApp::wxApp()
m_mainColormap = (WXColormap) NULL;
m_topLevelWidget = (WXWindow) NULL;
m_maxRequestSize = 0;
m_mainLoop = NULL;
m_showIconic = FALSE;
m_initialSize = wxDefaultSize;
@ -252,18 +251,6 @@ bool wxApp::Initialized()
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
//-----------------------------------------------------------------------
// X11 predicate function for exposure compression
@ -615,7 +602,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
return win->GetEventHandler()->ProcessEvent( wxevent );
}
case FocusIn:
{
#if !wxUSE_NANOX
if ((event->xfocus.detail != NotifyPointer) &&
(event->xfocus.mode == NotifyNormal))
@ -643,10 +629,8 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
}
}
return FALSE;
break;
}
case FocusOut:
{
#if !wxUSE_NANOX
if ((event->xfocus.detail != NotifyPointer) &&
(event->xfocus.mode == NotifyNormal))
@ -661,37 +645,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
return win->GetEventHandler()->ProcessEvent(focusEvent);
}
return FALSE;
break;
}
default:
{
#ifdef __WXDEBUG__
default:
//wxString eventName = wxGetXEventName(XEvent& event);
//wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
#endif
#endif // __WXDEBUG__
}
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