Commit | Line | Data |
---|---|---|
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 | ///////////////////////////////////////////////////////////////////////////// | |
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/xrc/xh_cald.h" | |
23 | #include "wx/event.h" | |
24 | #include "wx/calctrl.h" | |
25 | ||
26 | ||
27 | wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() | |
28 | : wxXmlResourceHandler() | |
29 | { | |
544fee32 VS |
30 | XRC_ADD_STYLE(wxCAL_SUNDAY_FIRST); |
31 | XRC_ADD_STYLE(wxCAL_MONDAY_FIRST); | |
32 | XRC_ADD_STYLE(wxCAL_SHOW_HOLIDAYS); | |
33 | XRC_ADD_STYLE(wxCAL_NO_YEAR_CHANGE); | |
34 | XRC_ADD_STYLE(wxCAL_NO_MONTH_CHANGE); | |
78d14f80 VS |
35 | AddWindowStyles(); |
36 | } | |
37 | ||
38 | ||
39 | wxObject *wxCalendarCtrlXmlHandler::DoCreateResource() | |
40 | { | |
544fee32 | 41 | XRC_MAKE_INSTANCE(calendar, wxCalendarCtrl); |
f2588180 VS |
42 | |
43 | calendar->Create(m_parentAsWindow, | |
44 | GetID(), | |
45 | wxDefaultDateTime, | |
46 | /*TODO: take it from resource*/ | |
47 | GetPosition(), GetSize(), | |
48 | GetStyle(), | |
49 | GetName()); | |
78d14f80 VS |
50 | |
51 | SetupWindow(calendar); | |
52 | ||
53 | return calendar; | |
54 | } | |
55 | ||
78d14f80 VS |
56 | bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node) |
57 | { | |
58 | return IsOfClass(node, wxT("wxCalendarCtrl")); | |
59 | } |