Added modal dialog OnIdle processing; added asserts to helpfrm.cpp to confirm

XPM loading problem; fixes some compilos.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-03-24 15:48:10 +00:00
parent eb118c55fd
commit 2e377124b4
3 changed files with 59 additions and 11 deletions

View File

@@ -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));
}

View File

@@ -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"));
}

View File

@@ -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