X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..9c21efe30131c78c25763446e0754e2a0b54dc30:/contrib/src/xml/xh_chckl.cpp?ds=sidebyside diff --git a/contrib/src/xml/xh_chckl.cpp b/contrib/src/xml/xh_chckl.cpp index 7f709b14a4..51f307adc3 100644 --- a/contrib/src/xml/xh_chckl.cpp +++ b/contrib/src/xml/xh_chckl.cpp @@ -26,15 +26,16 @@ wxCheckListXmlHandler::wxCheckListXmlHandler() : wxXmlResourceHandler(), m_InsideBox(FALSE) { // no styles + AddWindowStyles(); } wxObject *wxCheckListXmlHandler::DoCreateResource() { - if( m_Node->GetName() == _T("checklist")) + if (m_Class == wxT("wxCheckList")) { // need to build the list of strings from children m_InsideBox = TRUE; - CreateChildren( NULL, TRUE /* only this handler */); + CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); wxString *strings = (wxString *) NULL; if( strList.GetCount() > 0 ) { @@ -56,26 +57,20 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() ); // step through children myself (again.) - wxXmlNode *n = GetParamNode(_T("children")); + wxXmlNode *n = GetParamNode(wxT("content")); if (n) n = n->GetChildren(); int i = 0; while (n) { if (n->GetType() != wxXML_ELEMENT_NODE || - n->GetName() != _T("item" )) + n->GetName() != wxT("item")) { n = n->GetNext(); continue; } // checking boolean is a bit ugly here (see GetBool() ) - wxString v = n->GetPropVal(_T("checked"), wxEmptyString); + wxString v = n->GetPropVal(wxT("checked"), wxEmptyString); v.MakeLower(); - if (v) - { - if( v == _T("1") || v == _T("t") || v == _T("yes") || - v == _T("on") || v == _T("true") ) - { - control->Check( i, TRUE ); - } - } + if (v && v == wxT("1")) + control->Check( i, TRUE ); i++; n = n->GetNext(); @@ -106,10 +101,9 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node) { - return( node->GetName() == _T("checklist") || - ( m_InsideBox && - node->GetName() == _T("item" )) - ); + return (IsOfClass(node, wxT("wxCheckList")) || + (m_InsideBox && node->GetName() == wxT("item")) + ); }