]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_richtext.cpp
Don't follow symlinks in wxFileName::Rmdir(wxPATH_RMDIR_RECURSIVE).
[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
a3b9c43b 18#if wxUSE_XRC && wxUSE_RICHTEXT
fd4344d6
JS
19
20#include "wx/xrc/xh_richtext.h"
fd4344d6
JS
21#include "wx/richtext/richtextctrl.h"
22
23IMPLEMENT_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler, wxXmlResourceHandler)
24
25wxRichTextCtrlXmlHandler::wxRichTextCtrlXmlHandler() : wxXmlResourceHandler()
26{
27 XRC_ADD_STYLE(wxTE_PROCESS_ENTER);
28 XRC_ADD_STYLE(wxTE_PROCESS_TAB);
29 XRC_ADD_STYLE(wxTE_MULTILINE);
30 XRC_ADD_STYLE(wxTE_READONLY);
31 XRC_ADD_STYLE(wxTE_AUTO_URL);
32
33 AddWindowStyles();
34}
35
36wxObject *wxRichTextCtrlXmlHandler::DoCreateResource()
37{
38 XRC_MAKE_INSTANCE(text, wxRichTextCtrl)
39
40 text->Create(m_parentAsWindow,
41 GetID(),
42 GetText(wxT("value")),
43 GetPosition(), GetSize(),
44 GetStyle(),
45 wxDefaultValidator,
46 GetName());
47
48 SetupWindow(text);
49
50 if (HasParam(wxT("maxlength")))
51 text->SetMaxLength(GetLong(wxT("maxlength")));
52
53 return text;
54}
55
56bool wxRichTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
57{
58 return IsOfClass(node, wxT("wxRichTextCtrl"));
59}
60
61#endif // wxUSE_XRC && wxUSE_RICHTEXT
62