def refresh_arrange_panel(self): gl = self.lstarrgroups fl = self.lstarrfields gl.Clear() nop(gl.Append(i.name) for i in dt.groups) fl.Clear() nop(fl.Append(i.name) for i in dt.fields)
def refresh_group_listview(self): lv = self.grouplistview lv.ClearAll() lv.SetImageList(self.imglist, wx.IMAGE_LIST_SMALL) nop(lv.InsertColumn(*i) for i in zip(xrange(3), [u"小组名称", u"小组成员", u"备注"])) for i, v in enumerate(dt.groups): n = lv.Append([v.name, ', '.join(m.name for m in v.get_members()), v.comment]) lv.SetItemData(n, i) lv.SetItemImage(n, 1) lv.SetColumnWidth(0, 80) nop(lv.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER) for i in xrange(1,3))
def refresh_field_listview(self): lv = self.fieldlistview lv.ClearAll() lv.SetImageList(self.imglist, wx.IMAGE_LIST_SMALL) nop(lv.InsertColumn(*i) for i in zip(xrange(3), [u"场地名称", u"可用时间", u"备注"])) for i, v in enumerate(dt.fields): n = lv.Append([v.name, v.timeavail.tostring(), v.comment]) lv.SetItemData(n, i) lv.SetItemImage(n, 2) lv.SetColumnWidth(0, 120) nop(lv.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER) for i in xrange(1,3))
def refresh_person_listview(self): lv = self.personlistview lv.ClearAll() lv.SetImageList(self.imglist, wx.IMAGE_LIST_SMALL) nop(lv.InsertColumn(*i) for i in zip(xrange(4), [u"姓名", u"所在小组", u"可用时间", u"备注"])) for i, v in enumerate(dt.persons): n = lv.Append([v.name, u"[未分组]" if v.group is None else v.group.name, v.timeavail.tostring(), v.comment]) lv.SetItemData(n, i) lv.SetItemImage(n, 0) lv.SetColumnWidth(0, 80) nop(lv.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER) for i in xrange(1,4))