From 50af7fa9f237be0b6e1c4880b9b89b2b49a7b841 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Jan 2000 14:31:42 +0000 Subject: [PATCH] 'Details' button is now disabled if no details git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/logg.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index bd25cec3b1..168c3d5074 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -650,8 +650,8 @@ wxLogDialog::wxLogDialog(wxWindow *parent, wxBoxSizer *sizerAll = new wxBoxSizer(wxHORIZONTAL); wxButton *btnOk = new wxButton(this, wxID_OK, _T("Ok")); - m_btnDetails = new wxButton(this, wxID_MORE, _T("&Details >>")); 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); @@ -670,6 +670,13 @@ wxLogDialog::wxLogDialog(wxWindow *parent, btnOk->SetFocus(); + if ( m_messages.GetCount() == 1 ) + { + // no details... it's easier to disable a button than to change the + // dialog layout depending on whether we have details or not + m_btnDetails->Disable(); + } + Centre(); } @@ -754,7 +761,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) wxDateTime((time_t)m_times[n]).Format(fmt)); } - // let the columns size themselves (TODO does this work under GTK?) + // let the columns size themselves m_listctrl->SetColumnWidth(0, wxLIST_AUTOSIZE); m_listctrl->SetColumnWidth(1, wxLIST_AUTOSIZE); -- 2.45.2