From 395a82b13fa5f316d2d0dead17701e9bc23337d3 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 29 Mar 2004 10:18:38 +0000
Subject: [PATCH] made wxADJUST_MINSIZE default

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/sizer.tex |  6 +-----
 include/wx/defs.h       |  7 +++++--
 src/common/sizer.cpp    | 17 ++++++++---------
 src/html/helpfrm.cpp    |  6 +++---
 4 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/docs/latex/wx/sizer.tex b/docs/latex/wx/sizer.tex
index b28edf74e5..7b12d31523 100644
--- a/docs/latex/wx/sizer.tex
+++ b/docs/latex/wx/sizer.tex
@@ -106,11 +106,7 @@ to 0 and thus represent the default, wxALIGN\_RIGHT and wxALIGN\_BOTTOM have
 their obvious meaning). With proportional resize, a child may also be centered
 in the main orientation using wxALIGN\_CENTER\_VERTICAL (same as
 wxALIGN\_CENTRE\_VERTICAL) and wxALIGN\_CENTER\_HORIZONTAL (same as
-wxALIGN\_CENTRE\_HORIZONTAL) flags. Finally, you can also specify
-wxADJUST\_MINSIZE flag to make the minimal size of the control dynamically adjust
-to the value returned by its \helpref{GetAdjustedBestSize()}{wxwindowgetadjustedbestsize}
-method - this allows, for example, for correct relayouting of a static text
-control even if its text is changed during run-time.}
+wxALIGN\_CENTRE\_HORIZONTAL) flags.}
 
 \docparam{border}{Determines the border width, if the {\it flag} parameter is set to any border.}
 
diff --git a/include/wx/defs.h b/include/wx/defs.h
index d2bd046176..da04c2e305 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -1031,8 +1031,11 @@ enum wxStretch
     wxGROW                    = 0x2000,
     wxEXPAND                  = wxGROW,
     wxSHAPED                  = 0x4000,
-    wxADJUST_MINSIZE          = 0x8000,
-    wxTILE                    = 0xc000
+    // free value: 0x8000 (old wxADJUST_MINSIZE)
+    wxTILE                    = 0xc000,
+
+    // for compatibility only, default now, don't use explicitly any more
+    wxADJUST_MINSIZE          = 0x0000
 };
 
 /*  border flags: the values are chosen for backwards compatibility */
diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp
index 4cee972c00..b6e4498e28 100644
--- a/src/common/sizer.cpp
+++ b/src/common/sizer.cpp
@@ -193,12 +193,10 @@ wxSize wxSizerItem::CalcMin()
     }
     else
     {
-        if ( IsWindow() && (m_flag & wxADJUST_MINSIZE) )
+        if ( IsWindow() )
         {
-            // By user request, keep the minimal size for this item
-            // in sync with the largest of BestSize and any user supplied
-            // minimum size hint.  Useful in cases where the item is
-            // changeable -- static text labels, etc.
+            // the size of the window may change during run-time, we should
+            // use the current minimal size
             m_minSize = m_window->GetAdjustedBestSize();
         }
 
@@ -1140,10 +1138,11 @@ wxSize wxFlexGridSizer::CalcMin()
     m_rowHeights.SetCount(nrows);
     m_colWidths.SetCount(ncols);
 
-    // We have to recalcuate the sizes in case an item has wxADJUST_MINSIZE, has changed
-    // minimum size since the previous layout, or has been hidden using wxSizer::Show().
-    // If all the items in a row/column are hidden, the final dimension of the row/column
-    // will be -1, indicating that the column itself is hidden.
+    // We have to recalcuate the sizes in case the item minimum size has
+    // changed since the previous layout, or the item has been hidden using
+    // wxSizer::Show(). If all the items in a row/column are hidden, the final
+    // dimension of the row/column will be -1, indicating that the column
+    // itself is hidden.
     for( s = m_rowHeights.GetCount(), i = 0; i < s; ++i )
         m_rowHeights[ i ] = -1;
     for( s = m_colWidths.GetCount(), i = 0; i < s; ++i )
diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp
index ac2b31819d..2a2e01fd40 100644
--- a/src/html/helpfrm.cpp
+++ b/src/html/helpfrm.cpp
@@ -377,7 +377,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
         m_ContentsBox->AssignImageList(ContentsImageList);
         
         topsizer->Add(m_ContentsBox, 1,
-                      wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT | wxADJUST_MINSIZE,
+                      wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,
                       2);
 
         m_NavigNotebook->AddPage(dummy, _("Contents"));
@@ -419,7 +419,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
         topsizer->Add(btsizer, 0, 
                       wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10);
         topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2);
-        topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL | wxADJUST_MINSIZE, 2);
+        topsizer->Add(m_IndexList, 1, wxEXPAND | wxALL, 2);
 
         m_NavigNotebook->AddPage(dummy, _("Index"));
         m_IndexPage = notebook_page++;
@@ -455,7 +455,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
         sizer->Add(m_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10);
         sizer->Add(m_SearchWholeWords, 0, wxLEFT | wxRIGHT, 10);
         sizer->Add(m_SearchButton, 0, wxALL | wxALIGN_RIGHT, 8);
-        sizer->Add(m_SearchList, 1, wxALL | wxEXPAND | wxADJUST_MINSIZE, 2);
+        sizer->Add(m_SearchList, 1, wxALL | wxEXPAND, 2);
 
         m_NavigNotebook->AddPage(dummy, _("Search"));
         m_SearchPage = notebook_page;
-- 
2.50.0

