Debian Codegraph @

wxcrafter/xrc_handlers/myxh_dvtreectrl.cpp

raw
1 #include "myxh_dvtreectrl.h"
2 #include <wx/dataview.h>
3 #include <wx/imaglist.h>
4
5 MyWxDataViewTreeCtrlHandler::MyWxDataViewTreeCtrlHandler()
6 : wxXmlResourceHandler()
7 {
8 XRC_ADD_STYLE(wxDV_SINGLE);
9 XRC_ADD_STYLE(wxDV_MULTIPLE);
10 XRC_ADD_STYLE(wxDV_ROW_LINES);
11 XRC_ADD_STYLE(wxDV_HORIZ_RULES);
12 XRC_ADD_STYLE(wxDV_VERT_RULES);
13 XRC_ADD_STYLE(wxDV_VARIABLE_LINE_HEIGHT);
14 XRC_ADD_STYLE(wxDV_NO_HEADER);
15 AddWindowStyles();
16 }
17
18 wxObject* MyWxDataViewTreeCtrlHandler::DoCreateResource()
19 {
20 wxASSERT_MSG(m_class == "wxDataViewTreeCtrl", wxT("can't handle unknown node"));
21
22 return HandleListCtrl();
23 }
24
25 bool MyWxDataViewTreeCtrlHandler::CanHandle(wxXmlNode* node) { return IsOfClass(node, "wxDataViewTreeCtrl"); }
26
27 wxDataViewTreeCtrl* MyWxDataViewTreeCtrlHandler::HandleListCtrl()
28 {
29 XRC_MAKE_INSTANCE(list, wxDataViewTreeCtrl)
30
31 list->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle());
32 list->SetName(GetName());
33 CreateChildrenPrivately(list);
34 SetupWindow(list);
35 return list;
36 }