]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xrc/xh_stbmp.cpp
Changes to the XRC library:
[wxWidgets.git] / contrib / src / xrc / xh_stbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_stbmp.cpp
3 // Purpose: XRC resource for wxStaticBitmap
4 // Author: Vaclav Slavik
5 // Created: 2000/04/22
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "xh_stbmp.h"
13 #endif
14
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 #include "wx/xrc/xh_stbmp.h"
23 #include "wx/statbmp.h"
24
25 wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler()
26 : wxXmlResourceHandler()
27 {
28 AddWindowStyles();
29 }
30
31 wxObject *wxStaticBitmapXmlHandler::DoCreateResource()
32 {
33 wxStaticBitmap *bmp = wxStaticCast(m_instance, wxStaticBitmap);
34
35 if (!bmp)
36 bmp = new wxStaticBitmap;
37
38 bmp->Create(m_parentAsWindow,
39 GetID(),
40 GetBitmap(wxT("bitmap"), GetSize()),
41 GetPosition(), GetSize(),
42 GetStyle(),
43 GetName());
44
45 SetupWindow(bmp);
46
47 return bmp;
48 }
49
50
51
52 bool wxStaticBitmapXmlHandler::CanHandle(wxXmlNode *node)
53 {
54 return IsOfClass(node, wxT("wxStaticBitmap"));
55 }
56
57