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