]>
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
6 // Copyright: (c) 2000 Aleksandras Gluchovas
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 #if wxUSE_XRC && wxUSE_TEXTCTRL
19 #include "wx/xrc/xh_text.h"
22 #include "wx/textctrl.h"
25 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrlXmlHandler
, wxXmlResourceHandler
)
27 wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler()
29 XRC_ADD_STYLE(wxTE_NO_VSCROLL
);
30 XRC_ADD_STYLE(wxTE_PROCESS_ENTER
);
31 XRC_ADD_STYLE(wxTE_PROCESS_TAB
);
32 XRC_ADD_STYLE(wxTE_MULTILINE
);
33 XRC_ADD_STYLE(wxTE_PASSWORD
);
34 XRC_ADD_STYLE(wxTE_READONLY
);
35 XRC_ADD_STYLE(wxHSCROLL
);
36 XRC_ADD_STYLE(wxTE_RICH
);
37 XRC_ADD_STYLE(wxTE_RICH2
);
38 XRC_ADD_STYLE(wxTE_AUTO_URL
);
39 XRC_ADD_STYLE(wxTE_NOHIDESEL
);
40 XRC_ADD_STYLE(wxTE_LEFT
);
41 XRC_ADD_STYLE(wxTE_CENTRE
);
42 XRC_ADD_STYLE(wxTE_RIGHT
);
43 XRC_ADD_STYLE(wxTE_DONTWRAP
);
44 #if WXWIN_COMPATIBILITY_2_6
45 XRC_ADD_STYLE(wxTE_LINEWRAP
);
46 #endif // WXWIN_COMPATIBILITY_2_6
47 XRC_ADD_STYLE(wxTE_CHARWRAP
);
48 XRC_ADD_STYLE(wxTE_WORDWRAP
);
50 // this style doesn't exist since wx 2.9.0 but we still support it (by
51 // ignoring it silently) in XRC files to avoid unimportant warnings when
52 // using XRC produced by old tools
53 AddStyle(wxT("wxTE_AUTO_SCROLL"), 0);
58 wxObject
*wxTextCtrlXmlHandler::DoCreateResource()
60 XRC_MAKE_INSTANCE(text
, wxTextCtrl
)
62 text
->Create(m_parentAsWindow
,
64 GetText(wxT("value")),
65 GetPosition(), GetSize(),
72 if (HasParam(wxT("maxlength")))
73 text
->SetMaxLength(GetLong(wxT("maxlength")));
78 bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
80 return IsOfClass(node
, wxT("wxTextCtrl"));
83 #endif // wxUSE_XRC && wxUSE_TEXTCTRL