]>
Commit | Line | Data |
---|---|---|
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 | ||
27 | IMPLEMENT_DYNAMIC_CLASS(wxDateCtrlXmlHandler, wxXmlResourceHandler) | |
28 | ||
29 | wxDateCtrlXmlHandler::wxDateCtrlXmlHandler() : wxXmlResourceHandler() | |
30 | { | |
31 | XRC_ADD_STYLE(wxDP_DEFAULT); | |
32 | XRC_ADD_STYLE(wxDP_SPIN); | |
33 | XRC_ADD_STYLE(wxDP_DROPDOWN); | |
34 | XRC_ADD_STYLE(wxDP_SHOWCENTURY); | |
35 | AddWindowStyles(); | |
36 | } | |
37 | ||
38 | wxObject *wxDateCtrlXmlHandler::DoCreateResource() | |
39 | { | |
40 | XRC_MAKE_INSTANCE(picker, wxDatePickerCtrl) | |
41 | ||
42 | picker->Create(m_parentAsWindow, | |
43 | GetID(), | |
44 | wxDefaultDateTime, | |
45 | GetPosition(), GetSize(), | |
46 | GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY), | |
47 | wxDefaultValidator, | |
48 | GetName()); | |
49 | ||
50 | SetupWindow(picker); | |
51 | ||
52 | return picker; | |
53 | } | |
54 | ||
55 | bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node) | |
56 | { | |
57 | return IsOfClass(node, wxT("wxDatePickerCtrl")); | |
58 | } | |
59 | ||
1ee3fb38 | 60 | #endif // wxUSE_XRC && wxUSE_DATEPICKCTRL |