X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c104648931c9e1b52b243732d9dacf28703f5dc..6e1609b1e0784f299933742e02c58462df809acc:/src/xrc/xh_sizer.cpp diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 5ce46b41bd..9ff053c5b2 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -76,7 +76,6 @@ wxSizerXmlHandler::wxSizerXmlHandler() XRC_ADD_STYLE(wxALIGN_CENTER_VERTICAL); XRC_ADD_STYLE(wxALIGN_CENTRE_VERTICAL); - XRC_ADD_STYLE(wxADJUST_MINSIZE); XRC_ADD_STYLE(wxFIXED_MINSIZE); } @@ -145,9 +144,9 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem() wxWindow *wnd = wxDynamicCast(item, wxWindow); if (sizer) - sitem->SetSizer(sizer); + sitem->AssignSizer(sizer); else if (wnd) - sitem->SetWindow(wnd); + sitem->AssignWindow(wnd); else wxLogError(wxT("Error in resource.")); @@ -171,7 +170,7 @@ wxObject* wxSizerXmlHandler::Handle_spacer() wxSizerItem* sitem = MakeSizerItem(); SetSizerItemAttributes(sitem); - sitem->SetSpacer(GetSize()); + sitem->AssignSpacer(GetSize()); AddSizerItem(sitem); return NULL; } @@ -185,16 +184,16 @@ wxObject* wxSizerXmlHandler::Handle_sizer() wxCHECK_MSG(m_parentSizer != NULL || (parentNode && parentNode->GetType() == wxXML_ELEMENT_NODE && - m_parentAsWindow != NULL && - (m_parentAsWindow->IsKindOf(CLASSINFO(wxWindow))) - ), NULL, - wxT("Incorrect use of sizer: parent is not a 'wxWindow'.")); + m_parentAsWindow), NULL, + wxT("Sizer must have a window parent node")); if (m_class == wxT("wxBoxSizer")) sizer = Handle_wxBoxSizer(); +#if wxUSE_STATBOX else if (m_class == wxT("wxStaticBoxSizer")) sizer = Handle_wxStaticBoxSizer(); +#endif else if (m_class == wxT("wxGridSizer")) sizer = Handle_wxGridSizer(); @@ -253,6 +252,7 @@ wxSizer* wxSizerXmlHandler::Handle_wxBoxSizer() return new wxBoxSizer(GetStyle(wxT("orient"), wxHORIZONTAL)); } +#if wxUSE_STATBOX wxSizer* wxSizerXmlHandler::Handle_wxStaticBoxSizer() { return new wxStaticBoxSizer( @@ -264,6 +264,7 @@ wxSizer* wxSizerXmlHandler::Handle_wxStaticBoxSizer() GetName()), GetStyle(wxT("orient"), wxHORIZONTAL)); } +#endif // wxUSE_STATBOX wxSizer* wxSizerXmlHandler::Handle_wxGridSizer() { @@ -360,6 +361,9 @@ void wxSizerXmlHandler::SetSizerItemAttributes(wxSizerItem* sitem) gbsitem->SetPos(GetGBPos(wxT("cellpos"))); gbsitem->SetSpan(GetGBSpan(wxT("cellspan"))); } + + // record the id of the item, if any, for use by XRCSIZERITEM() + sitem->SetId(GetID()); } void wxSizerXmlHandler::AddSizerItem(wxSizerItem* sitem)