2 |
|
|
3 |
# $Id$ |
# $Id$ |
4 |
# $Log$ |
# $Log$ |
5 |
|
# Revision 1.10 2004/09/21 18:11:05 xabbu |
6 |
|
# + started work on the final tree Controll to display contenttypes and their items |
7 |
|
# |
8 |
# Revision 1.9 2004/09/17 20:51:24 xabbu |
# Revision 1.9 2004/09/17 20:51:24 xabbu |
9 |
# + function initTreeList() will init a TreeList |
# + function initTreeList() will init a TreeList |
10 |
# + function loadContent(contentkey) moved from FraggleListFrame |
# + function loadContent(contentkey) moved from FraggleListFrame |
77 |
name='treeCtrl1', parent=self, pos=wxPoint(176, 0), |
name='treeCtrl1', parent=self, pos=wxPoint(176, 0), |
78 |
size=wxSize(160, 168), style=wxTR_HAS_BUTTONS) |
size=wxSize(160, 168), style=wxTR_HAS_BUTTONS) |
79 |
self.treeCtrl1.Enable(True) |
self.treeCtrl1.Enable(True) |
80 |
|
EVT_LEFT_DCLICK(self.treeCtrl1, self.OnTreeCtrl1LeftDclick) |
81 |
|
|
82 |
def __init__(self, parent): |
def __init__(self, parent): |
83 |
self.parent = parent |
self.parent = parent |
123 |
itemid = 0 |
itemid = 0 |
124 |
columnlist = self.columns |
columnlist = self.columns |
125 |
for entry in entries: |
for entry in entries: |
126 |
|
data = entries[entry] |
127 |
|
itemData = wxTreeItemData() |
128 |
|
itemData.SetData(data) |
129 |
#print columnlist |
#print columnlist |
130 |
#columnlist.pop() |
#columnlist.pop() |
131 |
if entries[entry]['1'] == '1': |
if entries[entry]['1'] == '1': |
132 |
self.treeCtrl1.AppendItem(self.treeItems[contentkey],str(entries[entry]['2']+' - English')) |
self.treeCtrl1.AppendItem(self.treeItems[contentkey], |
133 |
|
str(entries[entry]['2']+' - English'), |
134 |
|
-1, |
135 |
|
-1, |
136 |
|
itemData) |
137 |
elif entries[entry]['1'] == '2': |
elif entries[entry]['1'] == '2': |
138 |
self.treeCtrl1.AppendItem(self.treeItems[contentkey],str(entries[entry]['2']+' - Deutsch')) |
self.treeCtrl1.AppendItem(self.treeItems[contentkey], |
139 |
|
str(entries[entry]['2']+' - Deutsch'), |
140 |
|
-1, |
141 |
|
-1, |
142 |
|
itemData) |
143 |
#print self.treeItems |
#print self.treeItems |
144 |
itemid += 1 |
itemid += 1 |
145 |
|
|
174 |
self.parent.Fit() |
self.parent.Fit() |
175 |
|
|
176 |
frame.load_content(topics[str(seldata)]) |
frame.load_content(topics[str(seldata)]) |
177 |
|
|
178 |
|
def OnTreeCtrl1LeftDclick(self, event): |
179 |
|
sel = self.treeCtrl1.GetSelection() |
180 |
|
selitem = self.treeCtrl1.GetItemData(sel) |
181 |
|
seldata = selitem.GetData() |
182 |
|
selparent = self.treeCtrl1.GetItemParent(sel) |
183 |
|
seltype = self.treeCtrl1.GetItemText(selparent) |
184 |
|
self.engine.modules.Dispatch(seldata,seltype) |
185 |
|
event.Skip() |
186 |
|
|
187 |
|
|