Changeset 4204

Show
Ignore:
Timestamp:
06/27/2008 03:49:18 PM (4 months ago)
Author:
paul
Message:

Added VisibleOnScreen? property to all ui controls. This is a read-only
property that tells you if the object is actually visible or not,
taking into account visibility of parent objects and sizers.

Fixed a problem in the getter of dSizerMixin.Visible: querying it when
it hadn't been explicitly set would result in an AttributeError?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dPemMixin.py

    r4188 r4204  
    24992499            self._properties["Visible"] = val 
    25002500 
     2501     
     2502    def _getVisibleOnScreen(self): 
     2503        return self.IsShownOnScreen() 
     2504 
    25012505         
    25022506    def _getWidth(self): 
     
    27252729    Visible = property(_getVisible, _setVisible, None, 
    27262730            _("Specifies whether the object is visible at runtime.  (bool)") ) 
    2727      
     2731 
     2732    VisibleOnScreen = property(_getVisibleOnScreen, None, None,  
     2733            _("""Specifies whether the object is physically visible at runtime.  (bool)  
     2734 
     2735            The Visible property could return True even if the object isn't actually 
     2736            shown on screen, due to a parent object or sizer being invisible. 
     2737 
     2738            The VisibleOnScreen property will return True only if the object and all 
     2739            parents are visible. 
     2740            """)) 
     2741 
    27282742    Width = property(_getWidth, _setWidth, None, 
    27292743            _("The width of the object. (int)") ) 
  • trunk/dabo/ui/uiwx/dSizerMixin.py

    r4186 r4204  
    808808         
    809809    def _getVisible(self): 
    810         return self._visible 
    811          
     810        try: 
     811            return self._visible 
     812        except AttributeError: 
     813            default = True 
     814            self._setVisible(default) 
     815            return default 
     816             
    812817    def _setVisible(self, val): 
    813818        if isinstance(val, basestring): 
     
    877882     
    878883    Visible = property(_getVisible, _setVisible, None,  
    879             _("Shows/hides the sizer and its contained items  (bool)" ) ) 
     884            _("Specifies whether the sizer and contained items are shown  (bool)" ) ) 
    880885 
    881886    Width = property(_getWd, None, None,