]>
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
20 #include "wx/xrc/xh_richtext.h"
21 #include "wx/richtext/richtextctrl.h"
23 IMPLEMENT_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler
, wxXmlResourceHandler
)
25 wxRichTextCtrlXmlHandler::wxRichTextCtrlXmlHandler() : wxXmlResourceHandler()
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
);
36 wxObject
*wxRichTextCtrlXmlHandler::DoCreateResource()
38 XRC_MAKE_INSTANCE(text
, wxRichTextCtrl
)
40 text
->Create(m_parentAsWindow
,
42 GetText(wxT("value")),
43 GetPosition(), GetSize(),
50 if (HasParam(wxT("maxlength")))
51 text
->SetMaxLength(GetLong(wxT("maxlength")));
56 bool wxRichTextCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
58 return IsOfClass(node
, wxT("wxRichTextCtrl"));
61 #endif // wxUSE_XRC && wxUSE_RICHTEXT