private:
// the data for the listctrl
- const wxArrayString& m_messages;
- const wxArrayInt& m_severity;
- const wxArrayLong& m_times;
+ wxArrayString m_messages;
+ wxArrayInt m_severity;
+ wxArrayLong m_times;
// the "toggle" button and its state
wxButton *m_btnDetails;
wxLogDialog dlg(wxTheApp->GetTopWindow(),
m_aMessages, m_aSeverity, m_aTimes,
title, style);
+
+ // clear the message list before showing the dialog because while it's
+ // shown some new messages may appear
+ Clear();
+
(void)dlg.ShowModal();
#else // !wxUSE_LOG_DIALOG
}
wxMessageBox(str, title, wxOK | style);
-#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG
// no undisplayed messages whatsoever
Clear();
+#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG
// do it here again
m_bHasMessages = FALSE;
case wxLOG_FatalError:
// show this one immediately
wxMessageBox(szString, _("Fatal error"), wxICON_HAND);
+ wxExit();
break;
case wxLOG_Error:
}
m_aMessages.Add(szString);
- m_aSeverity.Add(level);
+ m_aSeverity.Add((int)level);
m_aTimes.Add((long)t);
m_bHasMessages = TRUE;
break;
wxBoxSizer *sizerButtons = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *sizerAll = new wxBoxSizer(wxHORIZONTAL);
- wxButton *btnOk = new wxButton(this, wxID_OK, _T("Ok"));
+ wxButton *btnOk = new wxButton(this, wxID_OK, _T("OK"));
sizerButtons->Add(btnOk, 0, wxCENTRE|wxBOTTOM, MARGIN/2);
m_btnDetails = new wxButton(this, wxID_MORE, _T("&Details >>"));
sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1);
- wxIcon icon = wxTheApp->GetStdIcon(style & wxICON_MASK);
+ wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK));
sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0, wxCENTRE);
const wxString& message = messages.Last();
sizerAll->Add(CreateTextSizer(message), 0, wxCENTRE|wxLEFT|wxRIGHT, MARGIN);
// create it now
m_listctrl = new wxListCtrl(this, -1,
wxDefaultPosition, wxDefaultSize,
- wxLC_REPORT | wxLC_NO_HEADER );
+ wxSUNKEN_BORDER |
+ wxLC_REPORT |
+ wxLC_NO_HEADER );
m_listctrl->InsertColumn(0, _("Message"));
m_listctrl->InsertColumn(1, _("Time"));