Exemplo n.º 1
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyLVITEM(1, 2)
     item, subItem, state, stateMask, text, image, param, indent = \
         win32gui_struct.UnpackLVITEM(ti)
     self.failUnlessEqual(item, 1)
     self.failUnlessEqual(subItem, 2)
     self.failUnlessEqual(state, 0)
     self.failUnlessEqual(stateMask, 0)
     self.failUnlessEqual(text, '')
     self.failUnlessEqual(image, 0)
     self.failUnlessEqual(param, 0)
     self.failUnlessEqual(indent, 0)
Exemplo n.º 2
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyLVITEM(1, 2)
     item, subItem, state, stateMask, text, image, param, indent = \
         win32gui_struct.UnpackLVITEM(ti)
     assert item == 1
     assert subItem == 2
     assert state == 0
     assert stateMask == 0
     assert text == ''
     assert image == 0
     assert param == 0
     assert indent == 0
Exemplo n.º 3
0
def GetSelectedItems(hwndList):
    r=[]
    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
    sel=-1
    for i in range(0,sel_count):
        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, sel, commctrl.LVNI_SELECTED)
        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)
        size = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)
        sel_text = ''
        for n in extra:
            nombre = n.tostring()
            sel_text = nombre[0:size]
        for item in objects_with_match:
            if item[2] == sel_text:
                 r.append(item)
    return r
Exemplo n.º 4
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyLVITEM(1, 2)
     (
         item,
         subItem,
         state,
         stateMask,
         text,
         image,
         param,
         indent,
     ) = win32gui_struct.UnpackLVITEM(ti)
     self.assertEqual(item, 1)
     self.assertEqual(subItem, 2)
     self.assertEqual(state, 0)
     self.assertEqual(stateMask, 0)
     self.assertEqual(text, "")
     self.assertEqual(image, 0)
     self.assertEqual(param, 0)
     self.assertEqual(indent, 0)
Exemplo n.º 5
0
def DeleteSelectedObjects(btnProcessor,*args):
    #Check if server running or user logged in
    b = check()
    if not b:
        return

    #Delete selected items
    hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
    for i in range(0,sel_count):
        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, -1, commctrl.LVNI_SELECTED)
        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)
        r = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)
        sel_text = ''
        for n in extra:
            nombre = n.tostring()
            sel_text = nombre[0:r]
        s = win32gui.SendMessage(hwndList, commctrl.LVM_DELETEITEM, sel)
        try:
            NewConn.DeleteObject(sel_text)
        except Exception,e:
            msg = "Object '%s' not deleted\n\n"%sel_text + getMessage(e)
            win32ui.MessageBox(msg,"",flag_excl)