]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/xrc/xh_text.cpp
use a filename, not URL, when quering its modification time
[wxWidgets.git] / src / xrc / xh_text.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/xrc/xh_text.cpp
3// Purpose: XRC 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// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
18#if wxUSE_XRC
19
20#include "wx/xrc/xh_text.h"
21#include "wx/textctrl.h"
22
23IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler, wxXmlResourceHandler)
24
25wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler()
26{
27 XRC_ADD_STYLE(wxTE_NO_VSCROLL);
28 XRC_ADD_STYLE(wxTE_AUTO_SCROLL);
29 XRC_ADD_STYLE(wxTE_PROCESS_ENTER);
30 XRC_ADD_STYLE(wxTE_PROCESS_TAB);
31 XRC_ADD_STYLE(wxTE_MULTILINE);
32 XRC_ADD_STYLE(wxTE_PASSWORD);
33 XRC_ADD_STYLE(wxTE_READONLY);
34 XRC_ADD_STYLE(wxHSCROLL);
35 XRC_ADD_STYLE(wxTE_RICH);
36 XRC_ADD_STYLE(wxTE_RICH2);
37 XRC_ADD_STYLE(wxTE_AUTO_URL);
38 XRC_ADD_STYLE(wxTE_NOHIDESEL);
39 XRC_ADD_STYLE(wxTE_LEFT);
40 XRC_ADD_STYLE(wxTE_CENTRE);
41 XRC_ADD_STYLE(wxTE_RIGHT);
42 XRC_ADD_STYLE(wxTE_DONTWRAP);
43#if WXWIN_COMPATIBILITY_2_6
44 XRC_ADD_STYLE(wxTE_LINEWRAP);
45#endif // WXWIN_COMPATIBILITY_2_6
46 XRC_ADD_STYLE(wxTE_CHARWRAP);
47 XRC_ADD_STYLE(wxTE_WORDWRAP);
48 AddWindowStyles();
49}
50
51wxObject *wxTextCtrlXmlHandler::DoCreateResource()
52{
53 XRC_MAKE_INSTANCE(text, wxTextCtrl)
54
55 text->Create(m_parentAsWindow,
56 GetID(),
57 GetText(wxT("value")),
58 GetPosition(), GetSize(),
59 GetStyle(),
60 wxDefaultValidator,
61 GetName());
62
63 SetupWindow(text);
64
65 if (HasParam(wxT("maxlength")))
66 text->SetMaxLength(GetLong(wxT("maxlength")));
67
68 return text;
69}
70
71bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
72{
73 return IsOfClass(node, wxT("wxTextCtrl"));
74}
75
76#endif // wxUSE_XRC