]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xrc/xh_cald.cpp
define WX_XTI_TEMPLATE_FIX in case it is not yet
[wxWidgets.git] / contrib / src / xrc / xh_cald.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_cald.cpp
3 // Purpose: XRC resource for wxCalendarCtrl
4 // Author: Brian Gavin
5 // Created: 2000/09/09
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Brian Gavin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "xh_cald.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/setup.h"
23
24 #if wxUSE_CALENDARCTRL
25
26 #include "wx/xrc/xh_cald.h"
27 #include "wx/event.h"
28 #include "wx/calctrl.h"
29
30 IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler, wxXmlResourceHandler)
31
32 wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler()
33 : wxXmlResourceHandler()
34 {
35 XRC_ADD_STYLE(wxCAL_SUNDAY_FIRST);
36 XRC_ADD_STYLE(wxCAL_MONDAY_FIRST);
37 XRC_ADD_STYLE(wxCAL_SHOW_HOLIDAYS);
38 XRC_ADD_STYLE(wxCAL_NO_YEAR_CHANGE);
39 XRC_ADD_STYLE(wxCAL_NO_MONTH_CHANGE);
40 AddWindowStyles();
41 }
42
43
44 wxObject *wxCalendarCtrlXmlHandler::DoCreateResource()
45 {
46 XRC_MAKE_INSTANCE(calendar, wxCalendarCtrl);
47
48 calendar->Create(m_parentAsWindow,
49 GetID(),
50 wxDefaultDateTime,
51 /*TODO: take it from resource*/
52 GetPosition(), GetSize(),
53 GetStyle(),
54 GetName());
55
56 SetupWindow(calendar);
57
58 return calendar;
59 }
60
61 bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node)
62 {
63 return IsOfClass(node, wxT("wxCalendarCtrl"));
64 }
65
66 #endif