dabo Commit
Revision 2980
Date: 2007-03-25 11:38:23 -0700 (Sun, 25 Mar 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/2980

Changed:
U   trunk/dabo/ui/uiwx/dSlider.py

Log:
Added the 'Continuous' property. This allows for dynamic response to the slider 
being dragged. When it is False (the default), the Hit event is only raised 
when the thumb control is released.


Diff:
Modified: trunk/dabo/ui/uiwx/dSlider.py
===================================================================
--- trunk/dabo/ui/uiwx/dSlider.py       2007-03-25 14:45:06 UTC (rev 2979)
+++ trunk/dabo/ui/uiwx/dSlider.py       2007-03-25 18:38:23 UTC (rev 2980)
@@ -37,6 +37,26 @@
                                
        # Property get/set/del methods follow. Scroll to bottom to see the 
property
        # definitions themselves.
+       def _getContinuous(self):
+               try:
+                       ret = self._continuous
+               except AttributeError:
+                       ret = self._continuous = False
+               return ret
+
+       def _setContinuous(self, val):
+               if self._constructed():
+                       self._continuous = val
+                       self.Unbind(wx.EVT_SCROLL)
+                       self.Unbind(wx.EVT_SCROLL_THUMBRELEASE)
+                       if val:
+                               self.Bind(wx.EVT_SCROLL, self._onWxHit)
+                       else:
+                               self.Bind(wx.EVT_SCROLL_THUMBRELEASE, 
self._onWxHit)
+               else:
+                       self._properties["Continuous"] = val
+
+
        def _getMax(self):
                return self.GetMax()
 
@@ -88,6 +108,10 @@
 
 
        # Property definitions:
+       Continuous = property(_getContinuous, _setContinuous, None,
+                       _("""When True, the Hit event is raised as the slider 
moves. When False (default),
+                       it is only raised when the thumb control is released.  
(bool)"""))
+       
        Max = property(_getMax, _setMax, None, 
                        _("Specifies the maximum value for the Slider. 
Default=100  (int)"))
 




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to