]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_animatctrl.cpp
delay setting the window shape until it is realized (slightly modified patch 1935497)
[wxWidgets.git] / src / xrc / xh_animatctrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_animatctrl.cpp
3 // Purpose: XML resource handler for wxAnimationCtrl
4 // Author: Francesco Montorsi
5 // Created: 2006-10-15
6 // RCS-ID: $Id$
7 // Copyright: (c) 2006 Francesco Montorsi
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 && wxUSE_ANIMATIONCTRL
19
20 #include "wx/xrc/xh_animatctrl.h"
21 #include "wx/animate.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxAnimationCtrlXmlHandler, wxXmlResourceHandler)
24
25 wxAnimationCtrlXmlHandler::wxAnimationCtrlXmlHandler() : wxXmlResourceHandler()
26 {
27 XRC_ADD_STYLE(wxAC_NO_AUTORESIZE);
28 XRC_ADD_STYLE(wxAC_DEFAULT_STYLE);
29 AddWindowStyles();
30 }
31
32 wxObject *wxAnimationCtrlXmlHandler::DoCreateResource()
33 {
34 XRC_MAKE_INSTANCE(ctrl, wxAnimationCtrl)
35
36 ctrl->Create(m_parentAsWindow,
37 GetID(),
38 GetAnimation(wxT("animation")),
39 GetPosition(), GetSize(),
40 GetStyle(_T("style"), wxAC_DEFAULT_STYLE),
41 GetName());
42
43 // if no inactive-bitmap has been provided, GetBitmap() will return wxNullBitmap
44 // which just tells wxAnimationCtrl to use the default for inactive status
45 ctrl->SetInactiveBitmap(GetBitmap(wxT("inactive-bitmap")));
46
47 SetupWindow(ctrl);
48
49 return ctrl;
50 }
51
52 bool wxAnimationCtrlXmlHandler::CanHandle(wxXmlNode *node)
53 {
54 return IsOfClass(node, wxT("wxAnimationCtrl"));
55 }
56
57 #endif // wxUSE_XRC && wxUSE_ANIMATIONCTRL