Changeset 4139

Show
Ignore:
Timestamp:
06/16/08 16:55:11 (5 months ago)
Author:
ed
Message:

Moved the Transparency property from dFormMixin to dPemMixin, as it is possible to set it for individual controls. This doesn't break any existing uses at the form level, but enables control-by-control adjustment of transparency.

Files:

Legend:

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

    r4119 r4139  
    6161        # Flag to denote temporary forms 
    6262        self._tempForm = False 
    63         # Transparency level 
    64         self._transparency = None 
    6563        # Defaults for window sizing 
    6664        self._defaultLeft = 50 
     
    958956 
    959957     
    960     def _getTransparency(self): 
    961         return self._transparency 
    962  
    963     def _setTransparency(self, val): 
    964         if self._constructed(): 
    965             val = min(max(val, 0), 255) 
    966             self._transparency = val 
    967             self.SetTransparent(val) 
    968         else: 
    969             self._properties["Transparency"] = val 
    970  
    971  
    972958    def _getWindowState(self): 
    973959        try: 
     
    11161102            _("Tool bar for this form. (dToolBar)")) 
    11171103     
    1118     Transparency = property(_getTransparency, _setTransparency, None, 
    1119             _("""Transparency level of the form; ranges from 0 (transparent) to 255 (opaque).  
    1120             Default=0. Does not currently work on Gtk/Linux.  (int)""")) 
    1121      
    1122  
    11231104    WindowState = property(_getWindowState, _setWindowState, None, 
    11241105            _("""Specifies the current state of the form. (int) 
     
    11421123    DynamicStatusText = makeDynamicProperty(StatusText) 
    11431124    DynamicToolBar = makeDynamicProperty(ToolBar) 
    1144     DynamicTransparency = makeDynamicProperty(Transparency) 
    11451125    DynamicWindowState = makeDynamicProperty(WindowState) 
  • trunk/dabo/ui/uiwx/dPemMixin.py

    r4115 r4139  
    3838        # has been constructed. 
    3939        self._delayedEventBindings = [] 
     40        # Transparency level 
     41        self._transparency = 255 
    4042         
    4143        # There are a few controls that don't yet support 3-way inits (grid, for  
     
    24702472            self._properties["Top"] = val 
    24712473 
    2472      
     2474 
     2475    def _getTransparency(self): 
     2476        return self._transparency 
     2477 
     2478    def _setTransparency(self, val): 
     2479        if self._constructed(): 
     2480            val = min(max(val, 0), 255) 
     2481            self._transparency = val 
     2482            self.SetTransparent(val) 
     2483        else: 
     2484            self._properties["Transparency"] = val 
     2485 
     2486 
    24732487    def _getVisible(self): 
    24742488        try: 
     
    27022716    Top = property(_getTop, _setTop, None,  
    27032717            _("The top position of the object. (int)") ) 
     2718     
     2719    Transparency = property(_getTransparency, _setTransparency, None, 
     2720            _("""Transparency level of the control; ranges from 0 (transparent) to 255 (opaque).  
     2721            Default=0. Does not currently work on Gtk/Linux.  (int)""")) 
    27042722     
    27052723    Visible = property(_getVisible, _setVisible, None, 
     
    27372755    DynamicToolTipText = makeDynamicProperty(ToolTipText) 
    27382756    DynamicTop = makeDynamicProperty(Top) 
     2757    DynamicTransparency = makeDynamicProperty(Transparency) 
    27392758    DynamicVisible = makeDynamicProperty(Visible) 
    27402759    DynamicWidth = makeDynamicProperty(Width)