AGW Logo

svn SVN Revision 68742 For auibook

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

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: 09-Apr-2009 16:25:54 UTC
  • Committer: AG
  • File Size: 193376 byte(s)

svn_log Log Messages

The following log message was entered by the committer:

  • FlatNotebook: fix issues with custom page and vertical/horizontal tiling of pages;
  • AuiBook: every time the AuiBook is split, copy over the custom buttons in the tab area of the newly created AuiBook;
  • Others: minor modifications to the docstrings.

svn_diff Diff To Previous Version (68342)

Version SVN diff:

--- wxPython/3rdParty/AGW/agw/aui/auibook.py        2011/07/23 19:06:24     68342
+++ wxPython/3rdParty/AGW/agw/aui/auibook.py        2011/08/16 16:37:37     68742
@@ -795,7 +795,7 @@
Default class constructor.
Used internally, do not call it in your code!

-        :param `auiNotebook`: the parent L{AuiNotebook} window.
+        :param `auiNotebook`: the parent L{AuiNotebook} window.
"""

self._tab_offset = 0
@@ -1204,6 +1204,30 @@
self._buttons.append(button)


+    def CloneButtons(self):
+        """
+        Clones the tab area buttons when the L{AuiNotebook} is being split.
+
+        :see: L{AddButton}
+
+        :note: Standard buttons for L{AuiNotebook} are not cloned, only custom ones.
+        """
+
+        singleton_list = [AUI_BUTTON_CLOSE, AUI_BUTTON_WINDOWLIST, AUI_BUTTON_LEFT, AUI_BUTTON_RIGHT]
+        clones = []
+
+        for button in self._buttons:
+            if button.id not in singleton_list:
+                new_button = AuiTabContainerButton()
+                new_button.id = button.id
+                new_button.bitmap = button.bitmap
+                new_button.dis_bitmap = button.dis_bitmap
+                new_button.location = button.location
+                clones.append(new_button)
+
+        return clones
+
+
def RemoveButton(self, id):
"""
Removes a button from the tab area.
@@ -1991,7 +2015,7 @@
if not isinstance(eventHandler, AuiTabCtrl):
event.Skip()
return
-
+
x, y = event.GetX(), event.GetY()
wnd = self.TabHitTest(x, y)

@@ -3622,7 +3646,7 @@

bitmap = self.GetPageBitmap(page)
bmpData1 = bitmap.ConvertToImage().GetData()
-
+
for indx in xrange(self._imageList.GetImageCount()):
imgListBmp = self._imageList.GetBitmap(indx)
bmpData2 = imgListBmp.ConvertToImage().GetData()
@@ -4123,6 +4147,9 @@
if page_info.control:
self.ReparentControl(page_info.control, dest_tabs)

+        cloned_buttons = self.CloneTabAreaButtons()
+        for clone in cloned_buttons:
+            dest_tabs.AddButton(clone.id, clone.location, clone.bitmap, clone.dis_bitmap)
# create a pane info structure with the information
# about where the pane should be added
pane_info = framemanager.AuiPaneInfo().Bottom().CaptionVisible(False)
@@ -4720,6 +4747,9 @@
self._mgr.Update()
dest_tabs = new_tabs._tabs

+                cloned_buttons = self.CloneTabAreaButtons()
+                for clone in cloned_buttons:
+                    dest_tabs.AddButton(clone.id, clone.location, clone.bitmap, clone.dis_bitmap)
# remove the page from the source tabs
page_info = src_tabs.GetPage(event.GetSelection())

@@ -5543,6 +5573,21 @@
active_tabctrl.RemoveButton(id)


+    def CloneTabAreaButtons(self):
+        """
+        Clones the tab area buttons when the L{AuiNotebook} is being split.
+
+        :see: L{AddTabAreaButton}
+
+        :note: Standard buttons for L{AuiNotebook} are not cloned, only custom ones.
+        """
+
+        active_tabctrl = self.GetActiveTabCtrl()
+        clones = active_tabctrl.CloneButtons()
+
+        return clones
+
+
def HasMultiplePages(self):
"""
This method should be overridden to return ``True`` if this window has multiple pages. All
Tree

Table Of Contents

Previous topic

SVN Revision 68342 For auibook

Next topic

SVN Revision 69086 For auibook