46 |
def OnButtoncloseButton(self, event): |
def OnButtoncloseButton(self, event): |
47 |
self.Destroy() |
self.Destroy() |
48 |
event.Skip() |
event.Skip() |
49 |
|
|
50 |
def load_content(self): |
def load_content(self): |
51 |
self.topicid = int(self.GetName()) |
self.payload = self.engine.listItems('xmlpage') |
52 |
self.topicmeta = self.engine.getTopicById(self.topicid) |
if self.payload: |
53 |
self.payload = self.engine.query_remote(self.topicmeta) |
print "Done!" |
54 |
|
#def load_content(self): |
55 |
|
# self.topicid = int(self.GetName()) |
56 |
|
# self.topicmeta = self.engine.getTopicById(self.topicid) |
57 |
|
# self.payload = self.engine.query_remote(self.topicmeta) |
58 |
|
|
59 |
if self.payload: |
# if self.payload: |
60 |
|
|
61 |
# 1. generate columns |
# 1. generate columns |
62 |
row0 = self.payload[0] |
# row0 = self.payload[0] |
63 |
colid = 0 |
# colid = 0 |
64 |
for column in row0.keys(): |
# for column in row0.keys(): |
65 |
self.listViewMain.InsertColumn( |
# self.listViewMain.InsertColumn( |
66 |
col=colid, |
# col=colid, |
67 |
format=wxLIST_FORMAT_LEFT, |
# format=wxLIST_FORMAT_LEFT, |
68 |
heading=column, |
# heading=column, |
69 |
width=-1 |
# width=-1 |
70 |
) |
# ) |
71 |
colid += 1 |
# colid += 1 |
72 |
|
|
73 |
# 2. fill entries |
# 2. fill entries |
74 |
itemid = 0 |
#itemid = 0 |
75 |
for entry in self.payload: |
#for entry in self.payload: |
76 |
self.listViewMain.InsertStringItem(itemid, entry.keys()[0]) |
# self.listViewMain.InsertStringItem(itemid, entry.keys()[0]) |
77 |
colid = 0 |
# colid = 0 |
78 |
columnlist = entry.keys() |
# columnlist = entry.keys() |
79 |
columnlist.pop() |
# columnlist.pop() |
80 |
for column in columnlist: |
# for column in columnlist: |
81 |
self.listViewMain.SetStringItem(itemid, colid, entry[column]) |
# self.listViewMain.SetStringItem(itemid, colid, entry[column]) |
82 |
colid += 1 |
# colid += 1 |
83 |
|
|
84 |
# set custom data |
# set custom data |
85 |
self.listViewMain.SetItemData(itemid, itemid) |
#self.listViewMain.SetItemData(itemid, itemid) |
86 |
|
|
87 |
itemid += 1 |
#itemid += 1 |
88 |
|
|
89 |
def OnListViewMainLeftDclick(self, event): |
def OnListViewMainLeftDclick(self, event): |
90 |
#event.Skip() |
#event.Skip() |