Changeset 3086

Show
Ignore:
Timestamp:
04/25/07 07:59:47 (2 years ago)
Author:
ed
Message:

Continued development; added more properties to the dDockPanel class.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ed-dabo/dabo/ui/uiwx/dDockForm.py

    r3075 r3086  
    5050            kwargs["Caption"] = pcap 
    5151        self._paramType = ptype 
     52        self._floatingPosition = (0, 0) 
     53        self._floatingSize = (100, 100) 
    5254        super(_dDockPanel, self).__init__(parent, properties, attProperties, *args, **kwargs) 
     55        if self.Floating: 
     56            self._floatingPosition = self.GetParent().GetPosition().Get() 
     57            self._floatingSize = self.GetParent().GetSize().Get() 
    5358     
    5459     
     
    7883        else: 
    7984            self._properties["Caption"] = val 
     85 
     86 
     87    def _getDestroyOnClose(self): 
     88        return self._destroyOnClose 
     89 
     90    def _setDestroyOnClose(self, val): 
     91        if self._constructed(): 
     92            self._destroyOnClose = val 
     93            self.__paneInfo.DestroyOnClose(val) 
     94            self.Form._refreshState() 
     95        else: 
     96            self._properties["DestroyOnClose"] = val 
     97 
     98 
     99    def _getDockable(self): 
     100        pi = self.__paneInfo 
     101        return pi.LeftDockable() or pi.RightDockable or pi.TopDockable() or pi.BottomDockable() 
     102 
     103    def _setDockable(self, val): 
     104        if self._constructed(): 
     105            self._dockable = val 
     106            self.__paneInfo.Dockable(val) 
     107            self.Form._refreshState() 
     108        else: 
     109            self._properties["Dockable"] = val 
    80110 
    81111 
     
    99129 
    100130 
     131    def _getFloatable(self): 
     132        return self.__paneInfo.Floatable() 
     133 
     134    def _setFloatable(self, val): 
     135        if self._constructed(): 
     136            self._floatable = val 
     137            self.__paneInfo.Floatable(val) 
     138            self.Form._refreshState() 
     139        else: 
     140            self._properties["Floatable"] = val 
     141 
     142 
    101143    def _getFloating(self): 
    102         return self.IsFloating() 
     144        return self.__paneInfo.IsFloating() 
    103145 
    104146    def _setFloating(self, val): 
     
    118160 
    119161 
     162    def _getFloatingBottom(self): 
     163        return self._floatingPosition[1] + self._floatingSize[1] 
     164 
     165    def _setFloatingBottom(self, val): 
     166        if self._constructed(): 
     167            ht = self._floatingSize[1] 
     168            self._floatingPosition = (self._floatingPosition[0], val - ht) 
     169            self.__paneInfo.FloatingPosition(self._floatingPosition) 
     170            self.Form._refreshState() 
     171        else: 
     172            self._properties["FloatingBottom"] = val 
     173 
     174 
     175    def _getFloatingHeight(self): 
     176        return self._floatingSize[1] 
     177 
     178    def _setFloatingHeight(self, val): 
     179        if self._constructed(): 
     180            self._floatingSize = (self._floatingSize[0], val) 
     181            if self.__paneInfo.IsFloating(): 
     182                self.GetParent().SetSize(self._floatingSize) 
     183            else: 
     184                self.__paneInfo.FloatingSize(self._floatingSize) 
     185            self.Form._refreshState() 
     186        else: 
     187            self._properties["FloatingHeight"] = val 
     188 
     189 
     190    def _getFloatingLeft(self): 
     191        return self._floatingPosition[0] 
     192 
     193    def _setFloatingLeft(self, val): 
     194        if self._constructed(): 
     195            self._floatingPosition = (val, self._floatingPosition[1]) 
     196            self.__paneInfo.FloatingPosition(self._floatingPosition) 
     197            self.Form._refreshState() 
     198        else: 
     199            self._properties["FloatingLeft"] = val 
     200 
     201 
     202    def _getFloatingPosition(self): 
     203        return self._floatingPosition 
     204 
     205    def _setFloatingPosition(self, val): 
     206        if self._constructed(): 
     207            self._floatingPosition = val 
     208            self.__paneInfo.FloatingPosition(val) 
     209            self.Form._refreshState() 
     210        else: 
     211            self._properties["FloatingPosition"] = val 
     212 
     213 
     214    def _getFloatingRight(self): 
     215        return self._floatingPosition[0] + self._floatingSize[0] 
     216 
     217    def _setFloatingRight(self, val): 
     218        if self._constructed(): 
     219            wd = self._floatingSize[0] 
     220            self._floatingPosition = (val - wd, self._floatingPosition[1]) 
     221            self.__paneInfo.FloatingPosition(self._floatingPosition) 
     222            self.Form._refreshState() 
     223        else: 
     224            self._properties["FloatingRight"] = val 
     225 
     226 
     227    def _getFloatingSize(self): 
     228        return self._floatingSize 
     229 
     230    def _setFloatingSize(self, val): 
     231        if self._constructed(): 
     232            self._floatingSize = val 
     233            if self.__paneInfo.IsFloating(): 
     234                self.GetParent().SetSize(self._floatingSize) 
     235            else: 
     236                self.__paneInfo.FloatingSize(self._floatingSize) 
     237            self.Form._refreshState() 
     238        else: 
     239            self._properties["FloatingSize"] = val 
     240 
     241 
     242    def _getFloatingTop(self): 
     243        return self._floatingPosition[1] 
     244 
     245    def _setFloatingTop(self, val): 
     246        if self._constructed(): 
     247            self._floatingPosition = (self._floatingPosition[0], val) 
     248            self.__paneInfo.FloatingPosition(self._floatingPosition) 
     249            self.Form._refreshState() 
     250        else: 
     251            self._properties["FloatingTop"] = val 
     252 
     253 
     254    def _getFloatingWidth(self): 
     255        return self._floatingSize[0] 
     256 
     257    def _setFloatingWidth(self, val): 
     258        if self._constructed(): 
     259            self._floatingSize = (val, self._floatingSize[1]) 
     260            if self.__paneInfo.IsFloating(): 
     261                self.GetParent().SetSize(self._floatingSize) 
     262            else: 
     263                self.__paneInfo.FloatingSize(self._floatingSize) 
     264            self.Form._refreshState() 
     265        else: 
     266            self._properties["FloatingWidth"] = val 
     267 
     268 
    120269    Caption = property(_getCaption, _setCaption, None, 
    121270            _("Text that appears in the title bar  (str)")) 
    122271     
     272    DestroyOnClose = property(_getDestroyOnClose, _setDestroyOnClose, None, 
     273            _("When the panel's Close button is clicked, does the panel get destroyed (True) or just hidden (False, default)  (bool)")) 
     274 
     275    Dockable = property(_getDockable, _setDockable, None, 
     276            _("Can the panel be docked to the form? Default=True  (bool)")) 
     277 
    123278    Docked = property(_getDocked, _setDocked, None, 
    124279            _("Determines whether the pane is floating (False) or docked (True)  (bool)")) 
    125280             
     281    Floatable = property(_getFloatable, _setFloatable, None, 
     282            _("Can the panel be undocked from the form and float independently? Default=True  (bool)")) 
     283 
    126284    Floating = property(_getFloating, _setFloating, None, 
    127285            _("Determines whether the pane is floating (True) or docked (False)  (bool)")) 
    128286     
     287    FloatingBottom = property(_getFloatingBottom, _setFloatingBottom, None, 
     288            _("Bottom coordinate of the panel when floating  (int)")) 
     289 
     290    FloatingHeight = property(_getFloatingHeight, _setFloatingHeight, None, 
     291            _("Height of the panel when floating  (int)")) 
     292 
     293    FloatingLeft = property(_getFloatingLeft, _setFloatingLeft, None, 
     294            _("Left coordinate of the panel when floating  (int)")) 
     295 
     296    FloatingPosition = property(_getFloatingPosition, _setFloatingPosition, None, 
     297            _("Position of the panel when floating  (2-tuple of ints)")) 
     298 
     299    FloatingRight = property(_getFloatingRight, _setFloatingRight, None, 
     300            _("Right coordinate of the panel when floating  (int)")) 
     301 
     302    FloatingSize = property(_getFloatingSize, _setFloatingSize, None, 
     303            _("Size of the panel when floating  (2-tuple of ints)")) 
     304 
     305    FloatingTop = property(_getFloatingTop, _setFloatingTop, None, 
     306            _("Top coordinate of the panel when floating  (int)")) 
     307 
     308    FloatingWidth = property(_getFloatingWidth, _setFloatingWidth, None, 
     309            _("Width of the panel when floating  (int)")) 
     310 
    129311         
    130312