]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_datectrl.cpp
Committing in .
[wxWidgets.git] / src / xrc / xh_datectrl.cpp
CommitLineData
310e47b3
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_datectrl.cpp
3// Purpose: XML resource handler for wxDatePickerCtrl
4// Author: Vaclav Slavik
5// Created: 2005-02-07
6// RCS-ID: $Id$
7// Copyright: (c) 2005 Vaclav Slavik
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
310e47b3
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
1ee3fb38 18#if wxUSE_XRC && wxUSE_DATEPICKCTRL
310e47b3
VS
19
20#include "wx/xrc/xh_datectrl.h"
21#include "wx/datectrl.h"
22
23IMPLEMENT_DYNAMIC_CLASS(wxDateCtrlXmlHandler, wxXmlResourceHandler)
24
25wxDateCtrlXmlHandler::wxDateCtrlXmlHandler() : wxXmlResourceHandler()
26{
27 XRC_ADD_STYLE(wxDP_DEFAULT);
28 XRC_ADD_STYLE(wxDP_SPIN);
29 XRC_ADD_STYLE(wxDP_DROPDOWN);
4e1ba52e 30 XRC_ADD_STYLE(wxDP_ALLOWNONE);
310e47b3
VS
31 XRC_ADD_STYLE(wxDP_SHOWCENTURY);
32 AddWindowStyles();
33}
34
35wxObject *wxDateCtrlXmlHandler::DoCreateResource()
36{
37 XRC_MAKE_INSTANCE(picker, wxDatePickerCtrl)
38
39 picker->Create(m_parentAsWindow,
40 GetID(),
41 wxDefaultDateTime,
42 GetPosition(), GetSize(),
43 GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY),
44 wxDefaultValidator,
45 GetName());
46
47 SetupWindow(picker);
48
49 return picker;
50}
51
52bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node)
53{
54 return IsOfClass(node, wxT("wxDatePickerCtrl"));
55}
56
1ee3fb38 57#endif // wxUSE_XRC && wxUSE_DATEPICKCTRL