AGW Logo

svn SVN Revision 70742 For auibook

This file contains the SVN revision history for auibook, at revision 70742.

Available information include commit date, the name of the committer, the file size, the SVN log messages and a diff from the previous version (if available).


file_info File Information

  • Commit Date: 02-Apr-2009 14:32:39 UTC
  • Committer: AG
  • File Size: 196041 byte(s)

svn_log Log Messages

The following log message was entered by the committer:

AuiNotebook: apply patches from Luke McCarthy to fix the following:

  • Button widths not calculated correctly if some buttons are hidden;
  • Notebook control buttons (e.g. close button) can’t be clicked quickly;
  • Tab can’t be selected after dragging (_curpage not updated).

svn_diff Diff To Previous Version (69627)

Version SVN diff:

--- wxPython/3rdParty/AGW/agw/aui/auibook.py        2011/11/01 19:42:21     69627
+++ wxPython/3rdParty/AGW/agw/aui/auibook.py        2012/02/28 22:11:31     70742
@@ -556,7 +556,7 @@

def __init__(self):
""" Default class constructor. """
-
+
super(TabNavigatorProps, self).__init__()

# Attributes
@@ -609,9 +609,9 @@

sz = wx.BoxSizer(wx.VERTICAL)

-        self._listBox = wx.ListBox(self, wx.ID_ANY,
-                                   wx.DefaultPosition,
-                                   wx.Size(200, 150), [],
+        self._listBox = wx.ListBox(self, wx.ID_ANY,
+                                   wx.DefaultPosition,
+                                   wx.Size(200, 150), [],
wx.LB_SINGLE | wx.NO_BORDER)

mem_dc = wx.MemoryDC()
@@ -627,7 +627,7 @@
if panelHeight < 24:
panelHeight = 24

-        self._panel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition,
+        self._panel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition,
wx.Size(-1, panelHeight))

sz.Add(self._panel, 0, wx.EXPAND)
@@ -1391,7 +1391,15 @@
else:
visible_width += size[0]

-        if total_width > self._rect.GetWidth() or self._tab_offset != 0:
+        buttons_width = 0
+
+        for button in self._buttons:
+            if not (button.cur_state & AUI_BUTTON_STATE_HIDDEN):
+                buttons_width += button.rect.GetWidth()
+
+        total_width += buttons_width
+
+        if (total_width > self._rect.GetWidth() and page_count > 1) or self._tab_offset != 0:

# show left/right buttons
for button in self._buttons:
@@ -1418,7 +1426,7 @@
button.cur_state &= ~AUI_BUTTON_STATE_DISABLED

if button.id == AUI_BUTTON_RIGHT:
-                if visible_width < self._rect.GetWidth() - 16*button_count:
+                if visible_width < self._rect.GetWidth() - buttons_width:
button.cur_state |= AUI_BUTTON_STATE_DISABLED
else:
button.cur_state &= ~AUI_BUTTON_STATE_DISABLED
@@ -1495,6 +1503,20 @@

self.MinimizeTabOffset(dc, wnd, self._rect.GetWidth() - right_buttons_width - offset - 2)

+        # draw tab before tab offset
+        if self._tab_offset > 0:
+            page = self._pages[self._tab_offset - 1]
+            tab_button = self._tab_close_buttons[self._tab_offset - 1]
+            size, x_extent = self._art.GetTabSize(dc, wnd, page.caption, page.bitmap, page.active, tab_button.cur_state, page.control)
+
+            rect = wx.Rect(offset - x_extent, 0, self._rect.width - right_buttons_width - offset - x_extent - 2, self._rect.height)
+            clip_rect = wx.Rect(*self._rect)
+            clip_rect.x = offset
+
+            dc.SetClippingRect(clip_rect)
+            self._art.DrawTab(dc, wnd, page, rect, tab_button.cur_state)
+            dc.DestroyClippingRegion()
+
# draw the tabs
active = 999
active_offset = 0
@@ -1883,7 +1905,9 @@
:param `event`: a `wx.MouseEvent` event to be processed.
"""

-        self.CaptureMouse()
+        if not self.HasCapture():
+            self.CaptureMouse()
+
self._click_pt = wx.Point(-1, -1)
self._is_dragging = False
self._click_tab = None
@@ -1908,15 +1932,19 @@
self._click_pt.x = event.GetX()
self._click_pt.y = event.GetY()
self._click_tab = wnd
+
+            wnd.SetFocus()
else:
page_index = self.GetActivePage()
if page_index != wx.NOT_FOUND:
self.GetWindowFromIdx(page_index).SetFocus()

+            self._hover_button = self.ButtonHitTest(event.GetX(), event.GetY())
if self._hover_button:
self._pressed_button = self._hover_button
self._pressed_button.cur_state = AUI_BUTTON_STATE_PRESSED
self._on_button = True
+
self.Refresh()
self.Update()

@@ -1980,6 +2008,7 @@

if self._hover_button:
self._pressed_button = self._hover_button
+            self._hover_button.cur_state = AUI_BUTTON_STATE_NORMAL

if self._pressed_button:

@@ -4485,6 +4514,8 @@
:param `event`: a L{AuiNotebookEvent} event to be processed.
"""

+        self._curpage = event.GetSelection()
+
tabs = event.GetEventObject()
if not tabs.GetEnabled(event.GetSelection()):
return
Tree

Table Of Contents

Previous topic

SVN Revision 69627 For auibook

Next topic

SVN Revision 70836 For auibook