X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a57b93d37c767bd83e6fc5bb00f4a5ae78f2ef1..018e2f1300b726936e8afa41fcc3e2a85d2ed456:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index e3ee75a4c0..68555e35e6 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -249,6 +249,10 @@ void wxLogGui::Flush() size_t nMsgCount = m_aMessages.Count(); + // avoid showing other log dialogs until we're done with the dialog we're + // showing right now: nested modal dialogs make for really bad UI! + Suspend(); + wxString str; if ( nMsgCount == 1 ) { @@ -295,6 +299,9 @@ void wxLogGui::Flush() // no undisplayed messages whatsoever Clear(); } + + // allow flushing the logs again + Resume(); } // log all kinds of messages @@ -663,7 +670,9 @@ wxLogDialog::wxLogDialog(wxWindow *parent, const wxArrayLong& times, const wxString& caption, long style) - : wxDialog(parent, -1, caption) + : wxDialog(parent, -1, caption, + wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { if ( ms_details.IsEmpty() ) { @@ -714,20 +723,21 @@ wxLogDialog::wxLogDialog(wxWindow *parent, // to close the log dialog with which wouldn't work otherwise (as it // translates into click on cancel button) wxButton *btnOk = new wxButton(this, wxID_CANCEL, _("OK")); - sizerButtons->Add(btnOk, 0, wxCENTRE|wxBOTTOM, MARGIN/2); + sizerButtons->Add(btnOk, 0, wxCENTRE | wxBOTTOM, MARGIN/2); m_btnDetails = new wxButton(this, wxID_MORE, ms_details + _T(" >>")); - sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1); + sizerButtons->Add(m_btnDetails, 0, wxCENTRE | wxTOP, MARGIN/2 - 1); #ifndef __WIN16__ wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK)); - sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0, wxCENTRE); + sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0); #endif // !Win16 const wxString& message = messages.Last(); - sizerAll->Add(CreateTextSizer(message), 0, wxCENTRE|wxLEFT|wxRIGHT, MARGIN); - sizerAll->Add(sizerButtons, 0, wxALIGN_RIGHT|wxLEFT, MARGIN); + sizerAll->Add(CreateTextSizer(message), 1, + wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT, MARGIN); + sizerAll->Add(sizerButtons, 0, wxALIGN_RIGHT | wxLEFT, MARGIN); - sizerTop->Add(sizerAll, 0, wxCENTRE|wxALL, MARGIN); + sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN); SetAutoLayout(TRUE); SetSizer(sizerTop);