dabo Commit
Revision 7161
Date: 2012-04-30 08:58:02 -0700 (Mon, 30 Apr 2012)
Author: Ed
Trac: http://trac.dabodev.com/changeset/7161
Changed:
U trunk/dabo/ui/uiwx/dFormMixin.py
U trunk/dabo/ui/uiwx/dPageFrame.py
Log:
Fixed a vim typo
Diff:
Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py 2012-04-30 15:48:16 UTC (rev 7160)
+++ trunk/dabo/ui/uiwx/dFormMixin.py 2012-04-30 15:58:02 UTC (rev 7161)
@@ -185,7 +185,7 @@
how to restore a maximized frame in this case, but at least we
can catch
the case where the window isn't maximized already.
"""
- if i(self.MDI and sys.platform.startswith("darwin") and not
maximize
+ if (self.MDI and sys.platform.startswith("darwin") and not
maximize
and not self.IsMaximized()):
return
super(dFormMixin, self).Maximize(maximize, *args, **kwargs)
Modified: trunk/dabo/ui/uiwx/dPageFrame.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrame.py 2012-04-30 15:48:16 UTC (rev 7160)
+++ trunk/dabo/ui/uiwx/dPageFrame.py 2012-04-30 15:58:02 UTC (rev 7161)
@@ -92,6 +92,40 @@
super(dPageToolBar, self)._afterInit()
+ def removePage(self, pgOrPos, delPage=True):
+ """
+ Removes the specified page. You can specify a page by either
+ passing the page itself, or a position. If delPage is True
(default),
+ the page is released, and None is returned. If delPage is
+ False, the page is returned. There is a bug in the wx.Toolbook
class
+ that breaks the link between the toolbar buttons and their pages
+ when a page is removed, so this attempts to work around this.
+ """
+ pos = pgOrPos
+ if isinstance(pgOrPos, int):
+ pg = self.Pages[pgOrPos]
+ else:
+ pg = pgOrPos
+ pos = self.Pages.index(pg)
+ # Get all the pages after the one to be deleted
+ laterPages = self.Pages[pos + 1:]
+ for lpg in laterPages:
+ self.RemovePage(pos + 1)
+ if delPage:
+ self.DeletePage(pos)
+ ret = None
+ else:
+ self.RemovePage(pos)
+ ret = pg
+ for lpg in laterPages:
+ self.appendPage(lpg, caption=lpg.Caption,
imgKey=lpg.imgKey)
+ return ret
+
+ def RemovePage(self, pos):
+ print "REMOVING PAGE", self.Pages[pos].imgKey
+ super(dPageToolBar, self).RemovePage(pos)
+
+
class dPageList(dPageFrameMixin, wx.Listbook):
_evtPageChanged = readonly(wx.EVT_LISTBOOK_PAGE_CHANGED)
_evtPageChanging = readonly(wx.EVT_LISTBOOK_PAGE_CHANGING)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]