]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_datectrl.cpp
(Flickery) fix for droppings when there are no notebook pages
[wxWidgets.git] / src / xrc / xh_datectrl.cpp
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
22 #if wxUSE_XRC && wxUSE_DATEPICKCTRL
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_ALLOWNONE);
35 XRC_ADD_STYLE(wxDP_SHOWCENTURY);
36 AddWindowStyles();
37 }
38
39 wxObject *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
56 bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node)
57 {
58 return IsOfClass(node, wxT("wxDatePickerCtrl"));
59 }
60
61 #endif // wxUSE_XRC && wxUSE_DATEPICKCTRL