X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..9d8c2f419f522408a922277df330d4c4511befb9:/contrib/src/xml/xh_stbmp.cpp?ds=sidebyside diff --git a/contrib/src/xml/xh_stbmp.cpp b/contrib/src/xml/xh_stbmp.cpp index 903b84b92d..2d5b3c9472 100644 --- a/contrib/src/xml/xh_stbmp.cpp +++ b/contrib/src/xml/xh_stbmp.cpp @@ -21,24 +21,18 @@ #include "wx/xml/xh_stbmp.h" #include "wx/statbmp.h" -#include "wx/image.h" -#include "wx/bitmap.h" wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler() : wxXmlResourceHandler() { + AddWindowStyles(); } wxObject *wxStaticBitmapXmlHandler::DoCreateResource() { - wxImage img(GetParamValue(_T("bitmap"))); - wxSize sz = GetSize(); - - if (!(sz == wxDefaultSize)) img.Rescale(sz.x, sz.y); - - wxStaticBitmap *bmp = new wxStaticBitmap(m_ParentAsWindow, + wxStaticBitmap *bmp = new wxStaticBitmap(m_parentAsWindow, GetID(), - img.ConvertToBitmap(), + GetBitmap(wxT("bitmap"), GetSize()), GetPosition(), GetSize(), GetStyle(), GetName() @@ -52,7 +46,7 @@ wxObject *wxStaticBitmapXmlHandler::DoCreateResource() bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node) { - return node->GetName() == _T("staticbitmap"); + return IsOfClass(node, wxT("wxStaticBitmap")); }