]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_datectrl.cpp
Generalised WinCE fix for other platforms
[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
11#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
12#pragma implementation "xh_datectrl.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
1ee3fb38 22#if wxUSE_XRC && wxUSE_DATEPICKCTRL
310e47b3
VS
23
24#include "wx/xrc/xh_datectrl.h"
25#include "wx/datectrl.h"
26
27IMPLEMENT_DYNAMIC_CLASS(wxDateCtrlXmlHandler, wxXmlResourceHandler)
28
29wxDateCtrlXmlHandler::wxDateCtrlXmlHandler() : wxXmlResourceHandler()
30{
31 XRC_ADD_STYLE(wxDP_DEFAULT);
32 XRC_ADD_STYLE(wxDP_SPIN);
33 XRC_ADD_STYLE(wxDP_DROPDOWN);
4e1ba52e 34 XRC_ADD_STYLE(wxDP_ALLOWNONE);
310e47b3
VS
35 XRC_ADD_STYLE(wxDP_SHOWCENTURY);
36 AddWindowStyles();
37}
38
39wxObject *wxDateCtrlXmlHandler::DoCreateResource()
40{
41 XRC_MAKE_INSTANCE(picker, wxDatePickerCtrl)
42
43 picker->Create(m_parentAsWindow,
44 GetID(),
45 wxDefaultDateTime,
46 GetPosition(), GetSize(),
47 GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY),
48 wxDefaultValidator,
49 GetName());
50
51 SetupWindow(picker);
52
53 return picker;
54}
55
56bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node)
57{
58 return IsOfClass(node, wxT("wxDatePickerCtrl"));
59}
60
1ee3fb38 61#endif // wxUSE_XRC && wxUSE_DATEPICKCTRL