]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_text.cpp
added XML resources library
[wxWidgets.git] / contrib / src / xml / xh_text.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_text.cpp
3 // Purpose: XML resource for wxTextCtrl
4 // Author: Aleksandras Gluchovas
5 // Created: 2000/03/21
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Aleksandras Gluchovas
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "xh_text.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_text.h"
23 #include "wx/textctrl.h"
24
25 wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler()
26 {
27 ADD_STYLE(wxTE_PROCESS_ENTER);
28 ADD_STYLE(wxTE_PROCESS_TAB);
29 ADD_STYLE(wxTE_MULTILINE);
30 ADD_STYLE(wxTE_PASSWORD);
31 ADD_STYLE(wxTE_READONLY);
32 ADD_STYLE(wxHSCROLL);
33 }
34
35 wxObject *wxTextCtrlXmlHandler::DoCreateResource()
36 {
37 wxTextCtrl *text = new wxTextCtrl(m_ParentAsWindow,
38 GetID(),
39 GetText(_T("value")),
40 GetPosition(), GetSize(),
41 GetStyle(),
42 wxDefaultValidator,
43 GetText(_T("name"))
44 );
45 SetupWindow(text);
46
47 return text;
48 }
49
50
51
52 bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
53 {
54 return node->GetName() == _T("textctrl");
55 }
56
57