From 266527ec60ce965957ca75c8ae78ccaedffad6bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 5 Aug 2000 21:25:54 +0000 Subject: [PATCH] added minsize variable for sizers and sizeritems git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/xml/xh_sizer.cpp | 14 ++++++++++++++ contrib/utils/wxrcedit/df/boxsizer.df | 1 + contrib/utils/wxrcedit/df/flexgridsizer.df | 1 + contrib/utils/wxrcedit/df/gridsizer.df | 1 + contrib/utils/wxrcedit/df/sizeritem.df | 1 + contrib/utils/wxrcedit/df/staticboxsizer.df | 1 + 6 files changed, 19 insertions(+) diff --git a/contrib/src/xml/xh_sizer.cpp b/contrib/src/xml/xh_sizer.cpp index 0442de477e..3df8288457 100644 --- a/contrib/src/xml/xh_sizer.cpp +++ b/contrib/src/xml/xh_sizer.cpp @@ -90,13 +90,22 @@ wxObject *wxSizerXmlHandler::DoCreateResource() m_ParentSizer = old_par; wxSizer *sizer = wxDynamicCast(item, wxSizer); wxWindow *wnd = wxDynamicCast(item, wxWindow); + wxSize minsize = GetSize(_T("minsize")); if (sizer) + { m_ParentSizer->Add(sizer, GetLong(_T("option")), GetStyle(_T("flag")), GetLong(_T("border"))); + if (!(minsize == wxDefaultSize)) + m_ParentSizer->SetItemMinSize(sizer, minsize.x, minsize.y); + } else if (wnd) + { m_ParentSizer->Add(wnd, GetLong(_T("option")), GetStyle(_T("flag")), GetLong(_T("border"))); + if (!(minsize == wxDefaultSize)) + m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y); + } else wxLogError(_T("Error in resource.")); @@ -147,6 +156,11 @@ wxObject *wxSizerXmlHandler::DoCreateResource() sizer = new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")), GetLong(_T("vgap")), GetLong(_T("hgap"))); + wxSize minsize = GetSize(_T("minsize")); + if (!(minsize == wxDefaultSize)) + sizer->SetMinSize(minsize); + + wxSizer *old_par = m_ParentSizer; m_ParentSizer = sizer; bool old_ins = m_IsInside; diff --git a/contrib/utils/wxrcedit/df/boxsizer.df b/contrib/utils/wxrcedit/df/boxsizer.df index 80c1609369..a7845b1e55 100644 --- a/contrib/utils/wxrcedit/df/boxsizer.df +++ b/contrib/utils/wxrcedit/df/boxsizer.df @@ -4,3 +4,4 @@ icon 0 childtype sizer_item derived from panel_item var orient of flags wxHORIZONTAL,wxVERTICAL +var minsize of coord diff --git a/contrib/utils/wxrcedit/df/flexgridsizer.df b/contrib/utils/wxrcedit/df/flexgridsizer.df index a067469022..414dd886e6 100644 --- a/contrib/utils/wxrcedit/df/flexgridsizer.df +++ b/contrib/utils/wxrcedit/df/flexgridsizer.df @@ -7,3 +7,4 @@ var rows of integer var cols of integer var vgap of integer var hgap of integer +var minsize of coord diff --git a/contrib/utils/wxrcedit/df/gridsizer.df b/contrib/utils/wxrcedit/df/gridsizer.df index ea0d051b90..ad1726206c 100644 --- a/contrib/utils/wxrcedit/df/gridsizer.df +++ b/contrib/utils/wxrcedit/df/gridsizer.df @@ -7,3 +7,4 @@ var rows of integer var cols of integer var vgap of integer var hgap of integer +var minsize of coord diff --git a/contrib/utils/wxrcedit/df/sizeritem.df b/contrib/utils/wxrcedit/df/sizeritem.df index 25b2b6544c..7ee1f74ecc 100644 --- a/contrib/utils/wxrcedit/df/sizeritem.df +++ b/contrib/utils/wxrcedit/df/sizeritem.df @@ -6,3 +6,4 @@ type sizeritem var option of integer var flag of flags wxEXPAND,wxALL,wxLEFT,wxRIGHT,wxTOP,wxBOTTOM,wxALIGN_CENTER,wxALIGN_LEFT,wxALIGN_TOP,wxALIGN_RIGHT,wxALIGN_BOTTOM,wxALIGN_CENTER_HORIZONTAL,wxALIGN_CENTER_VERTICAL,wxNORTH,wxSOUTH,wxEAST,wxWEST,wxGROW,wxSHAPED,wxSTRETCH_NOT var border of integer +var minsize of coord diff --git a/contrib/utils/wxrcedit/df/staticboxsizer.df b/contrib/utils/wxrcedit/df/staticboxsizer.df index 055d799213..40e62f8b7e 100644 --- a/contrib/utils/wxrcedit/df/staticboxsizer.df +++ b/contrib/utils/wxrcedit/df/staticboxsizer.df @@ -1,3 +1,4 @@ node staticboxsizer derived from boxsizer var label of text +var minsize of coord -- 2.45.2