]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/gizmos/xh_statpict.cpp
glibc's vswprintf doesn't nul terminate on truncation.
[wxWidgets.git] / contrib / src / gizmos / xh_statpict.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_statpict.cpp
3 // Purpose: XRC resource handler for wxStaticPicture
4 // Author: David A. Norris
5 // Created: 2005/03/13
6 // RCS-ID: $Id$
7 // Copyright: David A. Norris
8 // Licence: wxWindows Licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_XRC
19
20 #include "wx/gizmos/statpict.h"
21 #include "wx/gizmos/xh_statpict.h"
22
23 // Register with wxWindows' dynamic class subsystem.
24 IMPLEMENT_DYNAMIC_CLASS(wxStaticPictureXmlHandler, wxXmlResourceHandler)
25
26 // Constructor.
27 wxStaticPictureXmlHandler::wxStaticPictureXmlHandler()
28 {
29 AddWindowStyles();
30 }
31
32 // Creates the control and returns a pointer to it.
33 wxObject *wxStaticPictureXmlHandler::DoCreateResource()
34 {
35 XRC_MAKE_INSTANCE(control, wxStaticPicture)
36
37 control->Create(m_parentAsWindow, GetID(),
38 GetBitmap(wxT("bitmap"), wxART_OTHER, GetSize()),
39 GetPosition(), GetSize(), GetStyle(), GetName());
40
41 SetupWindow(control);
42
43 return control;
44 }
45
46 // Returns true if we know how to create a control for the given node.
47 bool wxStaticPictureXmlHandler::CanHandle(wxXmlNode *node)
48 {
49 return IsOfClass(node, wxT("wxStaticPicture"));
50 }
51
52 #endif // wxUSE_XRC