commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9172 - trunk/gnue-forms/src/uidrivers/curses/widgets


From: johannes
Subject: [gnue] r9172 - trunk/gnue-forms/src/uidrivers/curses/widgets
Date: Mon, 18 Dec 2006 09:28:49 -0600 (CST)

Author: johannes
Date: 2006-12-18 09:28:49 -0600 (Mon, 18 Dec 2006)
New Revision: 9172

Modified:
   trunk/gnue-forms/src/uidrivers/curses/widgets/_base.py
   trunk/gnue-forms/src/uidrivers/curses/widgets/grid.py
   trunk/gnue-forms/src/uidrivers/curses/widgets/gridline.py
Log:
Proper horizontal offset


Modified: trunk/gnue-forms/src/uidrivers/curses/widgets/_base.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/curses/widgets/_base.py      2006-12-18 
14:55:09 UTC (rev 9171)
+++ trunk/gnue-forms/src/uidrivers/curses/widgets/_base.py      2006-12-18 
15:28:49 UTC (rev 9172)
@@ -157,7 +157,6 @@
             if func and func(key):
                 return
 
-        gDebug(2, "Key: %r" % key)
         UIWidget._keypress(self, key)
 
 
@@ -462,7 +461,8 @@
         max_label= max([i[2] for i in self._hints_.values()])
 
         if self.vertical:
-            child.left = self.left + self._horizontal_offset_() + max_label + 1
+            add = max_label <> 0 and (max_label + 1) or 0
+            child.left = self.left + self._horizontal_offset_() + add
             child.top = last_y + self._vertical_offset_()
 
             result = (0, cheight)

Modified: trunk/gnue-forms/src/uidrivers/curses/widgets/grid.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/curses/widgets/grid.py       2006-12-18 
14:55:09 UTC (rev 9171)
+++ trunk/gnue-forms/src/uidrivers/curses/widgets/grid.py       2006-12-18 
15:28:49 UTC (rev 9172)
@@ -62,8 +62,6 @@
         self.__max = self._gfObject.rows
         self.__visible = self.__max
 
-        gDebug(2, "building GRID: %s" % spacer)
-        
         return None
 
 
@@ -85,7 +83,6 @@
         self.height = height
 
         # The header rows are not available to the grid's children
-        i_width = width
         i_height = height - len(self._children)
 
         self._repaint_()
@@ -94,7 +91,7 @@
             child.left = self.left
             child.top = self.top + row
 
-            child.set_size_and_fit(i_width, i_height)
+            child.set_size_and_fit(width, i_height)
 
 
     # -------------------------------------------------------------------------
@@ -110,7 +107,6 @@
         minw = max([i[0] for i in hints])
         minh = len(self._children) + self.__visible + 1
 
-        gDebug(2, "HINTS: %s %s, 0, %s" % (minw, minh, self.stretch))
         return (minw, minh, 0, self.stretch)
 
 

Modified: trunk/gnue-forms/src/uidrivers/curses/widgets/gridline.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/curses/widgets/gridline.py   2006-12-18 
14:55:09 UTC (rev 9171)
+++ trunk/gnue-forms/src/uidrivers/curses/widgets/gridline.py   2006-12-18 
15:28:49 UTC (rev 9172)
@@ -47,34 +47,36 @@
         _base.ManagedBox._create_widget_(self, event, spacer)
         self._parent = event.container
         self._container = self._parent
-        gDebug(2, "Building LINE %s" % spacer)
         
         return self
 
 
     # -------------------------------------------------------------------------
-    # Virtual methods
+    # Get the size hints for an entry
     # -------------------------------------------------------------------------
 
-    def _decoration_size_(self):
-        return (2, 0)
+    def get_size_hints(self, vertical=None):
 
-    def _add_decoration_(self):
-        pass
+        result = _base.ManagedBox.get_size_hints(self, False)
+        return (result[0], 1, 0, 0)
 
+
     # -------------------------------------------------------------------------
-    # Get the size hints for an entry
+    # Virtual methods
     # -------------------------------------------------------------------------
 
-    def get_size_hints(self, vertical=None):
+    def _add_decoration_(self):
+        pass
 
-        result = _base.ManagedBox.get_size_hints(self, False)
-        return (result[0], 1, 0, 0)
+    # -------------------------------------------------------------------------
 
     def _vertical_offset_(self):
+
         result = len(self.getParent()._children) - 1
         return result
 
+    # -------------------------------------------------------------------------
+
     def _add_label_(self, child, index):
         
         label = getattr(child._gfObject, 'label', '')





reply via email to

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