#ifdef __WXUNIVERSAL__
if ( !wxTheme::Get() && !wxTheme::CreateDefault() )
return FALSE;
- wxArtProvider *art = wxTheme::Get()->GetArtProvider();
- if ( art )
- wxArtProvider::PushProvider(art);
#endif // __WXUNIVERSAL__
return TRUE;
}
// iterate until the list becomes empty
- wxNode *node = wxPendingEvents->First();
+ wxNode *node = wxPendingEvents->GetFirst();
while (node)
{
- wxEvtHandler *handler = (wxEvtHandler *)node->Data();
+ wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
delete node;
// In ProcessPendingEvents(), new handlers might be add
handler->ProcessPendingEvents();
wxENTER_CRIT_SECT( *wxPendingEventsLocker );
- node = wxPendingEvents->First();
+ node = wxPendingEvents->GetFirst();
}
wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
if ( !theme )
{
wxLogError(_("Unsupported theme '%s'."), themeName.c_str());
-
return FALSE;
}
+ // Delete the defaultly created theme and set the new theme.
+ delete wxTheme::Get();
wxTheme::Set(theme);
}
#endif // __WXUNIVERSAL__
if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 )
{
wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str());
-
return FALSE;
}
if ( !(wxCMP(isDebug) && wxCMP(verMaj) && wxCMP(verMin)) )
{
- wxLogFatalError(_T("Mismatch between the program and library build ")
- _T("versions detected."));
+ wxString msg;
+ wxString libDebug, progDebug;
+
+ if (isDebug)
+ libDebug = wxT("debug");
+ else
+ libDebug = wxT("no debug");
+
+ if (opts.m_isDebug)
+ progDebug = wxT("debug");
+ else
+ progDebug = wxT("no debug");
+
+ msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %d.%d (%s), and your program used %d.%d (%s)."),
+ verMaj, verMin, libDebug.c_str(), opts.m_verMaj, opts.m_verMin, progDebug.c_str());
+
+ wxLogFatalError(msg);
// normally wxLogFatalError doesn't return
return FALSE;
static void LINKAGEMODE SetTraceMasks()
{
+#if wxUSE_LOG
wxString mask;
if ( wxGetEnv(wxT("WXTRACE"), &mask) )
{
while ( tkn.HasMoreTokens() )
wxLog::AddTraceMask(tkn.GetNextToken());
}
+#endif // wxUSE_LOG
}
// wxASSERT() helper
#endif // Win/Unix
}
+
+void wxAssert(int cond,
+ const wxChar *szFile,
+ int nLine,
+ const wxChar *szCond,
+ const wxChar *szMsg)
+{
+ if ( !cond )
+ wxOnAssert(szFile, nLine, szCond, szMsg);
+}
+
// show the assert modal dialog
static
void ShowAssertDialog(const wxChar *szFile,
wxStrcat(szBuf, wxT("."));
}
+#if wxUSE_THREADS
+ // if we are not in the main thread,
+ // output the assert directly and trap since dialogs cannot be displayed
+ if (!wxThread::IsMain()) {
+ wxStrcat(szBuf, wxT(" [in child thread]"));
+#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+ wxStrcat(szBuf, wxT("\r\n"));
+ OutputDebugString(szBuf);
+#else
+ // send to stderr
+ wxFprintf(stderr, wxT("%s\n"), szBuf);
+ fflush(stderr);
+#endif
+ // He-e-e-e-elp!! we're asserting in a child thread
+ wxTrap();
+ }
+#endif // wxUSE_THREADS
+
if ( !s_bNoAsserts )
{
// send it to the normal log destination