def HitTest(self, pt):
"""
Returns the index of the tab at the specified position or ``wx.NOT_FOUND``
if ``None``, plus the flag style of :meth:`~ImageContainerBase.HitTest`.
:param `pt`: an instance of :class:`Point`, to test for hits.
:return: The index of the tab at the specified position plus the hit test
flag, which can be one of the following bits:
====================== ======= ================================
HitTest Flags Value Description
====================== ======= ================================
``IMG_OVER_IMG`` 0 The mouse is over the tab icon
``IMG_OVER_PIN`` 1 The mouse is over the pin button
``IMG_OVER_EW_BORDER`` 2 The mouse is over the east-west book border
``IMG_NONE`` 3 Nowhere
====================== ======= ================================
"""
style = self.GetParent().GetAGWWindowStyleFlag()
for i in reversed( xrange(len(self._pagesInfoVec)) ) :
if self._pagesInfoVec[i].GetPosition() == wx.Point(-1, -1):
break
# For Web Hover style, we test the TextRect
if not self.HasAGWFlag(INB_WEB_HILITE):
buttonRect = wx.RectPS(self._pagesInfoVec[i].GetPosition(), self._pagesInfoVec[i].GetSize())
else:
buttonRect = self._pagesInfoVec[i].GetTextRect()
if buttonRect.Contains(pt):
return i, IMG_OVER_IMG
return -1, IMG_NONE
评论列表
文章目录