- if (n->GetType() == wxXML_ELEMENT_NODE)
- {
- bool old_ins = m_IsInside;
- wxSizer *old_par = m_ParentSizer;
- m_IsInside = FALSE;
- if (!IsSizerNode(n)) m_ParentSizer = NULL;
- wxObject *item = CreateResFromNode(n, m_Parent, NULL);
- m_IsInside = old_ins;
- 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")), 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")), GetDimension(_T("border")));
- if (!(minsize == wxDefaultSize))
- m_ParentSizer->SetItemMinSize(wnd, minsize.x, minsize.y);
- }
- else
- wxLogError(_T("Error in resource."));
-
- return item;
+ bool old_ins = m_IsInside;
+ wxSizer *old_par = m_ParentSizer;
+ m_IsInside = FALSE;
+ if (!IsSizerNode(n)) m_ParentSizer = NULL;
+ wxObject *item = CreateResFromNode(n, m_Parent, NULL);
+ m_IsInside = old_ins;
+ 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")), GetDimension(_T("border")));
+ if (!(minsize == wxDefaultSize))
+ m_ParentSizer->SetItemMinSize(sizer, minsize.x, minsize.y);