]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_scrol.cpp
wxTinderbox build fix.
[wxWidgets.git] / src / xrc / xh_scrol.cpp
CommitLineData
78d14f80
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: 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
VS
20#include "wx/xrc/xh_scrol.h"
21#include "wx/scrolbar.h"
22
854e189f 23IMPLEMENT_DYNAMIC_CLASS(wxScrollBarXmlHandler, wxXmlResourceHandler)
78d14f80 24
f80ea77b
WS
25wxScrollBarXmlHandler::wxScrollBarXmlHandler()
26: wxXmlResourceHandler()
78d14f80 27{
544fee32
VS
28 XRC_ADD_STYLE(wxSB_HORIZONTAL);
29 XRC_ADD_STYLE(wxSB_VERTICAL);
78d14f80
VS
30 AddWindowStyles();
31}
32
33wxObject *wxScrollBarXmlHandler::DoCreateResource()
f80ea77b 34{
544fee32 35 XRC_MAKE_INSTANCE(control, wxScrollBar)
f2588180
VS
36
37 control->Create(m_parentAsWindow,
38 GetID(),
39 GetPosition(), GetSize(),
40 GetStyle(),
41 wxDefaultValidator,
42 GetName());
43
f80ea77b 44 control->SetScrollbar(GetLong( wxT("value"), 0),
78d14f80
VS
45 GetLong( wxT("thumbsize"),1),
46 GetLong( wxT("range"), 10),
544fee32
VS
47 GetLong( wxT("pagesize"),1));
48
78d14f80 49 SetupWindow(control);
6cc78259 50 CreateChildren(control);
f80ea77b 51
78d14f80
VS
52 return control;
53}
54
78d14f80
VS
55bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
56{
57 return IsOfClass(node, wxT("wxScrollBar"));
58}
a1e4ec87 59
524065c1 60#endif // wxUSE_XRC && wxUSE_SCROLLBAR