made wxADJUST_MINSIZE default

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-03-29 10:18:38 +00:00
parent 8ab505498d
commit 395a82b13f
4 changed files with 17 additions and 19 deletions

View File

@@ -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 their obvious meaning). With proportional resize, a child may also be centered
in the main orientation using wxALIGN\_CENTER\_VERTICAL (same as in the main orientation using wxALIGN\_CENTER\_VERTICAL (same as
wxALIGN\_CENTRE\_VERTICAL) and wxALIGN\_CENTER\_HORIZONTAL (same as wxALIGN\_CENTRE\_VERTICAL) and wxALIGN\_CENTER\_HORIZONTAL (same as
wxALIGN\_CENTRE\_HORIZONTAL) flags. Finally, you can also specify wxALIGN\_CENTRE\_HORIZONTAL) flags.}
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.}
\docparam{border}{Determines the border width, if the {\it flag} parameter is set to any border.} \docparam{border}{Determines the border width, if the {\it flag} parameter is set to any border.}

View File

@@ -1031,8 +1031,11 @@ enum wxStretch
wxGROW = 0x2000, wxGROW = 0x2000,
wxEXPAND = wxGROW, wxEXPAND = wxGROW,
wxSHAPED = 0x4000, wxSHAPED = 0x4000,
wxADJUST_MINSIZE = 0x8000, // free value: 0x8000 (old wxADJUST_MINSIZE)
wxTILE = 0xc000 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 */ /* border flags: the values are chosen for backwards compatibility */

View File

@@ -193,12 +193,10 @@ wxSize wxSizerItem::CalcMin()
} }
else else
{ {
if ( IsWindow() && (m_flag & wxADJUST_MINSIZE) ) if ( IsWindow() )
{ {
// By user request, keep the minimal size for this item // the size of the window may change during run-time, we should
// in sync with the largest of BestSize and any user supplied // use the current minimal size
// minimum size hint. Useful in cases where the item is
// changeable -- static text labels, etc.
m_minSize = m_window->GetAdjustedBestSize(); m_minSize = m_window->GetAdjustedBestSize();
} }
@@ -1140,10 +1138,11 @@ wxSize wxFlexGridSizer::CalcMin()
m_rowHeights.SetCount(nrows); m_rowHeights.SetCount(nrows);
m_colWidths.SetCount(ncols); m_colWidths.SetCount(ncols);
// We have to recalcuate the sizes in case an item has wxADJUST_MINSIZE, has changed // We have to recalcuate the sizes in case the item minimum size has
// minimum size since the previous layout, or has been hidden using wxSizer::Show(). // changed since the previous layout, or the item has been hidden using
// If all the items in a row/column are hidden, the final dimension of the row/column // wxSizer::Show(). If all the items in a row/column are hidden, the final
// will be -1, indicating that the column itself is hidden. // 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 ) for( s = m_rowHeights.GetCount(), i = 0; i < s; ++i )
m_rowHeights[ i ] = -1; m_rowHeights[ i ] = -1;
for( s = m_colWidths.GetCount(), i = 0; i < s; ++i ) for( s = m_colWidths.GetCount(), i = 0; i < s; ++i )

View File

@@ -377,7 +377,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
m_ContentsBox->AssignImageList(ContentsImageList); m_ContentsBox->AssignImageList(ContentsImageList);
topsizer->Add(m_ContentsBox, 1, topsizer->Add(m_ContentsBox, 1,
wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT | wxADJUST_MINSIZE, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,
2); 2);
m_NavigNotebook->AddPage(dummy, _("Contents")); m_NavigNotebook->AddPage(dummy, _("Contents"));
@@ -419,7 +419,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
topsizer->Add(btsizer, 0, topsizer->Add(btsizer, 0,
wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10); wxALIGN_RIGHT | wxLEFT | wxRIGHT | wxBOTTOM, 10);
topsizer->Add(m_IndexCountInfo, 0, wxEXPAND | wxLEFT | wxRIGHT, 2); 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_NavigNotebook->AddPage(dummy, _("Index"));
m_IndexPage = notebook_page++; 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_SearchCaseSensitive, 0, wxLEFT | wxRIGHT, 10);
sizer->Add(m_SearchWholeWords, 0, wxLEFT | wxRIGHT, 10); sizer->Add(m_SearchWholeWords, 0, wxLEFT | wxRIGHT, 10);
sizer->Add(m_SearchButton, 0, wxALL | wxALIGN_RIGHT, 8); 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_NavigNotebook->AddPage(dummy, _("Search"));
m_SearchPage = notebook_page; m_SearchPage = notebook_page;