def CreateWindow(self, parent):
list = self
style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | commctrl.LVS_EDITLABELS | commctrl.LVS_REPORT
self._obj_.CreateWindow(style, self.GetDefRect(), parent, win32ui.IDC_LIST1)
self.HookMessage(self.OnKeyDown, win32con.WM_KEYDOWN)
self.HookMessage(self.OnKeyDown, win32con.WM_SYSKEYDOWN)
list = self
title, width = self.columns[0]
itemDetails = (commctrl.LVCFMT_LEFT, width, title, 0)
list.InsertColumn(0, itemDetails)
col = 1
for title, width in self.columns[1:]:
col = col + 1
itemDetails = (commctrl.LVCFMT_LEFT, width, title, 0)
list.InsertColumn(col, itemDetails)
parent.HookNotify(self.OnListEndLabelEdit, LVN_ENDLABELEDIT)
parent.HookNotify(self.OnItemRightClick, commctrl.NM_RCLICK)
parent.HookNotify(self.OnItemDoubleClick, commctrl.NM_DBLCLK)
评论列表
文章目录