commit-gnue
[Top][All Lists]
Advanced

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

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


From: johannes
Subject: [gnue] r8644 - trunk/gnue-forms/src/uidrivers/wx26/widgets
Date: Thu, 31 Aug 2006 07:24:46 -0500 (CDT)

Author: johannes
Date: 2006-08-31 07:24:45 -0500 (Thu, 31 Aug 2006)
New Revision: 8644

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py
Log:
Use the proper height for non-managed layouts


Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py    2006-08-30 
09:48:29 UTC (rev 8643)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py    2006-08-31 
12:24:45 UTC (rev 8644)
@@ -39,7 +39,8 @@
 
       parent = event.container
 
-      self.widget = wx.ScrollBar(parent, -1, style=wx.SB_VERTICAL)
+      csize = self.get_default_size()
+      self.widget = wx.ScrollBar(parent, -1, size=csize, style=wx.SB_VERTICAL)
       self.getParent().add_widgets(self, spacer)
 
       (crec, recs, self.pageSize) = self._gfObject.get_record_and_page_count()
@@ -51,6 +52,27 @@
 
 
   # ---------------------------------------------------------------------------
+  # Get the default size of a scrollbar
+  # ---------------------------------------------------------------------------
+
+  def _get_default_size_(self):
+      """
+      Get the default widget size.
+
+      For positioned layout the default width is the product of the
+      character-width and the avarage cellWidth. The default height is set to
+      -1, which means it will be set by the sizers.
+
+      @returns: tuple with default size
+      """
+
+      if not self.managed:
+          return (-1, self._uiDriver.cellHeight * self.chr_h)
+      else:
+          return (-1, -1)
+
+
+  # ---------------------------------------------------------------------------
   # adjust the scrollbar to a new position
   # ---------------------------------------------------------------------------
 





reply via email to

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