]>
git.saurik.com Git - wxWidgets.git/blob - src/xrc/xh_text.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/xrc/xh_text.cpp
3 // Purpose: XRC resource for wxTextCtrl
4 // Author: Aleksandras Gluchovas
7 // Copyright: (c) 2000 Aleksandras Gluchovas
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
18 #if wxUSE_XRC && wxUSE_TEXTCTRL
20 #include "wx/xrc/xh_text.h"
23 #include "wx/textctrl.h"
26 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler
, wxXmlResourceHandler
)
28 wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler()
30 XRC_ADD_STYLE(wxTE_NO_VSCROLL
);
31 XRC_ADD_STYLE(wxTE_PROCESS_ENTER
);
32 XRC_ADD_STYLE(wxTE_PROCESS_TAB
);
33 XRC_ADD_STYLE(wxTE_MULTILINE
);
34 XRC_ADD_STYLE(wxTE_PASSWORD
);
35 XRC_ADD_STYLE(wxTE_READONLY
);
36 XRC_ADD_STYLE(wxHSCROLL
);
37 XRC_ADD_STYLE(wxTE_RICH
);
38 XRC_ADD_STYLE(wxTE_RICH2
);
39 XRC_ADD_STYLE(wxTE_AUTO_URL
);
40 XRC_ADD_STYLE(wxTE_NOHIDESEL
);
41 XRC_ADD_STYLE(wxTE_LEFT
);
42 XRC_ADD_STYLE(wxTE_CENTRE
);
43 XRC_ADD_STYLE(wxTE_RIGHT
);
44 XRC_ADD_STYLE(wxTE_DONTWRAP
);
45 #if WXWIN_COMPATIBILITY_2_6
46 XRC_ADD_STYLE(wxTE_LINEWRAP
);
47 #endif // WXWIN_COMPATIBILITY_2_6
48 XRC_ADD_STYLE(wxTE_CHARWRAP
);
49 XRC_ADD_STYLE(wxTE_WORDWRAP
);
51 // this style doesn't exist since wx 2.9.0 but we still support it (by
52 // ignoring it silently) in XRC files to avoid unimportant warnings when
53 // using XRC produced by old tools
54 AddStyle(wxT("wxTE_AUTO_SCROLL"), 0);
59 wxObject
*wxTextCtrlXmlHandler::DoCreateResource()
61 XRC_MAKE_INSTANCE(text
, wxTextCtrl
)
63 text
->Create(m_parentAsWindow
,
65 GetText(wxT("value")),
66 GetPosition(), GetSize(),
73 if (HasParam(wxT("maxlength")))
74 text
->SetMaxLength(GetLong(wxT("maxlength")));
79 bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
81 return IsOfClass(node
, wxT("wxTextCtrl"));
84 #endif // wxUSE_XRC && wxUSE_TEXTCTRL