#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()
bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
{
- return node->GetName() == _T("staticbitmap");
+ return IsOfClass(node, wxT("wxStaticBitmap"));
}