dabo Commit
Revision 2033
Date: 2006-03-24 08:14:53 -0800 (Fri, 24 Mar 2006)
Author: ed

Changed:
U   trunk/dabo/ui/uiwx/dPage.py
U   trunk/dabo/ui/uiwx/dPageFrameMixin.py

Log:
Fixed a typo in dPage.

Added the ability to set the page icon at any point, without having to add the 
image to the pageframe's image list first.


Diff:
Modified: trunk/dabo/ui/uiwx/dPage.py
===================================================================
--- trunk/dabo/ui/uiwx/dPage.py 2006-03-24 15:14:44 UTC (rev 2032)
+++ trunk/dabo/ui/uiwx/dPage.py 2006-03-24 16:14:53 UTC (rev 2033)
@@ -82,7 +82,7 @@
                        
        
        def _getImage(self):
-               return self.Parent.getPageImg(self)
+               return self.Parent.getPageImage(self)
 
        def _setImage(self, imgKey):
                if self._constructed():
@@ -93,7 +93,6 @@
        
        Caption = property(_getCaption, _setCaption, None, 
                        _("The text identifying this particular page.  (str)") )
-       DynamicCaption = makeDynamicProperty(Caption)
 
        Image = property(_getImage, _setImage, None, 
                        _("""Sets the image that is displayed on the page tab. 
This is
@@ -101,5 +100,8 @@
                        image already added to the parent pageframe.
                        When used to retrieve an image, it returns the index of 
the
                        page's image in the parent pageframe's image list.   
(int)""") )
+
+
+       DynamicCaption = makeDynamicProperty(Caption)
        DynamicImage = makeDynamicProperty(Image)
 

Modified: trunk/dabo/ui/uiwx/dPageFrameMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrameMixin.py       2006-03-24 15:14:44 UTC (rev 
2032)
+++ trunk/dabo/ui/uiwx/dPageFrameMixin.py       2006-03-24 16:14:53 UTC (rev 
2033)
@@ -60,7 +60,7 @@
                        dabo.ui.callAfter(self.raiseEvent, dEvents.PageChanged, 
                                        oldPageNum=oldPageNum, 
newPageNum=newPageNum)
                        
-               
+       
        # Image-handling function
        def addImage(self, img, key=None):
                """ Adds the passed image to the control's ImageList, and 
maintains
@@ -88,7 +88,13 @@
                        if isinstance(imgKey, int):
                                imgIdx = imgKey
                        else:
-                               imgIdx = self._imageList[imgKey]
+                               try:
+                                       imgIdx = self._imageList[imgKey]
+                               except KeyError:
+                                       # They may be trying to set the page's 
Image to an
+                                       # image that hasn't yet been added to 
the image list.
+                                       self.addImage(imgKey)
+                                       imgIdx = self._imageList[imgKey]
                        self.SetPageImage(pgIdx, imgIdx)
 
        
@@ -322,25 +328,21 @@
                        This really only applies when using the PageCount 
property to set the
                        number of pages. If you instead use AddPage() you still 
need to send 
                        an instance as usual. Class must descend from a dabo 
base class.""") )
-       DynamicPageClass = makeDynamicProperty(PageClass)
                                                
        PageCount = property(_getPageCount, _setPageCount, None, 
                        _("""Specifies the number of pages in the pageframe. 
(int) 
                        When using this to increase the number of pages, 
PageClass 
                        will be queried as the object to use as the page 
object.""") )
-       DynamicPageCount = makeDynamicProperty(PageCount)
        
        Pages = property(_getPgs, None, None,
                        _("Returns a list of the contained pages.  (list)") )
        
        SelectedPage = property(_getSelectedPage, _setSelectedPage, None,
                        _("References the current frontmost page.  (dPage)") )
-       DynamicSelectedPage = makeDynamicProperty(SelectedPage)
                                                
        SelectedPageNumber = property(_getSelectedPageNumber, 
_setSelectedPageNumber, 
                        None,
                        _("Returns the index of the current frontmost page.  
(int)") )
-       DynamicSelectedPageNumber = makeDynamicProperty(SelectedPageNumber)
                                                
        TabPosition = property(_getTabPosition, _setTabPosition, None, 
                        _("""Specifies where the page tabs are located. (int) 
@@ -348,5 +350,10 @@
                                Left 
                                Right 
                                Bottom""") )
+
+
+       DynamicPageClass = makeDynamicProperty(PageClass)
+       DynamicPageCount = makeDynamicProperty(PageCount)
+       DynamicSelectedPage = makeDynamicProperty(SelectedPage)
+       DynamicSelectedPageNumber = makeDynamicProperty(SelectedPageNumber)
        DynamicTabPosition = makeDynamicProperty(TabPosition)
-




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to