~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to src/xrc/xh_timectrl.cpp

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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: xh_timectrl.cpp 69225 2011-09-29 13:43:23Z VZ $
 
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