dabo Commit
Revision 5294
Date: 2009-07-13 14:10:41 -0700 (Mon, 13 Jul 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5294

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

Log:
Couldn't set Choices property after already set due to calls to undefined 
Clear()
and AppendItems() functions from dDataControlMixinBase. Fixed.

The forceRecreate flag was added to _checkSizer() because without recreating the
sizer, the items would be displayed offset too high (overlapping the border).



Diff:
Modified: trunk/dabo/ui/uiwx/dRadioList.py
===================================================================
--- trunk/dabo/ui/uiwx/dRadioList.py    2009-07-12 16:01:02 UTC (rev 5293)
+++ trunk/dabo/ui/uiwx/dRadioList.py    2009-07-13 21:10:41 UTC (rev 5294)
@@ -154,16 +154,21 @@
                        ret = list(ret)
                ret.remove("Orientation")
                return ret
-               
-               
+       
+
+       def _resetChoices(self):
+               # Need to override as the base behavior calls undefined Clear() 
and AppendItems()
+               pass    
+       
+       
        def getBaseButtonClass(cls):
                return _dRadioButton
        getBaseButtonClass = classmethod(getBaseButtonClass)
        
        
-       def _checkSizer(self):
+       def _checkSizer(self, forceRecreate=False):
                """Makes sure the sizer is created before setting props that 
need it."""
-               if self.Sizer is None:
+               if self.Sizer is None or forceRecreate:
                        self.Sizer = self.SizerClass(self, orientation="v")
 
        
@@ -337,7 +342,7 @@
                
        def _setChoices(self, choices):
                if self._constructed():
-                       self._checkSizer()
+                       self._checkSizer(forceRecreate=True)
                        # Save the current values for possible re-setting 
afterwards.
                        old_length = len(self.Choices)
                        sv = (self.StringValue, self.KeyValue, 
self.PositionValue)




_______________________________________________
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/[email protected]

Reply via email to