From a55602fafaf0f17becb6d5ec7c27ef7ad1e443ea Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Apr 2012 22:24:47 +0000 Subject: [PATCH] Don't use too big width for wxHtmlHelpWindow navigation panel. The width of the navigation panel in wxHtmlHelpWindow could become arbitrarily high if long items used. Avoid this by using a reasonably large but not too big minimal width instead of determining it automatically from the items width. Closes #13754. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/helpwnd.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 1a4b60cc7e..eff2294cca 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -60,6 +60,11 @@ // what is considered "small index"? #define INDEX_IS_SMALL 1000 +// minimum width for content tree and index +// (we cannot let minimum size be determined from content, else long titles +// make the help frame unusable) +const wxCoord CONTENT_TREE_INDEX_MIN_WIDTH = 150; + /* Motif defines this as a macro */ #ifdef Below #undef Below @@ -1033,6 +1038,9 @@ void wxHtmlHelpWindow::CreateContents() imaged[it->level] = true; } } + + m_ContentsBox->SetMinSize(wxSize(CONTENT_TREE_INDEX_MIN_WIDTH, + m_ContentsBox->GetMinHeight())); } void wxHtmlHelpWindow::CreateIndex() @@ -1056,6 +1064,9 @@ void wxHtmlHelpWindow::CreateIndex() for (size_t i = 0; i < cnt; i++) m_IndexList->Append((*m_mergedIndex)[i].name, (char*)(&(*m_mergedIndex)[i])); + + m_IndexList->SetMinSize(wxSize(CONTENT_TREE_INDEX_MIN_WIDTH, + m_IndexList->GetMinHeight())); } void wxHtmlHelpWindow::CreateSearch() -- 2.45.2