diff --git a/contrib/include/wx/xrc/xh_chckl.h b/contrib/include/wx/xrc/xh_chckl.h index f5913dce84..9a9d6889ae 100644 --- a/contrib/include/wx/xrc/xh_chckl.h +++ b/contrib/include/wx/xrc/xh_chckl.h @@ -17,10 +17,10 @@ #include "wx/xrc/xmlres.h" -class WXXMLDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxCheckListBoxXmlHandler : public wxXmlResourceHandler { public: - wxCheckListXmlHandler(); + wxCheckListBoxXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); private: diff --git a/contrib/samples/xrc/rc/controls.xrc b/contrib/samples/xrc/rc/controls.xrc index 119716ad1b..6f927b1535 100644 --- a/contrib/samples/xrc/rc/controls.xrc +++ b/contrib/samples/xrc/rc/controls.xrc @@ -130,7 +130,7 @@ - + 1 @@ -142,7 +142,7 @@ wxALIGN_CENTRE|wxALL 5 - + 180,180 Download library diff --git a/contrib/src/xrc/xh_chckl.cpp b/contrib/src/xrc/xh_chckl.cpp index bac03e2823..48a55892c2 100644 --- a/contrib/src/xrc/xh_chckl.cpp +++ b/contrib/src/xrc/xh_chckl.cpp @@ -24,18 +24,22 @@ #include "wx/xrc/xh_chckl.h" #include "wx/checklst.h" #include "wx/intl.h" +#include "wx/log.h" -wxCheckListXmlHandler::wxCheckListXmlHandler() +wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler() : wxXmlResourceHandler(), m_insideBox(FALSE) { // no styles AddWindowStyles(); } -wxObject *wxCheckListXmlHandler::DoCreateResource() +wxObject *wxCheckListBoxXmlHandler::DoCreateResource() { - if (m_class == wxT("wxCheckList")) + if (m_class == wxT("wxCheckListBox") || m_class == wxT("wxCheckList")) { + if (m_class == wxT("wxCheckList")) + wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); + // need to build the list of strings from children m_insideBox = TRUE; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); @@ -101,10 +105,11 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() } } -bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node) +bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node) { - return (IsOfClass(node, wxT("wxCheckList")) || + return (IsOfClass(node, wxT("wxCheckListBox")) || + IsOfClass(node, wxT("wxCheckList")) /*backward compatibility*/ || (m_insideBox && node->GetName() == wxT("item"))); } -#endif \ No newline at end of file +#endif diff --git a/contrib/src/xrc/xmlrsall.cpp b/contrib/src/xrc/xmlrsall.cpp index 7de3f4f9cb..2749b9eb00 100644 --- a/contrib/src/xrc/xmlrsall.cpp +++ b/contrib/src/xrc/xmlrsall.cpp @@ -43,7 +43,7 @@ void wxXmlResource::InitAllHandlers() #endif AddHandler(new wxListCtrlXmlHandler); #if wxUSE_CHECKLISTBOX - AddHandler(new wxCheckListXmlHandler); + AddHandler(new wxCheckListBoxXmlHandler); #endif #if wxUSE_CHOICE AddHandler(new wxChoiceXmlHandler); diff --git a/include/wx/xrc/xh_chckl.h b/include/wx/xrc/xh_chckl.h index f5913dce84..9a9d6889ae 100644 --- a/include/wx/xrc/xh_chckl.h +++ b/include/wx/xrc/xh_chckl.h @@ -17,10 +17,10 @@ #include "wx/xrc/xmlres.h" -class WXXMLDLLEXPORT wxCheckListXmlHandler : public wxXmlResourceHandler +class WXXMLDLLEXPORT wxCheckListBoxXmlHandler : public wxXmlResourceHandler { public: - wxCheckListXmlHandler(); + wxCheckListBoxXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); private: diff --git a/samples/xrc/rc/controls.xrc b/samples/xrc/rc/controls.xrc index 119716ad1b..6f927b1535 100644 --- a/samples/xrc/rc/controls.xrc +++ b/samples/xrc/rc/controls.xrc @@ -130,7 +130,7 @@ - + 1 @@ -142,7 +142,7 @@ wxALIGN_CENTRE|wxALL 5 - + 180,180 Download library diff --git a/src/xrc/xh_chckl.cpp b/src/xrc/xh_chckl.cpp index bac03e2823..48a55892c2 100644 --- a/src/xrc/xh_chckl.cpp +++ b/src/xrc/xh_chckl.cpp @@ -24,18 +24,22 @@ #include "wx/xrc/xh_chckl.h" #include "wx/checklst.h" #include "wx/intl.h" +#include "wx/log.h" -wxCheckListXmlHandler::wxCheckListXmlHandler() +wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler() : wxXmlResourceHandler(), m_insideBox(FALSE) { // no styles AddWindowStyles(); } -wxObject *wxCheckListXmlHandler::DoCreateResource() +wxObject *wxCheckListBoxXmlHandler::DoCreateResource() { - if (m_class == wxT("wxCheckList")) + if (m_class == wxT("wxCheckListBox") || m_class == wxT("wxCheckList")) { + if (m_class == wxT("wxCheckList")) + wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); + // need to build the list of strings from children m_insideBox = TRUE; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); @@ -101,10 +105,11 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() } } -bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node) +bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node) { - return (IsOfClass(node, wxT("wxCheckList")) || + return (IsOfClass(node, wxT("wxCheckListBox")) || + IsOfClass(node, wxT("wxCheckList")) /*backward compatibility*/ || (m_insideBox && node->GetName() == wxT("item"))); } -#endif \ No newline at end of file +#endif diff --git a/src/xrc/xmlrsall.cpp b/src/xrc/xmlrsall.cpp index 7de3f4f9cb..2749b9eb00 100644 --- a/src/xrc/xmlrsall.cpp +++ b/src/xrc/xmlrsall.cpp @@ -43,7 +43,7 @@ void wxXmlResource::InitAllHandlers() #endif AddHandler(new wxListCtrlXmlHandler); #if wxUSE_CHECKLISTBOX - AddHandler(new wxCheckListXmlHandler); + AddHandler(new wxCheckListBoxXmlHandler); #endif #if wxUSE_CHOICE AddHandler(new wxChoiceXmlHandler);