commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9060 - trunk/gnue-forms/src/uidrivers/wx26/widgets


From: reinhard
Subject: [gnue] r9060 - trunk/gnue-forms/src/uidrivers/wx26/widgets
Date: Thu, 23 Nov 2006 07:36:09 -0600 (CST)

Author: reinhard
Date: 2006-11-23 07:36:09 -0600 (Thu, 23 Nov 2006)
New Revision: 9060

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/widgets/_base.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/form.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/page.py
Log:
Changed border sizes to match GNOME Human Interface Guidline.


Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/_base.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/_base.py        2006-11-23 
10:17:50 UTC (rev 9059)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/_base.py        2006-11-23 
13:36:09 UTC (rev 9060)
@@ -31,7 +31,7 @@
 from gnue.forms.GFObjects import GFTabStop, GFBox, GFScrollBar, GFLabel
 from gnue.forms.uidrivers._base.widgets._base import UIWidget
 
-__all__ = ['UIHelper', 'ManagedBox', 'create_gridbag']
+__all__ = ['UIHelper', 'ManagedBox']
 
 # =============================================================================
 # This class implements the common behaviour of wx 2.6 widgets
@@ -142,7 +142,6 @@
             widget.GetContainingSizer().Layout()
 
 
-
     # -------------------------------------------------------------------------
     # Add a widget into a vertical box sizer
     # -------------------------------------------------------------------------
@@ -266,29 +265,7 @@
         raise NotImplementedError("No implementation for %s (%s/%s)" \
                 % (self.__class__, event.container, spacer))
 
-# =============================================================================
-# Create a new GridBagSizer
-# =============================================================================
 
-def create_gridbag(ecs=(5, 10), gap=True):
-    """
-    Create a new GridBagSizer with a given size for empty cells.  Horizontal
-    and vertical gap is set depending on the OS.
-
-    @param ecs: tuple with the EmptyCellSize
-    @returns: wx.GridBagSizer instance
-    """
-
-    if 'wxMac' in wx.PlatformInfo:
-        hgap, vgap = 4, 4
-    else:
-        hgap, vgap = 2, 2
-
-    result = wx.GridBagSizer(hgap, vgap)
-    result.SetEmptyCellSize(ecs)
-
-    return result
-
 # =============================================================================
 # Base class for managed boxes (vbox/hbox)
 # =============================================================================
@@ -342,7 +319,9 @@
         if self._gfObject.get_block() is not None:
             self._container.Bind(wx.EVT_MOUSEWHEEL, self.__on_mousewheel)
 
-        self._sizer = create_gridbag()
+        # Space between lines is 6 pixels and between columns is 12 pixel
+        # according to GNOME Human Interface Guidlines.
+        self._sizer = wx.GridBagSizer(6, 12)
 
         self._entry_pos = self.__use_second_one() and 2 or 1
 
@@ -356,14 +335,23 @@
         if self._gfObject.label is not None:
             box_title = wx.StaticBox(self._container, -1, self._gfObject.label)
             box = wx.StaticBoxSizer(box_title, wx.VERTICAL)
-            box.Add(self._sizer, 1, wx.EXPAND | wx.ALL, 5)
+            # Border inside the box is 6 pixel according to GNOME Human
+            # Interface Guidlines.
+            box.Add(self._sizer, 1, wx.EXPAND | wx.ALL, 6)
 
             add = box
+
+            # Add another 6 pixel above and below the box (additionally to the
+            # 6 pixel horizontal gap that exist anyway) according to GNOME
+            # Human Interface Guidlines.
+            border = 6
         else:
             add = self._sizer
+            # "Invisible" boxes don't need any border.
+            border = 0
 
-        self._container.GetSizer().Add(add, 1, wx.EXPAND | wx.TOP | \
-                wx.BOTTOM, 6)
+        self._container.GetSizer().Add(add, 1, wx.EXPAND | wx.TOP | wx.BOTTOM,
+                border)
 
         self.widget = self._container
         self.getParent().add_widgets(self, spacer)

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-23 
10:17:50 UTC (rev 9059)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2006-11-23 
13:36:09 UTC (rev 9060)
@@ -70,7 +70,6 @@
         if (maxs != wx.DefaultSize):
             self.widget.SetMaxSize(maxs)
 
-
         owner.add_widgets(self, spacer, self.__border)
 
         if self.in_grid:

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/form.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/form.py 2006-11-23 10:17:50 UTC 
(rev 9059)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/form.py 2006-11-23 13:36:09 UTC 
(rev 9060)
@@ -157,7 +157,9 @@
         if self._form._layout.tabbed != 'none':
             style = self._TAB_STYLE[self._form._layout.tabbed]
             self._container = wx.Notebook(base_panel, -1, style = style)
-            base_sizer.Add(self._container, 1, wx.EXPAND | wx.ALL, 6)
+            # The border between the edge of the form and the page is 12 pixel
+            # according to the GNOME Human Interface Guidlines.
+            base_sizer.Add(self._container, 1, wx.EXPAND | wx.ALL, 12)
         else:
             self._container = base_panel
 

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/page.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/page.py 2006-11-23 10:17:50 UTC 
(rev 9059)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/page.py 2006-11-23 13:36:09 UTC 
(rev 9060)
@@ -110,7 +110,9 @@
         sizer = self._container.GetSizer()
 
         if self.managed:
-            sizer.Add(item, ui_widget.stretch, wx.EXPAND | wx.ALL, 4)
+            # The border between the edge of the page and the nearest control
+            # is 12 pixel according to GNOME Human Interface Guidlines.
+            sizer.Add(item, ui_widget.stretch, wx.EXPAND | wx.ALL, 12)
         else:
             flags = wx.ALIGN_CENTER | wx.EXPAND
             if not ui_widget.growable:





reply via email to

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