X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..9d8c2f419f522408a922277df330d4c4511befb9:/contrib/src/xml/xh_choic.cpp diff --git a/contrib/src/xml/xh_choic.cpp b/contrib/src/xml/xh_choic.cpp index ea39ffb94b..a7843e91b7 100644 --- a/contrib/src/xml/xh_choic.cpp +++ b/contrib/src/xml/xh_choic.cpp @@ -23,21 +23,22 @@ #include "wx/choice.h" wxChoiceXmlHandler::wxChoiceXmlHandler() -: wxXmlResourceHandler() , m_InsideBox(FALSE) +: wxXmlResourceHandler() , m_insideBox(FALSE) { ADD_STYLE(wxCB_SORT); + AddWindowStyles(); } wxObject *wxChoiceXmlHandler::DoCreateResource() { - if( m_Node->GetName() == _T("choice")) + if( m_class == wxT("wxChoice")) { // find the selection - long selection = GetLong( _T("selection"), -1 ); + long selection = GetLong( wxT("selection"), -1 ); // need to build the list of strings from children - m_InsideBox = TRUE; - CreateChildren( NULL, TRUE /* only this handler */); + m_insideBox = TRUE; + CreateChildrenPrivately( NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if( strList.GetCount() > 0 ) { @@ -48,7 +49,7 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() } - wxChoice *control = new wxChoice(m_ParentAsWindow, + wxChoice *control = new wxChoice(m_parentAsWindow, GetID(), GetPosition(), GetSize(), strList.GetCount(), @@ -75,7 +76,7 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() // handle Label // add to the list - strList.Add( GetNodeContent(m_Node) ); + strList.Add( GetNodeContent(m_node) ); return NULL; } @@ -86,10 +87,9 @@ wxObject *wxChoiceXmlHandler::DoCreateResource() bool wxChoiceXmlHandler::CanHandle(wxXmlNode *node) { - return( node->GetName() == _T("choice") || - ( m_InsideBox && - node->GetName() == _T("item" )) - ); + return (IsOfClass(node, wxT("wxChoice")) || + (m_insideBox && node->GetName() == wxT("item")) + ); }