]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_scrol.cpp
fix for GetParent() in wxTR_HIDE_ROOT case
[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/////////////////////////////////////////////////////////////////////////////
10
11#ifdef __GNUG__
12#pragma implementation "xh_scrol.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#include "wx/xrc/xh_scrol.h"
23#include "wx/scrolbar.h"
24
25
26wxScrollBarXmlHandler::wxScrollBarXmlHandler()
27: wxXmlResourceHandler()
28{
544fee32
VS
29 XRC_ADD_STYLE(wxSB_HORIZONTAL);
30 XRC_ADD_STYLE(wxSB_VERTICAL);
78d14f80
VS
31 AddWindowStyles();
32}
33
34wxObject *wxScrollBarXmlHandler::DoCreateResource()
35{
544fee32 36 XRC_MAKE_INSTANCE(control, wxScrollBar)
f2588180
VS
37
38 control->Create(m_parentAsWindow,
39 GetID(),
40 GetPosition(), GetSize(),
41 GetStyle(),
42 wxDefaultValidator,
43 GetName());
44
78d14f80
VS
45 control->SetScrollbar(GetLong( wxT("value"), 0),
46 GetLong( wxT("thumbsize"),1),
47 GetLong( wxT("range"), 10),
544fee32
VS
48 GetLong( wxT("pagesize"),1));
49
78d14f80
VS
50 SetupWindow(control);
51
52 return control;
53}
54
78d14f80
VS
55bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
56{
57 return IsOfClass(node, wxT("wxScrollBar"));
58}