]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_text.cpp
Fail for assert(0,...).
[wxWidgets.git] / src / xrc / xh_text.cpp
CommitLineData
78d14f80 1/////////////////////////////////////////////////////////////////////////////
40ff126a 2// Name: src/xrc/xh_text.cpp
b5d6954b 3// Purpose: XRC resource for wxTextCtrl
78d14f80
VS
4// Author: Aleksandras Gluchovas
5// Created: 2000/03/21
6// RCS-ID: $Id$
7// Copyright: (c) 2000 Aleksandras Gluchovas
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
f80ea77b 10
78d14f80
VS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
621be1ec 18#if wxUSE_XRC
a1e4ec87 19
78d14f80
VS
20#include "wx/xrc/xh_text.h"
21#include "wx/textctrl.h"
22
854e189f
VS
23IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler, wxXmlResourceHandler)
24
f80ea77b 25wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler()
78d14f80 26{
a1c7668e
VS
27 XRC_ADD_STYLE(wxTE_NO_VSCROLL);
28 XRC_ADD_STYLE(wxTE_AUTO_SCROLL);
544fee32
VS
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);
df93d8ba
VS
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);
40ff126a 43#if WXWIN_COMPATIBILITY_2_6
df93d8ba 44 XRC_ADD_STYLE(wxTE_LINEWRAP);
40ff126a
WS
45#endif // WXWIN_COMPATIBILITY_2_6
46 XRC_ADD_STYLE(wxTE_CHARWRAP);
df93d8ba 47 XRC_ADD_STYLE(wxTE_WORDWRAP);
78d14f80
VS
48 AddWindowStyles();
49}
50
51wxObject *wxTextCtrlXmlHandler::DoCreateResource()
f80ea77b 52{
544fee32 53 XRC_MAKE_INSTANCE(text, wxTextCtrl)
f2588180 54
544fee32
VS
55 text->Create(m_parentAsWindow,
56 GetID(),
57 GetText(wxT("value")),
58 GetPosition(), GetSize(),
59 GetStyle(),
60 wxDefaultValidator,
61 GetName());
f2588180 62
78d14f80 63 SetupWindow(text);
f80ea77b 64
d09aa882
JS
65 if (HasParam(wxT("maxlength")))
66 text->SetMaxLength(GetLong(wxT("maxlength")));
67
78d14f80
VS
68 return text;
69}
70
78d14f80
VS
71bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
72{
73 return IsOfClass(node, wxT("wxTextCtrl"));
74}
a1e4ec87 75
621be1ec 76#endif // wxUSE_XRC