]>
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_AUTO_SCROLL
);
32 XRC_ADD_STYLE(wxTE_PROCESS_ENTER
);
33 XRC_ADD_STYLE(wxTE_PROCESS_TAB
);
34 XRC_ADD_STYLE(wxTE_MULTILINE
);
35 XRC_ADD_STYLE(wxTE_PASSWORD
);
36 XRC_ADD_STYLE(wxTE_READONLY
);
37 XRC_ADD_STYLE(wxHSCROLL
);
38 XRC_ADD_STYLE(wxTE_RICH
);
39 XRC_ADD_STYLE(wxTE_RICH2
);
40 XRC_ADD_STYLE(wxTE_AUTO_URL
);
41 XRC_ADD_STYLE(wxTE_NOHIDESEL
);
42 XRC_ADD_STYLE(wxTE_LEFT
);
43 XRC_ADD_STYLE(wxTE_CENTRE
);
44 XRC_ADD_STYLE(wxTE_RIGHT
);
45 XRC_ADD_STYLE(wxTE_DONTWRAP
);
46 #if WXWIN_COMPATIBILITY_2_6
47 XRC_ADD_STYLE(wxTE_LINEWRAP
);
48 #endif // WXWIN_COMPATIBILITY_2_6
49 XRC_ADD_STYLE(wxTE_CHARWRAP
);
50 XRC_ADD_STYLE(wxTE_WORDWRAP
);
54 wxObject
*wxTextCtrlXmlHandler::DoCreateResource()
56 XRC_MAKE_INSTANCE(text
, wxTextCtrl
)
58 text
->Create(m_parentAsWindow
,
60 GetText(wxT("value")),
61 GetPosition(), GetSize(),
68 if (HasParam(wxT("maxlength")))
69 text
->SetMaxLength(GetLong(wxT("maxlength")));
74 bool wxTextCtrlXmlHandler::CanHandle(wxXmlNode
*node
)
76 return IsOfClass(node
, wxT("wxTextCtrl"));
79 #endif // wxUSE_XRC && wxUSE_TEXTCTRL