diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 240ed7169b..d931c84ed0 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -800,11 +800,20 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) wxICON_INFORMATION }; + bool loadedIcons = TRUE; + #ifndef __WIN16__ for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ ) { wxBitmap bmp = wxTheApp->GetStdIcon(icons[icon]); - imageList->Add(wxImage(bmp). + + // This may very well fail if there are insufficient + // colours available. Degrade gracefully. + + if (!bmp.Ok()) + loadedIcons = FALSE; + else + imageList->Add(wxImage(bmp). Rescale(ICON_SIZE, ICON_SIZE). ConvertToBitmap()); } @@ -840,7 +849,14 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) } #endif - m_listctrl->InsertItem(n, m_messages[n], image); + if (!loadedIcons) + image = -1; + + if (image > -1) + m_listctrl->InsertItem(n, m_messages[n], image); + else + m_listctrl->InsertItem(n, m_messages[n]); + m_listctrl->SetItem(n, 1, wxDateTime((time_t)m_times[n]).Format(fmt)); } diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 48c8c5d867..49ec9a64d4 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -471,26 +471,44 @@ wxHtmlHelpFrame::~wxHtmlHelpFrame() void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) { - toolBar -> AddTool(wxID_HTML_PANEL, wxBITMAP(wpanel), wxNullBitmap, + wxBitmap wpanelBitmap = wxBITMAP(wpanel); + wxBitmap wbackBitmap = wxBITMAP(wback); + wxBitmap wforwardBitmap = wxBITMAP(wforward); + wxBitmap wupnodeBitmap = wxBITMAP(wupnode); + wxBitmap wupBitmap = wxBITMAP(wup); + wxBitmap wdownBitmap = wxBITMAP(wdown); + wxBitmap wopenBitmap = wxBITMAP(wopen); + wxBitmap wprintBitmap = wxBITMAP(wprint); + wxBitmap woptionsBitmap = wxBITMAP(woptions); + + wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() && + wforwardBitmap.Ok() && wupnodeBitmap.Ok() && + wupBitmap.Ok() && wdownBitmap.Ok() && + wopenBitmap.Ok() && wprintBitmap.Ok() && + woptionsBitmap.Ok()), + wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ; + + + toolBar -> AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Show/hide navigation panel")); toolBar -> AddSeparator(); - toolBar -> AddTool(wxID_HTML_BACK, wxBITMAP(wback), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Go back")); - toolBar -> AddTool(wxID_HTML_FORWARD, wxBITMAP(wforward), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Go forward")); toolBar -> AddSeparator(); - toolBar -> AddTool(wxID_HTML_UPNODE, wxBITMAP(wupnode), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Go one level up in document hierarchy")); - toolBar -> AddTool(wxID_HTML_UP, wxBITMAP(wup), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Previous page")); - toolBar -> AddTool(wxID_HTML_DOWN, wxBITMAP(wdown), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Next page")); @@ -498,19 +516,19 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style) toolBar -> AddSeparator(); if (style & wxHF_OPENFILES) - toolBar -> AddTool(wxID_HTML_OPENFILE, wxBITMAP(wopen), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Open HTML document")); #if wxUSE_PRINTING_ARCHITECTURE if (style & wxHF_PRINT) - toolBar -> AddTool(wxID_HTML_PRINT, wxBITMAP(wprint), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Print this page")); #endif toolBar -> AddSeparator(); - toolBar -> AddTool(wxID_HTML_OPTIONS, wxBITMAP(woptions), wxNullBitmap, + toolBar -> AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, _("Display options dialog")); } diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index a9a097e096..cfd12bece7 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -499,6 +499,20 @@ int wxDialog::ShowModal() XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event); wxTheApp->ProcessXEvent((WXEvent*) &event); + + if (XtAppPending( (XtAppContext) wxTheApp->GetAppContext() ) == 0) + { + if (!wxTheApp->ProcessIdle()) + { +#if wxUSE_THREADS + // leave the main loop to give other threads a chance to + // perform their GUI work + wxMutexGuiLeave(); + wxUsleep(20); + wxMutexGuiEnter(); +#endif + } + } } // Remove modal dialog flag from stack