]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_scrol.cpp
cleanup
[wxWidgets.git] / src / xrc / xh_scrol.cpp
CommitLineData
78d14f80 1/////////////////////////////////////////////////////////////////////////////
851dee09 2// Name: src/xrc/xh_scrol.cpp
b5d6954b 3// Purpose: XRC resource for wxScrollBar
78d14f80
VS
4// Author: Brian Gavin
5// Created: 2000/09/09
6// RCS-ID: $Id$
7// Copyright: (c) 2000 Brian Gavin
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
f80ea77b 10
78d14f80
VS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
524065c1 18#if wxUSE_XRC && wxUSE_SCROLLBAR
a1e4ec87 19
78d14f80 20#include "wx/xrc/xh_scrol.h"
851dee09
WS
21
22#ifndef WX_PRECOMP
23 #include "wx/scrolbar.h"
24#endif
78d14f80 25
854e189f 26IMPLEMENT_DYNAMIC_CLASS(wxScrollBarXmlHandler, wxXmlResourceHandler)
78d14f80 27
f80ea77b
WS
28wxScrollBarXmlHandler::wxScrollBarXmlHandler()
29: wxXmlResourceHandler()
78d14f80 30{
544fee32
VS
31 XRC_ADD_STYLE(wxSB_HORIZONTAL);
32 XRC_ADD_STYLE(wxSB_VERTICAL);
78d14f80
VS
33 AddWindowStyles();
34}
35
36wxObject *wxScrollBarXmlHandler::DoCreateResource()
f80ea77b 37{
544fee32 38 XRC_MAKE_INSTANCE(control, wxScrollBar)
f2588180
VS
39
40 control->Create(m_parentAsWindow,
41 GetID(),
42 GetPosition(), GetSize(),
43 GetStyle(),
44 wxDefaultValidator,
45 GetName());
46
f80ea77b 47 control->SetScrollbar(GetLong( wxT("value"), 0),
78d14f80
VS
48 GetLong( wxT("thumbsize"),1),
49 GetLong( wxT("range"), 10),
544fee32
VS
50 GetLong( wxT("pagesize"),1));
51
78d14f80 52 SetupWindow(control);
6cc78259 53 CreateChildren(control);
f80ea77b 54
78d14f80
VS
55 return control;
56}
57
78d14f80
VS
58bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
59{
60 return IsOfClass(node, wxT("wxScrollBar"));
61}
a1e4ec87 62
524065c1 63#endif // wxUSE_XRC && wxUSE_SCROLLBAR