commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r10131 - in trunk/gnue-forms/src: . uidrivers/wx/widgets


From: reinhard
Subject: [gnue] r10131 - in trunk/gnue-forms/src: . uidrivers/wx/widgets
Date: Wed, 16 Dec 2009 13:07:58 -0600 (CST)

Author: reinhard
Date: 2009-12-16 13:07:58 -0600 (Wed, 16 Dec 2009)
New Revision: 10131

Modified:
   trunk/gnue-forms/src/GFConfig.py
   trunk/gnue-forms/src/uidrivers/wx/widgets/gridline.py
Log:
Use #RRGGBB instead of RRGGBB for colors because the former is automatically
parsed by UI toolkits.


Modified: trunk/gnue-forms/src/GFConfig.py
===================================================================
--- trunk/gnue-forms/src/GFConfig.py    2009-12-16 18:25:59 UTC (rev 10130)
+++ trunk/gnue-forms/src/GFConfig.py    2009-12-16 19:07:58 UTC (rev 10131)
@@ -201,7 +201,7 @@
                  + 'Format is either "RRGGBB", each digit being hexadecimal '
                  + 'or a color name as specified in wx.lib.colourdb.',
     'Typecast'   : GTypecast.text,
-    'Default'    : 'F0F8F4' },
+    'Default'    : '#F0F8F4' },
 
   { 'Name'       : 'grid_color_odd',
     'Type'       : 'Setting',
@@ -210,7 +210,7 @@
                  + 'Format is either "RRGGBB", each digit being hexadecimal '
                  + 'or a color name as specified in wx.lib.colourdb.',
     'Typecast'   : GTypecast.text,
-    'Default'    : 'E0E8E4' },
+    'Default'    : '#E0E8E4' },
 
   { 'Name'       : 'DropdownSeparator',
     'Type'       : 'Setting',

Modified: trunk/gnue-forms/src/uidrivers/wx/widgets/gridline.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/widgets/gridline.py       2009-12-16 
18:25:59 UTC (rev 10130)
+++ trunk/gnue-forms/src/uidrivers/wx/widgets/gridline.py       2009-12-16 
19:07:58 UTC (rev 10131)
@@ -91,8 +91,7 @@
             else:
                 name = 'grid_color_odd'
 
-            color = self.__load_color_from_string(gConfigForms(name))
-            panel.SetBackgroundColour(color)
+            panel.SetBackgroundColour(gConfigForms(name))
 
             self._columns.setdefault(spacer, []).append(panel)
 
@@ -102,20 +101,6 @@
 
 
     # -------------------------------------------------------------------------
-    # Load the given colorname form the database or parse it as hex-rgb-string
-    # -------------------------------------------------------------------------
-
-    def __load_color_from_string(self, value):
-
-        result = wx.TheColourDatabase.FindColour(value)
-        if not result.Ok():
-            (red, green, blue) = value[:2], value[2:4], value[4:6]
-            result = wx.Colour(int(red, 16), int(green, 16), int(blue, 16))
-
-        return result
-
-
-    # -------------------------------------------------------------------------
     # Add an UI widget to the Grid container
     # -------------------------------------------------------------------------
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]