X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..8173fefe0a9d61cfe5244a301044aa2269bc1c31:/contrib/src/xml/xh_dlg.cpp diff --git a/contrib/src/xml/xh_dlg.cpp b/contrib/src/xml/xh_dlg.cpp index a05fb8e0bf..045093f899 100644 --- a/contrib/src/xml/xh_dlg.cpp +++ b/contrib/src/xml/xh_dlg.cpp @@ -40,21 +40,23 @@ wxDialogXmlHandler::wxDialogXmlHandler() : wxXmlResourceHandler() ADD_STYLE(wxNO_3D); ADD_STYLE(wxTAB_TRAVERSAL); ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); + ADD_STYLE(wxCLIP_CHILDREN); + AddWindowStyles(); } wxObject *wxDialogXmlHandler::DoCreateResource() { - wxDialog *dlg = wxDynamicCast(m_Instance, wxDialog); + wxDialog *dlg = wxDynamicCast(m_instance, wxDialog); wxASSERT_MSG(dlg, _("XML resource: Cannot create dialog without instance.")); - dlg->Create(m_ParentAsWindow, + dlg->Create(m_parentAsWindow, GetID(), - GetText(_T("title")), + GetText(wxT("title")), wxDefaultPosition, wxDefaultSize, - GetStyle(_T("style"), wxDEFAULT_DIALOG_STYLE), + GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE), GetName()); dlg->SetClientSize(GetSize()); dlg->Move(GetPosition()); @@ -62,6 +64,9 @@ wxObject *wxDialogXmlHandler::DoCreateResource() CreateChildren(dlg); + if (GetBool(_("centered"), FALSE)) + dlg->Centre(); + return dlg; } @@ -69,7 +74,7 @@ wxObject *wxDialogXmlHandler::DoCreateResource() bool wxDialogXmlHandler::CanHandle(wxXmlNode *node) { - return node->GetName() == _T("dialog"); + return IsOfClass(node, wxT("wxDialog")); }