]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_scrol.cpp
Fixed buffer overrun in call to wxStripMenuCodes()
[wxWidgets.git] / contrib / src / xml / xh_scrol.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_scrol.cpp
3 // Purpose: XML 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 #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/xml/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 {
36 wxScrollBar *control = new wxScrollBar(m_ParentAsWindow,
37 GetID(),
38 GetPosition(), GetSize(),
39 GetStyle(),
40 wxDefaultValidator,
41 GetName()
42 );
43 control->SetScrollbar(GetLong( _T("value"), 0),
44 GetLong( _T("thumbsize"),1),
45 GetLong( _T("range"), 10),
46 GetLong( _T("pagesize"),1)
47 );
48
49
50 SetupWindow(control);
51
52 return control;
53 }
54
55
56
57 bool wxScrollBarXmlHandler::CanHandle(wxXmlNode *node)
58 {
59 return IsOfClass(node, _T("wxScrollBar"));
60 }
61
62
63