]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_scwin.cpp
Fix another crash when conversion fails in Unix PostScript code.
[wxWidgets.git] / src / xrc / xh_scwin.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_scwin.cpp
3 // Purpose: XRC resource for wxScrolledWindow
4 // Author: Vaclav Slavik
5 // Created: 2002/10/18
6 // Copyright: (c) 2002 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #ifdef __BORLANDC__
14 #pragma hdrstop
15 #endif
16
17 #if wxUSE_XRC
18
19 #include "wx/xrc/xh_scwin.h"
20
21 #ifndef WX_PRECOMP
22 #include "wx/frame.h"
23 #include "wx/scrolwin.h"
24 #endif
25
26 IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindowXmlHandler, wxXmlResourceHandler)
27
28 wxScrolledWindowXmlHandler::wxScrolledWindowXmlHandler()
29 : wxXmlResourceHandler()
30 {
31 XRC_ADD_STYLE(wxHSCROLL);
32 XRC_ADD_STYLE(wxVSCROLL);
33
34 // wxPanel styles
35 #if WXWIN_COMPATIBILITY_2_6
36 XRC_ADD_STYLE(wxNO_3D);
37 #endif // WXWIN_COMPATIBILITY_2_6
38 XRC_ADD_STYLE(wxTAB_TRAVERSAL);
39 XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY);
40
41 AddWindowStyles();
42 }
43
44 wxObject *wxScrolledWindowXmlHandler::DoCreateResource()
45 {
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);
55 CreateChildren(control);
56
57 if ( HasParam(wxT("scrollrate")) )
58 {
59 wxSize rate = GetSize(wxT("scrollrate"));
60 control->SetScrollRate(rate.x, rate.y);
61 }
62
63 return control;
64 }
65
66 bool wxScrolledWindowXmlHandler::CanHandle(wxXmlNode *node)
67 {
68 return IsOfClass(node, wxT("wxScrolledWindow"));
69 }
70
71 #endif // wxUSE_XRC