]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_richtext.cpp
use fallback encoding in wxConvAuto when input is not in UTF-8
[wxWidgets.git] / src / xrc / xh_richtext.cpp
CommitLineData
fd4344d6
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/xrc/xh_richtext.cpp
3// Purpose: XRC resource for wxRichTextCtrl
4// Author: Julian Smart
5// Created: 2006-11-08
6// RCS-ID: $Id$
7// Copyright: (c) 2006 Julian Smart
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
75a3537a 18#if wxUSE_XRC && wxUSE_RICHTEXT && wxUSE_RICHTEXT_XML_HANDLER
fd4344d6
JS
19
20#include "wx/xrc/xh_richtext.h"
21
22#include "wx/richtext/richtextctrl.h"
23
24IMPLEMENT_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler, wxXmlResourceHandler)
25
26wxRichTextCtrlXmlHandler::wxRichTextCtrlXmlHandler() : wxXmlResourceHandler()
27{
28 XRC_ADD_STYLE(wxTE_PROCESS_ENTER);
29 XRC_ADD_STYLE(wxTE_PROCESS_TAB);
30 XRC_ADD_STYLE(wxTE_MULTILINE);
31 XRC_ADD_STYLE(wxTE_READONLY);
32 XRC_ADD_STYLE(wxTE_AUTO_URL);
33
34 AddWindowStyles();
35}
36
37wxObject *wxRichTextCtrlXmlHandler::DoCreateResource()
38{
39 XRC_MAKE_INSTANCE(text, wxRichTextCtrl)
40
41 text->Create(m_parentAsWindow,
42 GetID(),
43 GetText(wxT("value")),
44 GetPosition(), GetSize(),
45 GetStyle(),
46 wxDefaultValidator,
47 GetName());
48
49 SetupWindow(text);
50
51 if (HasParam(wxT("maxlength")))
52 text->SetMaxLength(GetLong(wxT("maxlength")));
53
54 return text;
55}
56
57bool wxRichTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
58{
59 return IsOfClass(node, wxT("wxRichTextCtrl"));
60}
61
62#endif // wxUSE_XRC && wxUSE_RICHTEXT
63