]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/logg.cpp
Changed order of #ifdefs to get native version on OS/2, even if
[wxWidgets.git] / src / generic / logg.cpp
index 82cc02d40cdacbc2c9e8740ec564d4f357dc2306..168c3d50744635dcfe7b8de62eeb696fb1b9a17d 100644 (file)
@@ -636,7 +636,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
                          const wxArrayLong& times,
                          const wxString& caption,
                          long style)
-           : wxDialog(parent, -1, caption),
+           : wxDialog(parent, -1, caption ),
              m_messages(messages), m_severity(severity), m_times(times)
 {
     m_showingDetails = FALSE; // not initially
@@ -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();
 }
 
@@ -697,7 +704,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
             // create it now
             m_listctrl = new wxListCtrl(this, -1,
                                         wxDefaultPosition, wxDefaultSize,
-                                        wxLC_REPORT | wxLC_NO_HEADER);
+                                        wxLC_REPORT | wxLC_NO_HEADER );
             m_listctrl->InsertColumn(0, _("Message"));
             m_listctrl->InsertColumn(1, _("Time"));
 
@@ -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);
 
@@ -775,6 +782,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
     m_showingDetails = !m_showingDetails;
 
     // in any case, our size changed - update
+    sizer->SetSizeHints(this);
     sizer->Fit(this);
 }