dabo Commit
Revision 2324
Date: 2006-10-09 17:52:39 -0700 (Mon, 09 Oct 2006)
Author: paul

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

Log:
The ButtonSpacing for dRadioList is about 9 units tighter on Windows 
versus Linux. I'm not sure if this is actually an issue with sizers,
or specific to radio buttons, but this hack fixes my immediate problem.

Reset the default ButtonSpacing to 5, which now looks ideal on both
Linux and Windows. Still need to test Mac.


Diff:
Modified: trunk/dabo/ui/uiwx/dRadioList.py
===================================================================
--- trunk/dabo/ui/uiwx/dRadioList.py    2006-10-10 00:51:21 UTC (rev 2323)
+++ trunk/dabo/ui/uiwx/dRadioList.py    2006-10-10 00:52:39 UTC (rev 2324)
@@ -1,3 +1,4 @@
+import sys
 import wx
 import dabo
 if __name__ == "__main__":
@@ -85,7 +86,7 @@
                self._selpos = 0
                # Default spacing between buttons. Can be changed with the
                # 'ButtonSpacing' property.
-               self._buttonSpacing = 0
+               self._buttonSpacing = 5
 
                cim.dControlItemMixin.__init__(self, preClass, parent, 
properties, *args, **kwargs)
 
@@ -195,7 +196,15 @@
                elif self.ValueMode == "key":
                        self.showKey(item, val)
                
-               
+
+       def _getFudgedButtonSpacing(self):
+               val = self._buttonSpacing               
+               if "linux" in sys.platform:
+                       # Buttons too widely spaced on Linux. Fudge it down...
+                       val -= 9
+               return val
+
+
        # Property get/set/del methods follow. Scroll to bottom to see the 
property
        # definitions themselves.
        def _getButtonSpacing(self):
@@ -203,8 +212,9 @@
                
        def _setButtonSpacing(self, val):
                self._buttonSpacing = val
+
                for itm in self.Sizer.ChildSpacers:
-                       self.Sizer.setItemProp(itm, "Spacing", val)
+                       self.Sizer.setItemProp(itm, "Spacing", 
self._getFudgedButtonSpacing())
                try:
                        self.Parent.layout()
                except:
@@ -249,7 +259,7 @@
                                        else:
                                                style = wx.RB_GROUP
                                else:
-                                       
self.Sizer.appendSpacer(self._buttonSpacing)
+                                       
self.Sizer.appendSpacer(self._getFudgedButtonSpacing())
                                btn = _dRadioButton(self, Caption=itm, 
style=style)
                                self.Sizer.append(btn)
                                self._items.append(btn)




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

Reply via email to