]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_datectrl.cpp
Make wxToolBar styles consistent and add wxTB_DEFAULT_STYLE.
[wxWidgets.git] / src / xrc / xh_datectrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/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 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_XRC && wxUSE_DATEPICKCTRL
19
20 #include "wx/xrc/xh_datectrl.h"
21 #include "wx/datectrl.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxDateCtrlXmlHandler, wxXmlResourceHandler)
24
25 wxDateCtrlXmlHandler::wxDateCtrlXmlHandler() : wxXmlResourceHandler()
26 {
27 XRC_ADD_STYLE(wxDP_DEFAULT);
28 XRC_ADD_STYLE(wxDP_SPIN);
29 XRC_ADD_STYLE(wxDP_DROPDOWN);
30 XRC_ADD_STYLE(wxDP_ALLOWNONE);
31 XRC_ADD_STYLE(wxDP_SHOWCENTURY);
32 AddWindowStyles();
33 }
34
35 wxObject *wxDateCtrlXmlHandler::DoCreateResource()
36 {
37 XRC_MAKE_INSTANCE(picker, wxDatePickerCtrl)
38
39 picker->Create(m_parentAsWindow,
40 GetID(),
41 wxDefaultDateTime,
42 GetPosition(), GetSize(),
43 GetStyle(wxT("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY),
44 wxDefaultValidator,
45 GetName());
46
47 SetupWindow(picker);
48
49 return picker;
50 }
51
52 bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node)
53 {
54 return IsOfClass(node, wxT("wxDatePickerCtrl"));
55 }
56
57 #endif // wxUSE_XRC && wxUSE_DATEPICKCTRL