]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_scrol.cpp
Include wx/stream.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / xrc / xh_scrol.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_scrol.cpp
3 // Purpose: XRC resource for wxScrollBar
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 // 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_SCROLLBAR
19
20 #include "wx/xrc/xh_scrol.h"
21 #include "wx/scrolbar.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxScrollBarXmlHandler, wxXmlResourceHandler)
24
25 wxScrollBarXmlHandler::wxScrollBarXmlHandler()
26 : wxXmlResourceHandler()
27 {
28 XRC_ADD_STYLE(wxSB_HORIZONTAL);
29 XRC_ADD_STYLE(wxSB_VERTICAL);
30 AddWindowStyles();
31 }
32
33 wxObject *wxScrollBarXmlHandler::DoCreateResource()
34 {
35 XRC_MAKE_INSTANCE(control, wxScrollBar)
36
37 control->Create(m_parentAsWindow,
38 GetID(),
39 GetPosition(), GetSize(),
40 GetStyle(),
41 wxDefaultValidator,
42 GetName());
43
44 control->SetScrollbar(GetLong( wxT("value"), 0),
45 GetLong( wxT("thumbsize"),1),
46 GetLong( wxT("range"), 10),
47 GetLong( wxT("pagesize"),1));
48
49 SetupWindow(control);
50 CreateChildren(control);
51
52 return control;
53 }
54
55 bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
56 {
57 return IsOfClass(node, wxT("wxScrollBar"));
58 }
59
60 #endif // wxUSE_XRC && wxUSE_SCROLLBAR