]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_cald.cpp
fixed incorrect XtVaXXX() function call (thanks to g++ 4 for detecting this!)
[wxWidgets.git] / src / xrc / xh_cald.cpp
CommitLineData
78d14f80
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_cald.cpp
b5d6954b 3// Purpose: XRC resource for wxCalendarCtrl
78d14f80
VS
4// Author: Brian Gavin
5// Created: 2000/09/09
6// RCS-ID: $Id$
7// Copyright: (c) 2000 Brian Gavin
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
f80ea77b 10
78d14f80
VS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
621be1ec 18#if wxUSE_XRC && wxUSE_CALENDARCTRL
f03b9d45 19
78d14f80
VS
20#include "wx/xrc/xh_cald.h"
21#include "wx/event.h"
22#include "wx/calctrl.h"
23
854e189f 24IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler, wxXmlResourceHandler)
78d14f80 25
f80ea77b
WS
26wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler()
27: wxXmlResourceHandler()
78d14f80 28{
544fee32
VS
29 XRC_ADD_STYLE(wxCAL_SUNDAY_FIRST);
30 XRC_ADD_STYLE(wxCAL_MONDAY_FIRST);
31 XRC_ADD_STYLE(wxCAL_SHOW_HOLIDAYS);
32 XRC_ADD_STYLE(wxCAL_NO_YEAR_CHANGE);
33 XRC_ADD_STYLE(wxCAL_NO_MONTH_CHANGE);
c1250407
JS
34 XRC_ADD_STYLE(wxCAL_SEQUENTIAL_MONTH_SELECTION);
35 XRC_ADD_STYLE(wxCAL_SHOW_SURROUNDING_WEEKS);
36
78d14f80
VS
37 AddWindowStyles();
38}
39
40
41wxObject *wxCalendarCtrlXmlHandler::DoCreateResource()
f80ea77b 42{
544fee32 43 XRC_MAKE_INSTANCE(calendar, wxCalendarCtrl);
f2588180
VS
44
45 calendar->Create(m_parentAsWindow,
46 GetID(),
47 wxDefaultDateTime,
48 /*TODO: take it from resource*/
49 GetPosition(), GetSize(),
50 GetStyle(),
51 GetName());
f80ea77b 52
78d14f80 53 SetupWindow(calendar);
f80ea77b 54
78d14f80
VS
55 return calendar;
56}
57
78d14f80
VS
58bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node)
59{
60 return IsOfClass(node, wxT("wxCalendarCtrl"));
61}
f03b9d45 62
621be1ec 63#endif // wxUSE_XRC && wxUSE_CALENDARCTRL