]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_timectrl.cpp
Implement wxComboCtrl::GetSizeFromTextSize().
[wxWidgets.git] / src / xrc / xh_timectrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_timectrl.cpp
3 // Purpose: XML resource handler for wxTimePickerCtrl
4 // Author: Vadim Zeitlin
5 // Created: 2011-09-22
6 // RCS-ID: $Id$
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
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_TIMEPICKCTRL
19
20 #include "wx/xrc/xh_timectrl.h"
21 #include "wx/timectrl.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxTimeCtrlXmlHandler, wxXmlResourceHandler)
24
25 wxTimeCtrlXmlHandler::wxTimeCtrlXmlHandler()
26 {
27 XRC_ADD_STYLE(wxTP_DEFAULT);
28 AddWindowStyles();
29 }
30
31 wxObject *wxTimeCtrlXmlHandler::DoCreateResource()
32 {
33 XRC_MAKE_INSTANCE(picker, wxTimePickerCtrl)
34
35 picker->Create(m_parentAsWindow,
36 GetID(),
37 wxDefaultDateTime,
38 GetPosition(), GetSize(),
39 GetStyle(wxT("style"), wxTP_DEFAULT),
40 wxDefaultValidator,
41 GetName());
42
43 SetupWindow(picker);
44
45 return picker;
46 }
47
48 bool wxTimeCtrlXmlHandler::CanHandle(wxXmlNode *node)
49 {
50 return IsOfClass(node, wxS("wxTimePickerCtrl"));
51 }
52
53 #endif // wxUSE_XRC && wxUSE_TIMEPICKCTRL