X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bed1ceef84a76bc0096883d3fca308b40200b15..a07a98dbe53e6fa446dd40b0c5aa4b3c520b442f:/contrib/src/xml/xh_sizer.cpp diff --git a/contrib/src/xml/xh_sizer.cpp b/contrib/src/xml/xh_sizer.cpp index 0442de477e..51b29c80e6 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"))); + GetStyle(_T("flag")), GetDimension(_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"))); + GetStyle(_T("flag")), GetDimension(_T("border"))); + if (!(minsize == wxDefaultSize)) + m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y); + } else wxLogError(_T("Error in resource.")); @@ -113,7 +122,7 @@ wxObject *wxSizerXmlHandler::DoCreateResource() wxCHECK_MSG(m_ParentSizer, NULL, _T("Incorrect syntax of XML resource: spacer not within sizer!")); wxSize sz = GetSize(); m_ParentSizer->Add(sz.x, sz.y, - GetLong(_T("option")), GetStyle(_T("flag")), GetLong(_T("border"))); + GetLong(_T("option")), GetStyle(_T("flag")), GetDimension(_T("border"))); return NULL; } @@ -141,11 +150,16 @@ wxObject *wxSizerXmlHandler::DoCreateResource() else if (m_Node->GetName() == _T("gridsizer")) sizer = new wxGridSizer(GetLong(_T("rows")), GetLong(_T("cols")), - GetLong(_T("vgap")), GetLong(_T("hgap"))); + GetDimension(_T("vgap")), GetDimension(_T("hgap"))); else if (m_Node->GetName() == _T("flexgridsizer")) sizer = new wxFlexGridSizer(GetLong(_T("rows")), GetLong(_T("cols")), - GetLong(_T("vgap")), GetLong(_T("hgap"))); + GetDimension(_T("vgap")), GetDimension(_T("hgap"))); + + wxSize minsize = GetSize(_T("minsize")); + if (!(minsize == wxDefaultSize)) + sizer->SetMinSize(minsize); + wxSizer *old_par = m_ParentSizer; m_ParentSizer = sizer;