Changeset 2900

Show
Ignore:
Timestamp:
03/10/07 10:55:52 (2 years ago)
Author:
ed
Message:

Added the SashPercent? property.

Files:

Legend:

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

    r2867 r2900  
    356356         
    357357 
     358    def _getSashPercent(self): 
     359        pos = self._getSashPosition() 
     360        sz = {"V": self.Width, "H": self.Height}[self.Orientation[0]] 
     361        if sz: 
     362            ret = 100 * (float(pos) / float(sz)) 
     363        else: 
     364            ret = 0 
     365        return ret 
     366 
     367    def _setSashPercent(self, val): 
     368        if self._constructed(): 
     369            if 0 <= val <= 100: 
     370                sz = {"V": self.Width, "H": self.Height}[self.Orientation[0]] 
     371                self._setSashPosition(sz * (val/100.0)) 
     372        else: 
     373            self._properties["SashPercent"] = val 
     374 
     375 
    358376    def _getSashPosition(self): 
    359377        if self.IsSplit(): 
     
    415433            Default=dPanel  (dPanel)""")) 
    416434             
     435    SashPercent = property(_getSashPercent, _setSashPercent, None, 
     436            _("Percentage of the split window given to Panel1. Range=0-100  (float)")) 
     437     
    417438    SashPosition = property(_getSashPosition, _setSashPosition, None, 
    418439            _("Position of the sash when the window is split.  (int)"))