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