dabo Commit
Revision 4462
Date: 2008-08-27 10:25:12 -0700 (Wed, 27 Aug 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4462

Changed:
U   trunk/dabo/ui/uiwx/__init__.py
U   trunk/dabo/ui/uiwx/dPageFrame.py

Log:
Removed the check for WxPython 2.7 for the DockForm and DockTabs widgets since 
Dabo no longer supports WxPython < 2.8.

Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2008-08-27 16:32:20 UTC (rev 4461)
+++ trunk/dabo/ui/uiwx/__init__.py      2008-08-27 17:25:12 UTC (rev 4462)
@@ -78,6 +78,7 @@
 from dColorDialog import dColorDialog
 from dComboBox import dComboBox
 from dDateTextBox import dDateTextBox
+from dDockForm import dDockForm
 from dDropdownList import dDropdownList
 from dDialog import dDialog
 from dDialog import dStandardButtonDialog
@@ -126,6 +127,7 @@
 from dPageFrame import dPageFrame
 from dPageFrame import dPageList
 from dPageFrame import dPageSelect
+from dPageFrame import dDockTabs
 from dPageFrameNoTabs import dPageFrameNoTabs
 from dPage import dPage
 from dPdfWindow import dPdfWindow
@@ -155,11 +157,6 @@
 if wx.VERSION >= (2, 8, 4):
        from dPageFrame import DPageFrame
 
-# dDockForm is not available with wxPython < 2.7
-if wx.VERSION >= (2, 7):
-       from dDockForm import dDockForm
-       from dPageFrame import dDockTabs
-
 # Support the old names, but issue deprecation warnings.
 class dFoldPanelBar(dSlidePanelControl):
        def __init__(self, *args, **kwargs):

Modified: trunk/dabo/ui/uiwx/dPageFrame.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrame.py    2008-08-27 16:32:20 UTC (rev 4461)
+++ trunk/dabo/ui/uiwx/dPageFrame.py    2008-08-27 17:25:12 UTC (rev 4462)
@@ -11,10 +11,7 @@
 from dPageFrameMixin import dPageFrameMixin
 import dabo.dColors as dColors
 
-# dDockForm is not available with wxPython < 2.7
-_USE_DOCK = (wx.VERSION >= (2, 7))
-if _USE_DOCK:
-       import wx.aui as aui
+import wx.aui as aui
 
 #The flatnotebook version we need is not avialable with wxPython < 2.8.4
 _USE_FLAT = (wx.VERSION >= (2, 8, 4))
@@ -144,69 +141,67 @@
                dd.SetSelection(pos)
 
 
-if _USE_DOCK:
-       class dDockTabs(dPageFrameMixin, aui.AuiNotebook):
-               _evtPageChanged = readonly(aui.EVT_AUINOTEBOOK_PAGE_CHANGED)
-               _evtPageChanging = readonly(aui.EVT_AUINOTEBOOK_PAGE_CHANGING)
-               _tabposBottom = readonly(aui.AUI_NB_BOTTOM)
-               _tabposRight = readonly(aui.AUI_NB_RIGHT)
-               _tabposLeft = readonly(aui.AUI_NB_LEFT)
-               _tabposTop = readonly(aui.AUI_NB_TOP)
-       
-               def __init__(self, parent, properties=None, attProperties=None, 
*args, **kwargs):
-                       self._baseClass = dDockTabs
-                       preClass = aui.AuiNotebook
-                       
-                       newStyle = (aui.AUI_NB_TOP | aui.AUI_NB_TAB_SPLIT | 
aui.AUI_NB_TAB_MOVE
-                                       | aui.AUI_NB_SCROLL_BUTTONS | 
aui.AUI_NB_CLOSE_ON_ALL_TABS)
-                       if "style" in kwargs:
-                               newStyle = kwargs["style"] | newStyle
-                       kwargs["style"] = newStyle
-                       dPageFrameMixin.__init__(self, preClass, parent, 
properties, attProperties, *args, **kwargs)
-       
-       
-               def insertPage(self, pos, pgCls=None, caption="", imgKey=None,
-                               ignoreOverride=False):
-                       """ Insert the page into the pageframe at the specified 
position, 
-                       and optionally sets the page caption and image. The 
image 
-                       should have already been added to the pageframe if it 
is 
-                       going to be set here.
-                       """
-                       # Allow subclasses to potentially override this 
behavior. This will
-                       # enable them to handle page creation in their own way. 
If overridden,
-                       # the method will return the new page.
-                       ret = None
-                       if not ignoreOverride:
-                               ret = self._insertPageOverride(pos, pgCls, 
caption, imgKey)
-                       if ret:
-                               return ret                      
-                       if pgCls is None:
-                               pgCls = self.PageClass
-                       if isinstance(pgCls, dabo.ui.dPage):
-                               pg = pgCls
-                       else:
-                               # See if the 'pgCls' is either some XML or the 
path of an XML file
-                               if isinstance(pgCls, basestring):
-                                       xml = pgCls
-                                       from dabo.lib.DesignerXmlConverter 
import DesignerXmlConverter
-                                       conv = DesignerXmlConverter()
-                                       pgCls = conv.classFromXml(xml)
-                               pg = pgCls(self)
-                       if not caption:
-                               # Page could have its own default caption
-                               caption = pg._caption
-                       if imgKey:
-                               idx = self._imageList[imgKey]
-                               bmp = self.GetImageList().GetBitmap(idx)
-                               self.InsertPage(pos, pg, caption=caption, 
bitmap=bmp)
-                       else:
-                               self.InsertPage(pos, pg, caption=caption)
-                       self.layout()
-                       return self.Pages[pos]
-               def _insertPageOverride(self, pos, pgCls, caption, imgKey): pass
-else:
-       dDockTabs = dPageFrame
+class dDockTabs(dPageFrameMixin, aui.AuiNotebook):
+       _evtPageChanged = readonly(aui.EVT_AUINOTEBOOK_PAGE_CHANGED)
+       _evtPageChanging = readonly(aui.EVT_AUINOTEBOOK_PAGE_CHANGING)
+       _tabposBottom = readonly(aui.AUI_NB_BOTTOM)
+       _tabposRight = readonly(aui.AUI_NB_RIGHT)
+       _tabposLeft = readonly(aui.AUI_NB_LEFT)
+       _tabposTop = readonly(aui.AUI_NB_TOP)
 
+       def __init__(self, parent, properties=None, attProperties=None, *args, 
**kwargs):
+               self._baseClass = dDockTabs
+               preClass = aui.AuiNotebook
+               
+               newStyle = (aui.AUI_NB_TOP | aui.AUI_NB_TAB_SPLIT | 
aui.AUI_NB_TAB_MOVE
+                               | aui.AUI_NB_SCROLL_BUTTONS | 
aui.AUI_NB_CLOSE_ON_ALL_TABS)
+               if "style" in kwargs:
+                       newStyle = kwargs["style"] | newStyle
+               kwargs["style"] = newStyle
+               dPageFrameMixin.__init__(self, preClass, parent, properties, 
attProperties, *args, **kwargs)
+
+
+       def insertPage(self, pos, pgCls=None, caption="", imgKey=None,
+                       ignoreOverride=False):
+               """ Insert the page into the pageframe at the specified 
position, 
+               and optionally sets the page caption and image. The image 
+               should have already been added to the pageframe if it is 
+               going to be set here.
+               """
+               # Allow subclasses to potentially override this behavior. This 
will
+               # enable them to handle page creation in their own way. If 
overridden,
+               # the method will return the new page.
+               ret = None
+               if not ignoreOverride:
+                       ret = self._insertPageOverride(pos, pgCls, caption, 
imgKey)
+               if ret:
+                       return ret                      
+               if pgCls is None:
+                       pgCls = self.PageClass
+               if isinstance(pgCls, dabo.ui.dPage):
+                       pg = pgCls
+               else:
+                       # See if the 'pgCls' is either some XML or the path of 
an XML file
+                       if isinstance(pgCls, basestring):
+                               xml = pgCls
+                               from dabo.lib.DesignerXmlConverter import 
DesignerXmlConverter
+                               conv = DesignerXmlConverter()
+                               pgCls = conv.classFromXml(xml)
+                       pg = pgCls(self)
+               if not caption:
+                       # Page could have its own default caption
+                       caption = pg._caption
+               if imgKey:
+                       idx = self._imageList[imgKey]
+                       bmp = self.GetImageList().GetBitmap(idx)
+                       self.InsertPage(pos, pg, caption=caption, bitmap=bmp)
+               else:
+                       self.InsertPage(pos, pg, caption=caption)
+               self.layout()
+               return self.Pages[pos]
+       def _insertPageOverride(self, pos, pgCls, caption, imgKey): pass
+
+
 if _USE_FLAT:
        class DPageFrame(dPageFrameMixin, fnb.FlatNotebook):
                """Creates a pageframe, which can contain an unlimited number 
of pages,




_______________________________________________
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]

Reply via email to