X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..c8011d7377e2b715ed2a7d4ff8f6413771ece31c:/src/common/appcmn.cpp?ds=sidebyside diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 32c2fe5e00..25bda2572b 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -121,9 +121,6 @@ bool wxAppBase::OnInitGui() #ifdef __WXUNIVERSAL__ if ( !wxTheme::Get() && !wxTheme::CreateDefault() ) return FALSE; - wxArtProvider *art = wxTheme::Get()->GetArtProvider(); - if ( art ) - wxArtProvider::PushProvider(art); #endif // __WXUNIVERSAL__ return TRUE; @@ -215,10 +212,10 @@ void wxAppBase::ProcessPendingEvents() } // 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 @@ -227,7 +224,7 @@ void wxAppBase::ProcessPendingEvents() handler->ProcessPendingEvents(); wxENTER_CRIT_SECT( *wxPendingEventsLocker ); - node = wxPendingEvents->First(); + node = wxPendingEvents->GetFirst(); } wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); @@ -381,10 +378,11 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) 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__ @@ -397,7 +395,6 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 ) { wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str()); - return FALSE; } @@ -476,6 +473,7 @@ bool wxAppBase::CheckBuildOptions(const wxBuildOptions& opts) static void LINKAGEMODE SetTraceMasks() { +#if wxUSE_LOG wxString mask; if ( wxGetEnv(wxT("WXTRACE"), &mask) ) { @@ -483,6 +481,7 @@ static void LINKAGEMODE SetTraceMasks() while ( tkn.HasMoreTokens() ) wxLog::AddTraceMask(tkn.GetNextToken()); } +#endif // wxUSE_LOG } // wxASSERT() helper @@ -549,6 +548,24 @@ 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