X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..b1229561e530e829f61887930f2004d9814743b0:/contrib/src/xml/xh_bttn.cpp diff --git a/contrib/src/xml/xh_bttn.cpp b/contrib/src/xml/xh_bttn.cpp index 39c58b4989..c73b849310 100644 --- a/contrib/src/xml/xh_bttn.cpp +++ b/contrib/src/xml/xh_bttn.cpp @@ -23,14 +23,22 @@ #include "wx/button.h" +wxButtonXmlHandler::wxButtonXmlHandler() +: wxXmlResourceHandler() +{ + AddWindowStyles(); +} + + wxObject *wxButtonXmlHandler::DoCreateResource() { wxButton *button = new wxButton(m_ParentAsWindow, GetID(), GetText(_T("label")), GetPosition(), GetSize(), - GetStyle()); - button->SetName(GetName()); + GetStyle(), + wxDefaultValidator, + GetName()); if (GetBool(_T("default"), 0) == 1) button->SetDefault(); SetupWindow(button); @@ -41,7 +49,7 @@ wxObject *wxButtonXmlHandler::DoCreateResource() bool wxButtonXmlHandler::CanHandle(wxXmlNode *node) { - return node->GetName() == _T("button"); + return IsOfClass(node, _T("wxButton")); }