X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56d2f75071fc2a29ec10abe97c5a908bb35f30f4..45805ba32255e4115b2ddddc15a5db5720ecb7ba:/contrib/src/xml/xh_stbmp.cpp diff --git a/contrib/src/xml/xh_stbmp.cpp b/contrib/src/xml/xh_stbmp.cpp index 903b84b92d..699e5339a5 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, 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")); }