From 56572188ee00e43ac185f89dd7acb0872fc00b0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 28 Aug 2003 09:36:54 +0000 Subject: [PATCH] wxCheckList -> wxCheckListBox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xrc/xh_chckl.h | 6 +++--- contrib/samples/xrc/rc/controls.xrc | 4 ++-- contrib/src/xrc/xh_chckl.cpp | 24 ++++++++++++++++++------ contrib/src/xrc/xmlrsall.cpp | 2 +- include/wx/xrc/xh_chckl.h | 6 +++--- samples/xrc/rc/controls.xrc | 4 ++-- src/xrc/xh_chckl.cpp | 24 ++++++++++++++++++------ src/xrc/xmlrsall.cpp | 2 +- 8 files changed, 48 insertions(+), 24 deletions(-) diff --git a/contrib/include/wx/xrc/xh_chckl.h b/contrib/include/wx/xrc/xh_chckl.h index f662f31c69..4db9c50128 100644 --- a/contrib/include/wx/xrc/xh_chckl.h +++ b/contrib/include/wx/xrc/xh_chckl.h @@ -17,11 +17,11 @@ #include "wx/xrc/xmlres.h" -class WXDLLIMPEXP_XRC wxCheckListXmlHandler : public wxXmlResourceHandler +class WXDLLIMPEXP_XRC wxCheckListBoxXmlHandler : public wxXmlResourceHandler { -DECLARE_DYNAMIC_CLASS(wxCheckListXmlHandler) +DECLARE_DYNAMIC_CLASS(wxCheckListBoxXmlHandler) 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 6972bd4cb7..e441962fb9 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 fb8c71ad34..522612a264 100644 --- a/contrib/src/xrc/xh_chckl.cpp +++ b/contrib/src/xrc/xh_chckl.cpp @@ -24,20 +24,29 @@ #include "wx/xrc/xh_chckl.h" #include "wx/checklst.h" #include "wx/intl.h" +#include "wx/log.h" -IMPLEMENT_DYNAMIC_CLASS(wxCheckListXmlHandler, wxXmlResourceHandler) +IMPLEMENT_DYNAMIC_CLASS(wxCheckListBoxXmlHandler, wxXmlResourceHandler) -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") +#if WXWIN_COMPATIBILITY_2_4 + || m_class == wxT("wxCheckList") +#endif + ) { +#if WXWIN_COMPATIBILITY_2_4 + if (m_class == wxT("wxCheckList")) + wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); +#endif // need to build the list of strings from children m_insideBox = TRUE; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); @@ -103,9 +112,12 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() } } -bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node) +bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node) { - return (IsOfClass(node, wxT("wxCheckList")) || + return (IsOfClass(node, wxT("wxCheckListBox")) || +#if WXWIN_COMPATIBILITY_2_4 + IsOfClass(node, wxT("wxCheckList")) || +#endif (m_insideBox && node->GetName() == wxT("item"))); } 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 f662f31c69..4db9c50128 100644 --- a/include/wx/xrc/xh_chckl.h +++ b/include/wx/xrc/xh_chckl.h @@ -17,11 +17,11 @@ #include "wx/xrc/xmlres.h" -class WXDLLIMPEXP_XRC wxCheckListXmlHandler : public wxXmlResourceHandler +class WXDLLIMPEXP_XRC wxCheckListBoxXmlHandler : public wxXmlResourceHandler { -DECLARE_DYNAMIC_CLASS(wxCheckListXmlHandler) +DECLARE_DYNAMIC_CLASS(wxCheckListBoxXmlHandler) 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 6972bd4cb7..e441962fb9 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 fb8c71ad34..522612a264 100644 --- a/src/xrc/xh_chckl.cpp +++ b/src/xrc/xh_chckl.cpp @@ -24,20 +24,29 @@ #include "wx/xrc/xh_chckl.h" #include "wx/checklst.h" #include "wx/intl.h" +#include "wx/log.h" -IMPLEMENT_DYNAMIC_CLASS(wxCheckListXmlHandler, wxXmlResourceHandler) +IMPLEMENT_DYNAMIC_CLASS(wxCheckListBoxXmlHandler, wxXmlResourceHandler) -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") +#if WXWIN_COMPATIBILITY_2_4 + || m_class == wxT("wxCheckList") +#endif + ) { +#if WXWIN_COMPATIBILITY_2_4 + if (m_class == wxT("wxCheckList")) + wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); +#endif // need to build the list of strings from children m_insideBox = TRUE; CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); @@ -103,9 +112,12 @@ wxObject *wxCheckListXmlHandler::DoCreateResource() } } -bool wxCheckListXmlHandler::CanHandle(wxXmlNode *node) +bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node) { - return (IsOfClass(node, wxT("wxCheckList")) || + return (IsOfClass(node, wxT("wxCheckListBox")) || +#if WXWIN_COMPATIBILITY_2_4 + IsOfClass(node, wxT("wxCheckList")) || +#endif (m_insideBox && node->GetName() == wxT("item"))); } 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); -- 2.45.2