dabo Commit
Revision 3086
Date: 2007-04-25 07:59:47 -0700 (Wed, 25 Apr 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3086

Changed:
U   branches/ed-dabo/dabo/ui/uiwx/dDockForm.py

Log:
Continued development; added more properties to the dDockPanel class.


Diff:
Modified: branches/ed-dabo/dabo/ui/uiwx/dDockForm.py
===================================================================
--- branches/ed-dabo/dabo/ui/uiwx/dDockForm.py  2007-04-24 19:26:02 UTC (rev 
3085)
+++ branches/ed-dabo/dabo/ui/uiwx/dDockForm.py  2007-04-25 14:59:47 UTC (rev 
3086)
@@ -49,7 +49,12 @@
                else:
                        kwargs["Caption"] = pcap
                self._paramType = ptype
+               self._floatingPosition = (0, 0)
+               self._floatingSize = (100, 100)
                super(_dDockPanel, self).__init__(parent, properties, 
attProperties, *args, **kwargs)
+               if self.Floating:
+                       self._floatingPosition = 
self.GetParent().GetPosition().Get()
+                       self._floatingSize = self.GetParent().GetSize().Get()
        
        
        def _setProperties(self, props):
@@ -79,6 +84,31 @@
                        self._properties["Caption"] = val
 
 
+       def _getDestroyOnClose(self):
+               return self._destroyOnClose
+
+       def _setDestroyOnClose(self, val):
+               if self._constructed():
+                       self._destroyOnClose = val
+                       self.__paneInfo.DestroyOnClose(val)
+                       self.Form._refreshState()
+               else:
+                       self._properties["DestroyOnClose"] = val
+
+
+       def _getDockable(self):
+               pi = self.__paneInfo
+               return pi.LeftDockable() or pi.RightDockable or 
pi.TopDockable() or pi.BottomDockable()
+
+       def _setDockable(self, val):
+               if self._constructed():
+                       self._dockable = val
+                       self.__paneInfo.Dockable(val)
+                       self.Form._refreshState()
+               else:
+                       self._properties["Dockable"] = val
+
+
        def _getDocked(self):
                return self.IsDocked()
 
@@ -98,8 +128,20 @@
                        self._properties["Docked"] = val
 
 
+       def _getFloatable(self):
+               return self.__paneInfo.Floatable()
+
+       def _setFloatable(self, val):
+               if self._constructed():
+                       self._floatable = val
+                       self.__paneInfo.Floatable(val)
+                       self.Form._refreshState()
+               else:
+                       self._properties["Floatable"] = val
+
+
        def _getFloating(self):
-               return self.IsFloating()
+               return self.__paneInfo.IsFloating()
 
        def _setFloating(self, val):
                if self._constructed():
@@ -117,15 +159,155 @@
                        self._properties["Floating"] = val
 
 
+       def _getFloatingBottom(self):
+               return self._floatingPosition[1] + self._floatingSize[1]
+
+       def _setFloatingBottom(self, val):
+               if self._constructed():
+                       ht = self._floatingSize[1]
+                       self._floatingPosition = (self._floatingPosition[0], 
val - ht)
+                       self.__paneInfo.FloatingPosition(self._floatingPosition)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingBottom"] = val
+
+
+       def _getFloatingHeight(self):
+               return self._floatingSize[1]
+
+       def _setFloatingHeight(self, val):
+               if self._constructed():
+                       self._floatingSize = (self._floatingSize[0], val)
+                       if self.__paneInfo.IsFloating():
+                               self.GetParent().SetSize(self._floatingSize)
+                       else:
+                               self.__paneInfo.FloatingSize(self._floatingSize)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingHeight"] = val
+
+
+       def _getFloatingLeft(self):
+               return self._floatingPosition[0]
+
+       def _setFloatingLeft(self, val):
+               if self._constructed():
+                       self._floatingPosition = (val, 
self._floatingPosition[1])
+                       self.__paneInfo.FloatingPosition(self._floatingPosition)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingLeft"] = val
+
+
+       def _getFloatingPosition(self):
+               return self._floatingPosition
+
+       def _setFloatingPosition(self, val):
+               if self._constructed():
+                       self._floatingPosition = val
+                       self.__paneInfo.FloatingPosition(val)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingPosition"] = val
+
+
+       def _getFloatingRight(self):
+               return self._floatingPosition[0] + self._floatingSize[0]
+
+       def _setFloatingRight(self, val):
+               if self._constructed():
+                       wd = self._floatingSize[0]
+                       self._floatingPosition = (val - wd, 
self._floatingPosition[1])
+                       self.__paneInfo.FloatingPosition(self._floatingPosition)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingRight"] = val
+
+
+       def _getFloatingSize(self):
+               return self._floatingSize
+
+       def _setFloatingSize(self, val):
+               if self._constructed():
+                       self._floatingSize = val
+                       if self.__paneInfo.IsFloating():
+                               self.GetParent().SetSize(self._floatingSize)
+                       else:
+                               self.__paneInfo.FloatingSize(self._floatingSize)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingSize"] = val
+
+
+       def _getFloatingTop(self):
+               return self._floatingPosition[1]
+
+       def _setFloatingTop(self, val):
+               if self._constructed():
+                       self._floatingPosition = (self._floatingPosition[0], 
val)
+                       self.__paneInfo.FloatingPosition(self._floatingPosition)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingTop"] = val
+
+
+       def _getFloatingWidth(self):
+               return self._floatingSize[0]
+
+       def _setFloatingWidth(self, val):
+               if self._constructed():
+                       self._floatingSize = (val, self._floatingSize[1])
+                       if self.__paneInfo.IsFloating():
+                               self.GetParent().SetSize(self._floatingSize)
+                       else:
+                               self.__paneInfo.FloatingSize(self._floatingSize)
+                       self.Form._refreshState()
+               else:
+                       self._properties["FloatingWidth"] = val
+
+
        Caption = property(_getCaption, _setCaption, None,
                        _("Text that appears in the title bar  (str)"))
        
+       DestroyOnClose = property(_getDestroyOnClose, _setDestroyOnClose, None,
+                       _("When the panel's Close button is clicked, does the 
panel get destroyed (True) or just hidden (False, default)  (bool)"))
+
+       Dockable = property(_getDockable, _setDockable, None,
+                       _("Can the panel be docked to the form? Default=True  
(bool)"))
+
        Docked = property(_getDocked, _setDocked, None,
                        _("Determines whether the pane is floating (False) or 
docked (True)  (bool)"))
                        
+       Floatable = property(_getFloatable, _setFloatable, None,
+                       _("Can the panel be undocked from the form and float 
independently? Default=True  (bool)"))
+
        Floating = property(_getFloating, _setFloating, None,
                        _("Determines whether the pane is floating (True) or 
docked (False)  (bool)"))
        
+       FloatingBottom = property(_getFloatingBottom, _setFloatingBottom, None,
+                       _("Bottom coordinate of the panel when floating  
(int)"))
+
+       FloatingHeight = property(_getFloatingHeight, _setFloatingHeight, None,
+                       _("Height of the panel when floating  (int)"))
+
+       FloatingLeft = property(_getFloatingLeft, _setFloatingLeft, None,
+                       _("Left coordinate of the panel when floating  (int)"))
+
+       FloatingPosition = property(_getFloatingPosition, _setFloatingPosition, 
None,
+                       _("Position of the panel when floating  (2-tuple of 
ints)"))
+
+       FloatingRight = property(_getFloatingRight, _setFloatingRight, None,
+                       _("Right coordinate of the panel when floating  (int)"))
+
+       FloatingSize = property(_getFloatingSize, _setFloatingSize, None,
+                       _("Size of the panel when floating  (2-tuple of ints)"))
+
+       FloatingTop = property(_getFloatingTop, _setFloatingTop, None,
+                       _("Top coordinate of the panel when floating  (int)"))
+
+       FloatingWidth = property(_getFloatingWidth, _setFloatingWidth, None,
+                       _("Width of the panel when floating  (int)"))
+
                
 
 class dDockForm(dabo.ui.dForm):





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to