]> git.saurik.com Git - wxWidgets.git/commitdiff
don't make the log dialog taller than the screen (patch 457695)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 2 Nov 2001 17:52:27 +0000 (17:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 2 Nov 2001 17:52:27 +0000 (17:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/logg.cpp

index 68555e35e6fe8def4ca6bad3357ad49265b7829f..fcfe1afc434e0e42a9389dcdaacd48ab96f06a90 100644 (file)
@@ -869,7 +869,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)