]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/logg.cpp
workaroung for handling problems because groupboxes are not included in the parent...
[wxWidgets.git] / src / generic / logg.cpp
index 68555e35e6fe8def4ca6bad3357ad49265b7829f..6a12263b57cd6bb3b00c4b62bb937957e26191de 100644 (file)
@@ -44,6 +44,7 @@
     #include "wx/sizer.h"
     #include "wx/statbmp.h"
     #include "wx/button.h"
+    #include "wx/settings.h"
 #endif // WX_PRECOMP
 
 #if wxUSE_LOGGUI || wxUSE_LOGWINDOW
@@ -869,7 +870,13 @@ void wxLogDialog::CreateDetailsControls()
     int y;
     GetTextExtent(_T("H"), (int*)NULL, &y, (int*)NULL, (int*)NULL, &font);
     int height = wxMax(y*(count + 3), 100);
-    m_listctrl->SetSize(-1, height);
+
+    // if the height as computed from list items exceeds, together with the
+    // actual message & controls, the screen, make it smaller
+    int heightMax =
+        (3*wxSystemSettings::GetSystemMetric(wxSYS_SCREEN_Y))/5 - GetSize().y;
+
+    m_listctrl->SetSize(-1, wxMin(height, heightMax));
 }
 
 void wxLogDialog::OnListSelect(wxListEvent& event)