]>
Commit | Line | Data |
---|---|---|
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 | ||
26 | wxScrollBarXmlHandler::wxScrollBarXmlHandler() | |
27 | : wxXmlResourceHandler() | |
28 | { | |
29 | ADD_STYLE( wxSB_HORIZONTAL ); | |
30 | ADD_STYLE( wxSB_VERTICAL ); | |
31 | AddWindowStyles(); | |
32 | } | |
33 | ||
34 | wxObject *wxScrollBarXmlHandler::DoCreateResource() | |
35 | { | |
f2588180 VS |
36 | wxScrollBar *control = wxStaticCast(m_instance, wxScrollBar); |
37 | ||
38 | if (!control) | |
39 | control = new wxScrollBar; | |
40 | ||
41 | control->Create(m_parentAsWindow, | |
42 | GetID(), | |
43 | GetPosition(), GetSize(), | |
44 | GetStyle(), | |
45 | wxDefaultValidator, | |
46 | GetName()); | |
47 | ||
78d14f80 VS |
48 | control->SetScrollbar(GetLong( wxT("value"), 0), |
49 | GetLong( wxT("thumbsize"),1), | |
50 | GetLong( wxT("range"), 10), | |
51 | GetLong( wxT("pagesize"),1) | |
52 | ); | |
53 | ||
54 | ||
55 | SetupWindow(control); | |
56 | ||
57 | return control; | |
58 | } | |
59 | ||
60 | ||
61 | ||
62 | bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node) | |
63 | { | |
64 | return IsOfClass(node, wxT("wxScrollBar")); | |
65 | } | |
66 | ||
67 | ||
68 |