]> git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_richtext.cpp
Disable dropdown menu support in wxRibbonXmlHandler.
[wxWidgets.git] / src / xrc / xh_richtext.cpp
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
18 #if wxUSE_XRC && wxUSE_RICHTEXT
19
20 #include "wx/xrc/xh_richtext.h"
21 #include "wx/richtext/richtextctrl.h"
22
23 IMPLEMENT_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler, wxXmlResourceHandler)
24
25 wxRichTextCtrlXmlHandler::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
36 wxObject *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
56 bool wxRichTextCtrlXmlHandler::CanHandle(wxXmlNode *node)
57 {
58 return IsOfClass(node, wxT("wxRichTextCtrl"));
59 }
60
61 #endif // wxUSE_XRC && wxUSE_RICHTEXT
62