]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_listc.cpp
1696ea425a27bf565114dbfc2709e357b2e40abf
[wxWidgets.git] / contrib / src / xml / xh_listc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xh_listc.cpp
3 // Purpose: XML resource for wxListCtrl
4 // Author: Brian Gavin
5 // Created: 2000/09/09
6 // RCS-ID: $Id$
7 // Copyright: (c) 2000 Brian Gavin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifdef __GNUG__
12 #pragma implementation "xh_listc.h"
13 #endif
14
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 #include "wx/textctrl.h"
23 #include "wx/xml/xh_listc.h"
24 #include "wx/listctrl.h"
25
26
27 wxListCtrlXmlHandler::wxListCtrlXmlHandler()
28 : wxXmlResourceHandler()
29 {
30 ADD_STYLE(wxLC_LIST);
31 ADD_STYLE(wxLC_REPORT);
32 ADD_STYLE(wxLC_REPORT);
33 ADD_STYLE(wxLC_ICON);
34 ADD_STYLE(wxLC_SMALL_ICON);
35 ADD_STYLE(wxLC_ALIGN_TOP);
36 ADD_STYLE(wxLC_ALIGN_LEFT);
37 ADD_STYLE(wxLC_AUTOARRANGE);
38 ADD_STYLE(wxLC_USER_TEXT);
39 ADD_STYLE(wxLC_EDIT_LABELS);
40 ADD_STYLE(wxLC_NO_HEADER);
41 ADD_STYLE(wxLC_SINGLE_SEL);
42 ADD_STYLE(wxLC_SORT_ASCENDING);
43 ADD_STYLE(wxLC_SORT_DESCENDING);
44 AddWindowStyles();
45 }
46
47
48 wxObject *wxListCtrlXmlHandler::DoCreateResource()
49 {
50 wxListCtrl *list = new wxListCtrl(m_ParentAsWindow,
51 GetID(),
52 GetPosition(), GetSize(),
53 GetStyle(),
54 wxDefaultValidator,
55 GetName());
56 /* TODO: columns definition */
57
58 SetupWindow(list);
59
60 return list;
61 }
62
63
64
65 bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node)
66 {
67 return IsOfClass(node, wxT("wxListCtrl"));
68 }