def __init__(self, itemlist):
height = len(itemlist)*17
self.Text = "Select the categories to export"
self.Size = Size(300, height + 80)
self.check = CheckedListBox()
self.check.Parent = self
self.check.Location = Point(5, 5)
self.check.Size = Size(270, height)
# load the list of relevant categories found in the project
list_items = List[Object](itemlist)
self.check.Items.AddRange(list_items.ToArray())
self.check.CheckOnClick = True
# set checked by default
for i in range(len(itemlist)):
self.check.SetItemChecked(i , True)
okay = Button()
okay.Parent = self
okay.Text = 'OK'
okay.Location = Point(50, height+10)
okay.Width = 140
okay.Click += self.onValidate
cancel = Button()
cancel.Parent = self
cancel.Text = 'Cancel'
cancel.Location = Point(okay.Right, height+10)
cancel.Click += self.onCancel
self.CenterToScreen()
评论列表
文章目录