Menu

#1 HitTest additions for TreeCtrl

open
nobody
None
5
2005-02-03
2005-02-03
No

It might be useful to include the following HitTest
constants to comctl.py :-

TVM_HITTEST = (TV_FIRST + 17)

TVHT_NOWHERE = 0x001
TVHT_ONITEMICON = 0x002
TVHT_ONITEMLABEL = 0x004
TVHT_ONITEMINDENT = 0x008
TVHT_ONITEMBUTTON = 0x010
TVHT_ONITEMRIGHT = 0x020
TVHT_ONITEMSTATEICON = 0x040
TVHT_ONITEM =
(TVHT_ONITEMSTATEICON | TVHT_ONITEMLABEL |
TVHT_ONITEMICON)
TVHT_ABOVE = 0x100
TVHT_BELOW = 0x200
TVHT_TOLEFT = 0x800
TVHT_TORIGHT = 0x400

class TVHITTESTINFO(Structure):
_fields_ = [("pt", POINT),
("flags", UINT),
("hItem", comctl.HTREEITEM)]

and the following to the Tree class, for hit testing and
for setting/updating item details :-

def HitTest(self, info):
self.SendMessage(comctl.TVM_HITTEST, 0, byref(info))

def SetItem(self, item):
self.SendMessage(comctl.TVM_SETITEM, 0, byref(item))

Thanks guys!

Discussion


Log in to post a comment.

MongoDB Logo MongoDB