]>
Commit | Line | Data |
---|---|---|
2b5f62a0 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1c067fe3 | 2 | // Name: src/xrc/xh_scwin.cpp |
2b5f62a0 VZ |
3 | // Purpose: XRC resource for wxScrolledWindow |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2002/10/18 | |
2b5f62a0 VZ |
6 | // Copyright: (c) 2002 Vaclav Slavik |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
f80ea77b | 9 | |
2b5f62a0 VZ |
10 | // For compilers that support precompilation, includes "wx.h". |
11 | #include "wx/wxprec.h" | |
12 | ||
13 | #ifdef __BORLANDC__ | |
14 | #pragma hdrstop | |
15 | #endif | |
16 | ||
621be1ec | 17 | #if wxUSE_XRC |
a1e4ec87 | 18 | |
2b5f62a0 | 19 | #include "wx/xrc/xh_scwin.h" |
76b49cf4 WS |
20 | |
21 | #ifndef WX_PRECOMP | |
22 | #include "wx/frame.h" | |
1ab440bc | 23 | #include "wx/scrolwin.h" |
76b49cf4 WS |
24 | #endif |
25 | ||
854e189f | 26 | IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindowXmlHandler, wxXmlResourceHandler) |
2b5f62a0 | 27 | |
f80ea77b WS |
28 | wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler() |
29 | : wxXmlResourceHandler() | |
2b5f62a0 VZ |
30 | { |
31 | XRC_ADD_STYLE(wxHSCROLL); | |
32 | XRC_ADD_STYLE(wxVSCROLL); | |
ffdf1b49 RD |
33 | |
34 | // wxPanel styles | |
1c067fe3 | 35 | #if WXWIN_COMPATIBILITY_2_6 |
ffdf1b49 | 36 | XRC_ADD_STYLE(wxNO_3D); |
1c067fe3 | 37 | #endif // WXWIN_COMPATIBILITY_2_6 |
ffdf1b49 RD |
38 | XRC_ADD_STYLE(wxTAB_TRAVERSAL); |
39 | XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); | |
40 | ||
2b5f62a0 VZ |
41 | AddWindowStyles(); |
42 | } | |
43 | ||
44 | wxObject *wxScrolledWindowXmlHandler::DoCreateResource() | |
f80ea77b | 45 | { |
2b5f62a0 VZ |
46 | XRC_MAKE_INSTANCE(control, wxScrolledWindow) |
47 | ||
48 | control->Create(m_parentAsWindow, | |
49 | GetID(), | |
50 | GetPosition(), GetSize(), | |
51 | GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL), | |
52 | GetName()); | |
53 | ||
54 | SetupWindow(control); | |
ace1785b | 55 | CreateChildren(control); |
f80ea77b | 56 | |
b86c4f96 VS |
57 | if ( HasParam(wxT("scrollrate")) ) |
58 | { | |
59 | wxSize rate = GetSize(wxT("scrollrate")); | |
60 | control->SetScrollRate(rate.x, rate.y); | |
61 | } | |
62 | ||
2b5f62a0 VZ |
63 | return control; |
64 | } | |
65 | ||
66 | bool wxScrolledWindowXmlHandler::CanHandle(wxXmlNode *node) | |
67 | { | |
68 | return IsOfClass(node, wxT("wxScrolledWindow")); | |
69 | } | |
a1e4ec87 | 70 | |
621be1ec | 71 | #endif // wxUSE_XRC |