UltimateListCtrl

Hello,
how insert a check box in first column of UltimateListCtrl ?

This is my code:
        self.list.ClearAll()
        self.list.InsertColumn(0, _("Utente"))
        self.list.InsertColumn(1, _("Abilitato"))
        self.list.InsertColumn(2, _("Lettura"))
        self.list.InsertColumn(3, _("Modifica"))
        self.list.InsertColumn(4, _("Elimina"))

        self.bitmap = cBitmap("item_red_16.png")
        if self.idselezionato != None:
            s = cSqlSelect(self.conn)
            q = "SELECT ute_cod, ute_des, umnu_flag, umnu_read,
umnu_write, umnu_delete
FROM utemnu LEFT JOIN utente ON umnu_utente=ute_cod WHERE umnu_menu=
%s"
            if not s.execute(q, [self.idselezionato]):
                self.error = s.error
                s.close()
            row = s.fetchall()
            utenti = {}
            mutenti = []
            i = 0
            for rs in row:
                u = []
                u.append(rs[0])
                u.append(rs[1])
                u.append(rs[2])
                u.append(rs[3])
                u.append(rs[4])
                u.append(rs[5])
                utenti[rs[0]] = u
                mutenti.append(rs[0])
                i = i + 1
            q = "SELECT ute_cod, ute_des FROM utente"
            if not s.execute(q):
                self.error = s.error
            row = s.fetchall()
            i = 0
            for rs in row:
                if rs[0] not in mutenti:
                    u = []
                    u.append(rs[0])
                    u.append(rs[1])
                    u.append(True)
                    u.append(True)
                    u.append(True)
                    u.append(True)
                    utenti[rs[0]]= u
                    i = i + 1
            s.close()
            items = utenti.items()
            index = 0
            self.il = wx.ImageList(16,16)
            bitmap = cBitmap("item_green_16.png")
            self.idx1 = self.il.Add(bitmap)
            self.il.Add(images.core.GetBitmap())
            self.il.Add(images.custom.GetBitmap())
            bitmap = cBitmap("item_red_16.png")
            self.idx2 = self.il.Add(bitmap)
            self.il.Add(images.expansion.GetBitmap())
            cont = 0
            self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
            for key, data in items:
                if cont < 40:
                    index =
self.list.InsertImageStringItem(sys.maxint, str(data[1]),[],
it_kind=1)
                    if data[2] != True:
                        self.list.SetStringItem(index, 1, "",
[self.idx2])
                    else:
                        self.list.SetStringItem(index, 1, "",
[self.idx1])
                    if data[3] != True:
                        self.list.SetStringItem(index, 2, "",
[self.idx2])
                    else:
                        self.list.SetStringItem(index, 2, "",
[self.idx1])
                    if data[4] != True:
                        self.list.SetStringItem(index, 3, "",
[self.idx2])
                    else:
                        self.list.SetStringItem(index, 3, "",
[self.idx1])
                    if data[5] != True:
                        self.list.SetStringItem(index, 4, "",
[self.idx2])
                    else:
                        self.list.SetStringItem(index, 4, "",
[self.idx1])
                    self.list.SetItemData(index, key)
                    index += 1
                    self.itemDataMap = utenti
                    cont = cont + 1

Passing it_kind=1 when each item is inserted should do it. Is that not working? If not then please make a minimal sample and also let us know the platform and version. MakingSampleApps - wxPyWiki

···

On 2/8/12 5:58 AM, rose9392@hotmail.it wrote:

Hello,
how insert a check box in first column of UltimateListCtrl ?

--
Robin Dunn
Software Craftsman