]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_richtext.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_richtext.cpp
3 // Purpose: XRC resource for wxRichTextCtrl
4 // Author: Julian Smart
7 // Copyright: (c) 2006 Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_RICHTEXT && wxUSE_RICHTEXT_XML_HANDLER
20 #include "wx/xrc/xh_richtext.h"
22 #include "wx/richtext/richtextctrl.h"
24 IMPLEMENT_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler
, wxXmlResourceHandler
)
26 wxRichTextCtrlXmlHandler::wxRichTextCtrlXmlHandler() : wxXmlResourceHandler()
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
);
37 wxObject
*wxRichTextCtrlXmlHandler::DoCreateResource()
39 XRC_MAKE_INSTANCE(text
, wxRichTextCtrl
)
41 text
->Create(m_parentAsWindow
,
43 GetText(wxT("value")),
44 GetPosition(), GetSize(),
51 if (HasParam(wxT("maxlength")))
52 text
->SetMaxLength(GetLong(wxT("maxlength")));
57 bool wxRichTextCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
59 return IsOfClass(node
, wxT("wxRichTextCtrl"));
62 #endif // wxUSE_XRC && wxUSE_RICHTEXT