def OnMouseLeftUp(self, event):
"""
Handles the ``wx.EVT_LEFT_UP`` event for :class:`ImageContainerBase`.
:param `event`: a :class:`MouseEvent` event to be processed.
"""
style = self.GetParent().GetAGWWindowStyleFlag()
if style & INB_USE_PIN_BUTTON:
bIsLabelContainer = not self.CanDoBottomStyle()
if self._pinBtnRect.Contains(event.GetPosition()):
self._nPinButtonStatus = INB_PIN_NONE
self._bCollapsed = not self._bCollapsed
if self._bCollapsed:
# Save the current tab area width
self._tabAreaSize = self.GetSize()
if bIsLabelContainer:
self.SetSizeHints(20, self._tabAreaSize.y)
else:
if style & INB_BOTTOM or style & INB_TOP:
self.SetSizeHints(self._tabAreaSize.x, 20)
else:
self.SetSizeHints(20, self._tabAreaSize.y)
else:
if bIsLabelContainer:
self.SetSizeHints(self._tabAreaSize.x, -1)
else:
# Restore the tab area size
if style & INB_BOTTOM or style & INB_TOP:
self.SetSizeHints(-1, self._tabAreaSize.y)
else:
self.SetSizeHints(self._tabAreaSize.x, -1)
self.GetParent().GetSizer().Layout()
self.Refresh()
return
评论列表
文章目录