#include "wx/msgout.h"
#include "wx/thread.h"
#include "wx/vidmode.h"
-
-#ifdef __WXDEBUG__
- #if wxUSE_STACKWALKER
- #include "wx/stackwalk.h"
- #endif // wxUSE_STACKWALKER
-#endif // __WXDEBUG__
-
-#if defined(__WXMSW__)
- #include "wx/msw/private.h" // includes windows.h for LOGFONT
-#endif
+#include "wx/evtloop.h"
#if wxUSE_FONTMAP
#include "wx/fontmap.h"
m_isActive = true;
- m_isInsideYield = false;
- m_eventsToProcessInsideYield = wxEVT_CATEGORY_ALL;
-
// We don't want to exit the app if the user code shows a dialog from its
// OnInit() -- but this is what would happen if we set m_exitOnFrameDelete
// to Yes initially as this dialog would be the last top level window.
wxBitmap::InitStandardHandlers();
+ // for compatibility call the old initialization function too
+ if ( !OnInitGui() )
+ return false;
+
return true;
}
(void)ProcessEvent(event);
}
-bool wxAppBase::IsEventAllowedInsideYield(wxEventCategory cat) const
-{
- return m_eventsToProcessInsideYield & cat;
-}
-
bool wxAppBase::SafeYield(wxWindow *win, bool onlyIfNeeded)
{
wxWindowDisabler wd(win);
- return Yield(onlyIfNeeded);
+ wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+
+ return loop && loop->Yield(onlyIfNeeded);
}
bool wxAppBase::SafeYieldFor(wxWindow *win, long eventsToProcess)
{
wxWindowDisabler wd(win);
- return YieldFor(eventsToProcess);
+ wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+
+ return loop && loop->YieldFor(eventsToProcess);
}
return NULL;
}
-#ifdef __WXDEBUG__
-
bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg)
{
// under MSW we prefer to use the base class version using ::MessageBox()
#if defined(__WXMSW__) || defined(__WXDFB__) || !wxUSE_MSGDLG
return wxAppTraitsBase::ShowAssertDialog(msg);
#else // wxUSE_MSGDLG
+#if wxDEBUG_LEVEL
wxString msgDlg = msg;
#if wxUSE_STACKWALKER
//case wxNO: nothing to do
}
+#else // !wxDEBUG_LEVEL
+ // this function always exists (for ABI compatibility) but is never called
+ // if debug level is 0 and so can simply do nothing then
+ wxUnusedVar(msg);
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
return false;
#endif // !wxUSE_MSGDLG/wxUSE_MSGDLG
}
-#endif // __WXDEBUG__
-
bool wxGUIAppTraitsBase::HasStderr()
{
// we consider that under Unix stderr always goes somewhere, even if the