dabo Commit
Revision 6609
Date: 2011-05-28 05:07:17 -0700 (Sat, 28 May 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6609

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

Log:
The ButtonShape property added.

Diff:
Modified: trunk/dabo/ui/uiwx/dBorderlessButton.py
===================================================================
--- trunk/dabo/ui/uiwx/dBorderlessButton.py     2011-05-28 00:30:02 UTC (rev 
6608)
+++ trunk/dabo/ui/uiwx/dBorderlessButton.py     2011-05-28 12:07:17 UTC (rev 
6609)
@@ -46,6 +46,10 @@
                # On some platforms, we need to add some 'breathing room'
                # around the bitmap image in order for it to appear correctly
                self._bmpBorder = 10
+               self._buttonShape = self._extractKey((kwargs, properties, 
attProperties),
+                       "ButtonShape", "Normal")
+               kwargs["style"] = kwargs.get("style", 0) | \
+                       {"n": platebtn.PB_STYLE_DEFAULT, "s": 
platebtn.PB_STYLE_SQUARE}[self._buttonShape[0].lower()]
 
                cm.dControlMixin.__init__(self, preClass, parent, 
properties=properties,
                                attProperties=attProperties, *args, **kwargs)
@@ -76,6 +80,10 @@
                        self._properties["BackColorHover"] = val
 
 
+       def _getButtonShape(self):
+               return {"n": "Normal", "s": "Square"}[self._buttonShape[0]]
+
+
        def _getCancelButton(self):
                # need to implement
                return False
@@ -133,6 +141,12 @@
        Bitmap = property(_getNormalBitmap, None, None,
                _("""The bitmap normally displayed on the button.  
(wx.Bitmap)"""))
 
+       ButtonShape = property(_getButtonShape, None,
+               _("""Shape of the button. (str)
+               
+               Normal  :       button with rounded corners. (default)
+               Square  :       button with square corners."""))
+
        Picture = property(_getNormalPicture, _setNormalPicture, None,
                _("""Specifies the image normally displayed on the button. 
(str)"""))
 



_______________________________________________
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