dabo Commit
Revision 4413
Date: 2008-08-14 16:10:25 -0700 (Thu, 14 Aug 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4413

Changed:
U   branches/Nate/dabo/ui/uiwx/__init__.py
U   branches/Nate/dabo/ui/uiwx/dPageFrame.py

Log:
Realized that the some of the features I needed on the flatnotebook weren't 
available until wx version 2.8.4.  So, have import checks for lesser versions.  
Also, found out that there is a copy of flatnotebook in the Editra module that 
fixes the display conflict with the nav buttons and the dropdown tab list.  I 
don't know why it isn't integrated into the main module, but I did a diff on it 
and the only thing changed was the drawing code for the buttons...If it's 
available, I use that else I use the regular module.

So, now this should be safe for all version of wx that Dabo supports.

Diff:
Modified: branches/Nate/dabo/ui/uiwx/__init__.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/__init__.py      2008-08-14 20:55:19 UTC (rev 
4412)
+++ branches/Nate/dabo/ui/uiwx/__init__.py      2008-08-14 23:10:25 UTC (rev 
4413)
@@ -124,7 +124,6 @@
 from dPanel import dPanel
 from dPanel import dScrollPanel
 from dPageFrame import dPageFrame
-from dPageFrame import dAdvancedPageFrame
 from dPageFrame import dPageList
 from dPageFrame import dPageSelect
 from dPageFrameNoTabs import dPageFrameNoTabs
@@ -152,6 +151,10 @@
 except ImportError:
        pass
 
+#The flatnotebook version we need is not avialable with wxPython < 2.8.4
+if wx.VERSION >= (2, 8, 4):
+       from dPageFrame import dAdvancedPageFrame
+
 # dDockForm is not available with wxPython < 2.7
 if wx.VERSION >= (2, 7):
        from dDockForm import dDockForm

Modified: branches/Nate/dabo/ui/uiwx/dPageFrame.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/dPageFrame.py    2008-08-14 20:55:19 UTC (rev 
4412)
+++ branches/Nate/dabo/ui/uiwx/dPageFrame.py    2008-08-14 23:10:25 UTC (rev 
4413)
@@ -1,7 +1,6 @@
 # -*- coding: utf-8 -*-
 import sys
 import wx
-import wx.lib.flatnotebook as fnb
 import dabo
 import dabo.ui
 
@@ -17,7 +16,19 @@
 if _USE_DOCK:
        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))
+if _USE_FLAT:
+       #The Editra flatnotebook module takes care of the Nav Buttons and 
Dropdown Tab List overlap problem, so import that module
+       #Why wxPython doesn't fold this flatnotebook module into the main one 
is beyond me...
+       if (wx.VERSION >= (2, 8, 7, 1)):
+               _USE_EDITRA = True
+               import wx.tools.Editra.src.extern.flatnotebook as fnb
+       else:
+               _USE_EDITRA = False
+               import wx.lib.flatnotebook as fnb
 
+
 def readonly(value):
        """ Create a read-only property. """
        return property(lambda self: value)
@@ -44,292 +55,7 @@
                        self.SetBackgroundColour(self.GetBackgroundColour())
                super(dPageFrame, self)._afterInit()
 
-class dAdvancedPageFrame(dPageFrameMixin, fnb.FlatNotebook):
-       """Creates a pageframe, which can contain an unlimited number of pages,
-       each of which should be a subclass/instance of the dPage class.
-       """
-       _evtPageChanged = readonly(fnb.EVT_FLATNOTEBOOK_PAGE_CHANGED)
-       _evtPageChanging = readonly(fnb.EVT_FLATNOTEBOOK_PAGE_CHANGING)
-       _tabposBottom = readonly(fnb.FNB_BOTTOM)
-       
-       def __init__(self, parent, properties=None, attProperties=None, *args, 
**kwargs):
-               self._baseClass = dAdvancedPageFrame
-               preClass = fnb.FlatNotebook
-               
-               self._inactiveTabTextColor = None
-               self._menuBackColor = None
-               self._showDropdownTabList = False
-               self._showMenuCloseButton = True
-               self._showMenuOnSingleTab = True
-               self._showNavButtons = True
-               self._showPageCloseButtons = False
-               self._tabSideIncline = 0
-               self._tabStyle = "Default"
-               
-               dPageFrameMixin.__init__(self, preClass, parent, properties, 
attProperties, *args, **kwargs)
-       
-       def _initEvents(self):
-               super(dAdvancedPageFrame, self)._initEvents()
-               self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSING, 
self.__onPageClosing)
-               self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSED, self.__onPageClosed)
-               self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU, 
self.__onPageContextMenu)
-       
-       def _afterInit(self):
-               if sys.platform[:3] == "win":
-                       ## This keeps Pages from being ugly on Windows:
-                       self.SetBackgroundColour(self.GetBackgroundColour())
-               super(dAdvancedPageFrame, self)._afterInit()
-       
-       def __onPageClosing(self, evt):
-               """The page has not yet been closed, so we can veto it if 
conditions call for it."""
-               pageNum = evt.GetSelection()
-               if self._beforePageClose(pageNum) is False:
-                       evt.Veto()
-               else:
-                       evt.Skip()
-               self.raiseEvent(dEvents.PageClosing, pageNum=pageNum)
-       
-       def _beforePageClose(self, page):
-               return self.beforePageClose(page)
-       
-       def insertPage(self, *args, **kwargs):
-               page = super(dAdvancedPageFrame, self).insertPage(*args, 
**kwargs)
-               self.SetAllPagesShapeAngle(self._tabSideIncline)        
#incline isn't autoset on new page add so set it
-               return page
-       
-       
-       def beforePageClose(self, page):
-               """Return False from this method to prevent the page from 
closing."""
-               pass
-       
-       def __onPageClosed(self, evt):
-               self.raiseEvent(dEvents.PageClosed)
-       
-       def __onPageContextMenu(self, evt):
-               
self.GetPage(self.GetSelection()).raiseEvent(dEvents.PageContextMenu)
-       
-       #Property getters and setters
-       def _getActiveTabTextColor(self):
-               return self._activeTabTextColor
-       
-       def _setActiveTabTextColor(self, val):
-               if self._constructed():
-                       self._activeTabTextColor = val
-                       if isinstance(val, basestring):
-                               val = dColors.colorTupleFromName(val)
-                       if isinstance(val, tuple):
-                               self.SetActiveTabTextColour(wx.Colour(*val))
-                               self.Refresh()
-                       else:
-                               raise ValueError, (_("'%s' can not be 
translated into a color" % val))
-               else:
-                       self._properties["ActiveTabTextColor"] = val
-       
-       
-       def _getInactiveTabTextColor(self):
-               return self._inactiveTabTextColor
-       
-       def _setInactiveTabTextColor(self, val):
-               if self._constructed():
-                       self._inactiveTabTextColor = val
-                       if isinstance(val, basestring):
-                               val = dColors.colorTupleFromName(val)
-                       if isinstance(val, tuple):
-                               self.SetNonActiveTabTextColour(wx.Colour(*val))
-                               self.Refresh()
-                       else:
-                               raise ValueError, (_("'%s' can not be 
translated into a color" % val))
-               else:
-                       self._properties["InactiveTabTextColor"] = val
-       
-       
-       def _getMenuBackColor(self):
-               return self._menuBackColor
-       
-       def _setMenuBackColor(self, val):
-               if self._constructed():
-                       self._menuBackColor = val
-                       if isinstance(val, basestring):
-                               val = dColors.colorTupleFromName(val)
-                       if isinstance(val, tuple):
-                               self.SetTabAreaColour(wx.Colour(*val))
-                               self.Refresh()
-                       else:
-                               raise ValueError, (_("'%s' can not be 
translated into a color" % val))
-               else:
-                       self._properties["MenuBackColor"] = val
-       
-       
-       def _getShowDropdownTabList(self):
-               return self._showDropdownTabList
-       
-       def _setShowDropdownTabList(self, val):
-               val = bool(val)
-               if val:
-                       self._addWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
-                       self._addWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
-                       self._showNavButtons = False
-               else:
-                       self._delWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
-               
-               self._showDropdownTabList = val
-       
-       
-       def _getShowMenuCloseButton(self):
-               return self._showMenuCloseButton
-       
-       def _setShowMenuCloseButton(self, val):
-               val = bool(val)
-               if val:
-                       self._delWindowStyleFlag(fnb.FNB_NO_X_BUTTON)
-               else:
-                       self._addWindowStyleFlag(fnb.FNB_NO_X_BUTTON)
-               self._showMenuCloseButton = val
-       
-       
-       def _getShowMenuOnSingleTab(self):
-               return self._showMenuOnSingleTab
-       
-       def _setShowMenuOnSingleTab(self, val):
-               val = bool(val)
-               if val:
-                       self._delWindowStyleFlag(fnb.FNB_HIDE_ON_SINGLE_TAB)
-               else:
-                       self._addWindowStyleFlag(fnb.FNB_HIDE_ON_SINGLE_TAB)
-               self._showMenuOnSingleTab = val
-       
-       
-       def _getShowNavButtons(self):
-               return self._showNavButtons
-       
-       def _setShowNavButtons(self, val):
-               val = bool(val)
-               if val:
-                       self._delWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
-                       self._delWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
-                       self._showDropdownTabList = False
-               else:
-                       self._addWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
-               self._showNavButtons = val
-       
-       
-       def _getShowPageCloseButtons(self):
-               return self._showPageCloseButtons
-       
-       def _setShowPageCloseButtons(self, val):
-               val = bool(val)
-               if val:
-                       self._addWindowStyleFlag(fnb.FNB_X_ON_TAB)
-               else:
-                       self._delWindowStyleFlag(fnb.FNB_X_ON_TAB)
-               self._showPageCloseButtons = val
-       
-       
-       def _getTabPosition(self):
-               if self._hasWindowStyleFlag(self._tabposBottom):
-                       return "Bottom"
-               else:
-                       return "Top"
-       
-       def _setTabPosition(self, val):
-               val = str(val)
-               self._delWindowStyleFlag(self._tabposBottom)
-               
-               if val == "Top":
-                       pass
-               elif val == "Bottom":
-                       self._addWindowStyleFlag(self._tabposBottom)
-               else:
-                       raise ValueError, (_("The only possible values are 
'Top' and 'Bottom'"))
-       
-       
-       def _getTabSideIncline(self):
-               return self._tabSideIncline
-       
-       def _setTabSideIncline(self, val):
-               val = int(val)
-               if val<0 or val>15:
-                       raise ValueError, (_("Value must be 0 through 15"))
-               
-               self._tabSideIncline = val
-               self.SetAllPagesShapeAngle(val)
-       
-       
-       def _getTabStyle(self):
-               return self._tabStyle
-       
-       def _setTabStyle(self, val):
-               self._delWindowStyleFlag(fnb.FNB_VC8)
-               self._delWindowStyleFlag(fnb.FNB_VC71)
-               self._delWindowStyleFlag(fnb.FNB_FANCY_TABS)
-               self._delWindowStyleFlag(fnb.FNB_FF2)
-               
-               if val == "Default":
-                       pass
-               elif val == "VC8":
-                       self._addWindowStyleFlag(fnb.FNB_VC8)
-               elif val == "VC71":
-                       self._addWindowStyleFlag(fnb.FNB_VC71)
-               elif val == "Fancy":
-                       self._addWindowStyleFlag(fnb.FNB_FANCY_TABS)
-               elif val == "Firefox":
-                       self._addWindowStyleFlag(fnb.FNB_FF2)
-               else:
-                       ValueError, (_("The only possible values are 'Default' 
and 'VC8', 'VC71', 'Fancy', or 'Firefox'"))
-               
-               self._tabStyle = val
-       
-       
-       #Property definitions
-       ActiveTabTextColor = property(_getActiveTabTextColor, 
_setActiveTabTextColor, None,
-               _("""Specifies the color of the text of the active tab (str or 
3-tuple) (Default=None)
-                       Note, is not visible with the 'VC8' TabStyle"""))
-       
-       InactiveTabTextColor = property(_getInactiveTabTextColor, 
_setInactiveTabTextColor, None,
-               _("""Specifies the color of the text of non active tabs (str or 
3-tuple) (Default=None)
-                       Note, is not visible with the 'VC8' TabStyle"""))
-       
-       MenuBackColor = property(_getMenuBackColor, _setMenuBackColor, None,
-               _("""Specifies the background color of the menu (str or 
3-tuple) (Default=None)
-                       Note, is not visible with 'VC71' TabStyle."""))
-       
-       ShowDropdownTabList = property(_getShowDropdownTabList, 
_setShowDropdownTabList, None,
-                       _("""Specifies whether the dropdown tab list button is 
visible in the menu (bool) (Default=False)
-                       Setting this property to True will set ShowNavButtons 
to False"""))
-       
-       ShowMenuCloseButton = property(_getShowMenuCloseButton, 
_setShowMenuCloseButton, None,
-                       _("Specifies whether the close button is visible in the 
menu (bool) (Default=False)"))
-       
-       ShowMenuOnSingleTab = property(_getShowMenuOnSingleTab, 
_setShowMenuOnSingleTab, None,
-                       _("Specifies whether the tab thumbs and nav buttons are 
shown when there is a single tab. (bool) (Default=True)"))
-       
-       ShowPageCloseButtons = property(_getShowPageCloseButtons, 
_setShowPageCloseButtons, None,
-                       _("Specifies whether the close button is visible on the 
page tab (bool) (Default=False)"))
-       
-       ShowNavButtons = property(_getShowNavButtons, _setShowNavButtons, None,
-                       _("""Specifies whether the left and right nav buttons 
are visible in the menu (bool) (Default=True)
-                       Setting this property to True will set 
ShowDropdownTabList to False"""))
-       
-       TabPosition = property(_getTabPosition, _setTabPosition, None, 
-                       _("""Specifies where the page tabs are located. 
(string) 
-                               Top (default) 
-                               Bottom""") )
-       
-       TabSideIncline = property(_getTabSideIncline, _setTabSideIncline, None,
-                       _("""Specifies the incline of the sides of the tab in 
degrees (int) (Default=0)
-                               Acceptable values are 0  - 15.
-                               Note this property will have no effect on 
TabStyles other than Default.
-                               """))
-       
-       TabStyle = property(_getTabStyle, _setTabStyle, None,
-                       _("""Specifies the style of the display tabs. (string)
-                               "Default" (default)
-                               "VC8"
-                               "VC71"
-                               "Fancy"
-                               "Firefox\""""))
 
-
 class dPageList(dPageFrameMixin, wx.Listbook):
        _evtPageChanged = readonly(wx.EVT_LISTBOOK_PAGE_CHANGED)
        _evtPageChanging = readonly(wx.EVT_LISTBOOK_PAGE_CHANGING)
@@ -480,8 +206,296 @@
                def _insertPageOverride(self, pos, pgCls, caption, imgKey): pass
 else:
        dDockTabs = dPageFrame
+
+if _USE_FLAT:
+       class dAdvancedPageFrame(dPageFrameMixin, fnb.FlatNotebook):
+               """Creates a pageframe, which can contain an unlimited number 
of pages,
+               each of which should be a subclass/instance of the dPage class.
+               """
+               _evtPageChanged = readonly(fnb.EVT_FLATNOTEBOOK_PAGE_CHANGED)
+               _evtPageChanging = readonly(fnb.EVT_FLATNOTEBOOK_PAGE_CHANGING)
+               _tabposBottom = readonly(fnb.FNB_BOTTOM)
                
+               def __init__(self, parent, properties=None, attProperties=None, 
*args, **kwargs):
+                       self._baseClass = dAdvancedPageFrame
+                       preClass = fnb.FlatNotebook
+                       
+                       self._inactiveTabTextColor = None
+                       self._menuBackColor = None
+                       self._showDropdownTabList = False
+                       self._showMenuCloseButton = True
+                       self._showMenuOnSingleTab = True
+                       self._showNavButtons = True
+                       self._showPageCloseButtons = False
+                       self._tabSideIncline = 0
+                       self._tabStyle = "Default"
+                       
+                       dPageFrameMixin.__init__(self, preClass, parent, 
properties, attProperties, *args, **kwargs)
+               
+               def _initEvents(self):
+                       super(dAdvancedPageFrame, self)._initEvents()
+                       self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSING, 
self.__onPageClosing)
+                       self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSED, 
self.__onPageClosed)
+                       self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU, 
self.__onPageContextMenu)
+               
+               def _afterInit(self):
+                       if sys.platform[:3] == "win":
+                               ## This keeps Pages from being ugly on Windows:
+                               
self.SetBackgroundColour(self.GetBackgroundColour())
+                       super(dAdvancedPageFrame, self)._afterInit()
+               
+               def __onPageClosing(self, evt):
+                       """The page has not yet been closed, so we can veto it 
if conditions call for it."""
+                       pageNum = evt.GetSelection()
+                       if self._beforePageClose(pageNum) is False:
+                               evt.Veto()
+                       else:
+                               evt.Skip()
+                       self.raiseEvent(dEvents.PageClosing, pageNum=pageNum)
+               
+               def _beforePageClose(self, page):
+                       return self.beforePageClose(page)
+               
+               def insertPage(self, *args, **kwargs):
+                       page = super(dAdvancedPageFrame, 
self).insertPage(*args, **kwargs)
+                       self.SetAllPagesShapeAngle(self._tabSideIncline)        
#incline isn't autoset on new page add so set it
+                       return page
+               
+               
+               def beforePageClose(self, page):
+                       """Return False from this method to prevent the page 
from closing."""
+                       pass
+               
+               def __onPageClosed(self, evt):
+                       self.raiseEvent(dEvents.PageClosed)
+               
+               def __onPageContextMenu(self, evt):
+                       
self.GetPage(self.GetSelection()).raiseEvent(dEvents.PageContextMenu)
+               
+               #Property getters and setters
+               def _getActiveTabTextColor(self):
+                       return self._activeTabTextColor
+               
+               def _setActiveTabTextColor(self, val):
+                       if self._constructed():
+                               self._activeTabTextColor = val
+                               if isinstance(val, basestring):
+                                       val = dColors.colorTupleFromName(val)
+                               if isinstance(val, tuple):
+                                       
self.SetActiveTabTextColour(wx.Colour(*val))
+                                       self.Refresh()
+                               else:
+                                       raise ValueError, (_("'%s' can not be 
translated into a color" % val))
+                       else:
+                               self._properties["ActiveTabTextColor"] = val
+               
+               
+               def _getInactiveTabTextColor(self):
+                       return self._inactiveTabTextColor
+               
+               def _setInactiveTabTextColor(self, val):
+                       if self._constructed():
+                               self._inactiveTabTextColor = val
+                               if isinstance(val, basestring):
+                                       val = dColors.colorTupleFromName(val)
+                               if isinstance(val, tuple):
+                                       
self.SetNonActiveTabTextColour(wx.Colour(*val))
+                                       self.Refresh()
+                               else:
+                                       raise ValueError, (_("'%s' can not be 
translated into a color" % val))
+                       else:
+                               self._properties["InactiveTabTextColor"] = val
+               
+               
+               def _getMenuBackColor(self):
+                       return self._menuBackColor
+               
+               def _setMenuBackColor(self, val):
+                       if self._constructed():
+                               self._menuBackColor = val
+                               if isinstance(val, basestring):
+                                       val = dColors.colorTupleFromName(val)
+                               if isinstance(val, tuple):
+                                       self.SetTabAreaColour(wx.Colour(*val))
+                                       self.Refresh()
+                               else:
+                                       raise ValueError, (_("'%s' can not be 
translated into a color" % val))
+                       else:
+                               self._properties["MenuBackColor"] = val
+               
+               
+               def _getShowDropdownTabList(self):
+                       return self._showDropdownTabList
+               
+               def _setShowDropdownTabList(self, val):
+                       val = bool(val)
+                       if val:
+                               
self._addWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
+                               if not _USE_EDITRA:
+                                       
self._addWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
+                                       self._showNavButtons = False
+                       else:
+                               
self._delWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
+                       
+                       self._showDropdownTabList = val
+               
+               
+               def _getShowMenuCloseButton(self):
+                       return self._showMenuCloseButton
+               
+               def _setShowMenuCloseButton(self, val):
+                       val = bool(val)
+                       if val:
+                               self._delWindowStyleFlag(fnb.FNB_NO_X_BUTTON)
+                       else:
+                               self._addWindowStyleFlag(fnb.FNB_NO_X_BUTTON)
+                       self._showMenuCloseButton = val
+               
+               
+               def _getShowMenuOnSingleTab(self):
+                       return self._showMenuOnSingleTab
+               
+               def _setShowMenuOnSingleTab(self, val):
+                       val = bool(val)
+                       if val:
+                               
self._delWindowStyleFlag(fnb.FNB_HIDE_ON_SINGLE_TAB)
+                       else:
+                               
self._addWindowStyleFlag(fnb.FNB_HIDE_ON_SINGLE_TAB)
+                       self._showMenuOnSingleTab = val
+               
+               
+               def _getShowNavButtons(self):
+                       return self._showNavButtons
+               
+               def _setShowNavButtons(self, val):
+                       val = bool(val)
+                       if val:
+                               self._delWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
+                               if not _USE_EDITRA:
+                                       
self._delWindowStyleFlag(fnb.FNB_DROPDOWN_TABS_LIST)
+                                       self._showDropdownTabList = False
+                       else:
+                               self._addWindowStyleFlag(fnb.FNB_NO_NAV_BUTTONS)
+                       self._showNavButtons = val
+               
+               
+               def _getShowPageCloseButtons(self):
+                       return self._showPageCloseButtons
+               
+               def _setShowPageCloseButtons(self, val):
+                       val = bool(val)
+                       if val:
+                               self._addWindowStyleFlag(fnb.FNB_X_ON_TAB)
+                       else:
+                               self._delWindowStyleFlag(fnb.FNB_X_ON_TAB)
+                       self._showPageCloseButtons = val
+               
+               
+               def _getTabPosition(self):
+                       if self._hasWindowStyleFlag(self._tabposBottom):
+                               return "Bottom"
+                       else:
+                               return "Top"
+               
+               def _setTabPosition(self, val):
+                       val = str(val)
+                       self._delWindowStyleFlag(self._tabposBottom)
+                       
+                       if val == "Top":
+                               pass
+                       elif val == "Bottom":
+                               self._addWindowStyleFlag(self._tabposBottom)
+                       else:
+                               raise ValueError, (_("The only possible values 
are 'Top' and 'Bottom'"))
+               
+               
+               def _getTabSideIncline(self):
+                       return self._tabSideIncline
+               
+               def _setTabSideIncline(self, val):
+                       val = int(val)
+                       if val<0 or val>15:
+                               raise ValueError, (_("Value must be 0 through 
15"))
+                       
+                       self._tabSideIncline = val
+                       self.SetAllPagesShapeAngle(val)
+               
+               
+               def _getTabStyle(self):
+                       return self._tabStyle
+               
+               def _setTabStyle(self, val):
+                       self._delWindowStyleFlag(fnb.FNB_VC8)
+                       self._delWindowStyleFlag(fnb.FNB_VC71)
+                       self._delWindowStyleFlag(fnb.FNB_FANCY_TABS)
+                       self._delWindowStyleFlag(fnb.FNB_FF2)
+                       
+                       if val == "Default":
+                               pass
+                       elif val == "VC8":
+                               self._addWindowStyleFlag(fnb.FNB_VC8)
+                       elif val == "VC71":
+                               self._addWindowStyleFlag(fnb.FNB_VC71)
+                       elif val == "Fancy":
+                               self._addWindowStyleFlag(fnb.FNB_FANCY_TABS)
+                       elif val == "Firefox":
+                               self._addWindowStyleFlag(fnb.FNB_FF2)
+                       else:
+                               ValueError, (_("The only possible values are 
'Default' and 'VC8', 'VC71', 'Fancy', or 'Firefox'"))
+                       
+                       self._tabStyle = val
+               
+               
+               #Property definitions
+               ActiveTabTextColor = property(_getActiveTabTextColor, 
_setActiveTabTextColor, None,
+                       _("""Specifies the color of the text of the active tab 
(str or 3-tuple) (Default=None)
+                               Note, is not visible with the 'VC8' 
TabStyle"""))
+               
+               InactiveTabTextColor = property(_getInactiveTabTextColor, 
_setInactiveTabTextColor, None,
+                       _("""Specifies the color of the text of non active tabs 
(str or 3-tuple) (Default=None)
+                               Note, is not visible with the 'VC8' 
TabStyle"""))
+               
+               MenuBackColor = property(_getMenuBackColor, _setMenuBackColor, 
None,
+                       _("""Specifies the background color of the menu (str or 
3-tuple) (Default=None)
+                               Note, is not visible with 'VC71' TabStyle."""))
+               
+               ShowDropdownTabList = property(_getShowDropdownTabList, 
_setShowDropdownTabList, None,
+                               _("""Specifies whether the dropdown tab list 
button is visible in the menu (bool) (Default=False)
+                               Setting this property to True will set 
ShowNavButtons to False"""))
+               
+               ShowMenuCloseButton = property(_getShowMenuCloseButton, 
_setShowMenuCloseButton, None,
+                               _("Specifies whether the close button is 
visible in the menu (bool) (Default=False)"))
+               
+               ShowMenuOnSingleTab = property(_getShowMenuOnSingleTab, 
_setShowMenuOnSingleTab, None,
+                               _("Specifies whether the tab thumbs and nav 
buttons are shown when there is a single tab. (bool) (Default=True)"))
+               
+               ShowPageCloseButtons = property(_getShowPageCloseButtons, 
_setShowPageCloseButtons, None,
+                               _("Specifies whether the close button is 
visible on the page tab (bool) (Default=False)"))
+               
+               ShowNavButtons = property(_getShowNavButtons, 
_setShowNavButtons, None,
+                               _("""Specifies whether the left and right nav 
buttons are visible in the menu (bool) (Default=True)
+                               Setting this property to True will set 
ShowDropdownTabList to False"""))
+               
+               TabPosition = property(_getTabPosition, _setTabPosition, None, 
+                               _("""Specifies where the page tabs are located. 
(string) 
+                                       Top (default) 
+                                       Bottom""") )
+               
+               TabSideIncline = property(_getTabSideIncline, 
_setTabSideIncline, None,
+                               _("""Specifies the incline of the sides of the 
tab in degrees (int) (Default=0)
+                                       Acceptable values are 0  - 15.
+                                       Note this property will have no effect 
on TabStyles other than Default.
+                                       """))
+               
+               TabStyle = property(_getTabStyle, _setTabStyle, None,
+                               _("""Specifies the style of the display tabs. 
(string)
+                                       "Default" (default)
+                                       "VC8"
+                                       "VC71"
+                                       "Fancy"
+                                       "Firefox\""""))
 
+
 import random
 
 class TestMixin(object):
@@ -503,31 +517,33 @@
        def onPageChanged(self, evt):
                print "Page number changed from %s to %s" % (evt.oldPageNum, 
evt.newPageNum)
 
-class _dAdvancedPageFrame_test(TestMixin, dAdvancedPageFrame): 
-       def initProperties(self):
-               print "in init properties"
-               self.Width = 400
-               self.Height = 175
-               self.TabStyle = random.choice(("Default", "VC8", "VC71", 
"Fancy", "Firefox"))
-               self.TabPosition = random.choice(("Top", "Bottom"))
-               self.ShowPageCloseButtons = random.choice(("True", "False"))
-               self.ShowDropdownTabList = random.choice(("True", "False"))
-               self.ShowMenuClose = random.choice(("True", "False"))
-               self.ShowMenuOnSingleTab = random.choice(("True", "False"))
-               self.MenuBackColor = random.choice(dColors.colors)
-               self.InactiveTabTextColor = random.choice(dColors.colors)
-               self.ActiveTabTextColor = random.choice(dColors.colors)
-
 class _dPageFrame_test(TestMixin, dPageFrame): pass
 class _dPageList_test(TestMixin, dPageList): pass
 class _dPageSelect_test(TestMixin, dPageSelect): pass
 class _dDockTabs_test(TestMixin, dDockTabs): pass
+if _USE_FLAT:
+       class _dAdvancedPageFrame_test(TestMixin, dAdvancedPageFrame): 
+               def initProperties(self):
+                       print "in init properties"
+                       self.Width = 400
+                       self.Height = 175
+                       self.TabStyle = random.choice(("Default", "VC8", 
"VC71", "Fancy", "Firefox"))
+                       self.TabPosition = random.choice(("Top", "Bottom"))
+                       self.ShowPageCloseButtons = random.choice(("True", 
"False"))
+                       self.ShowDropdownTabList = random.choice(("True", 
"False"))
+                       self.ShowMenuClose = random.choice(("True", "False"))
+                       self.ShowMenuOnSingleTab = random.choice(("True", 
"False"))
+                       self.MenuBackColor = random.choice(dColors.colors)
+                       self.InactiveTabTextColor = 
random.choice(dColors.colors)
+                       self.ActiveTabTextColor = random.choice(dColors.colors)
 
 
+
 if __name__ == "__main__":
        import test
        test.Test().runTest(_dPageFrame_test)
        test.Test().runTest(_dPageList_test)
        test.Test().runTest(_dPageSelect_test)
-       test.Test().runTest(_dAdvancedPageFrame_test)
        test.Test().runTest(_dDockTabs_test)
+       if _USE_FLAT:
+               test.Test().runTest(_dAdvancedPageFrame_test)




_______________________________________________
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