[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r9477 - trunk/gnue-forms/src/uidrivers/wx26/widgets
From: |
reinhard |
Subject: |
[gnue] r9477 - trunk/gnue-forms/src/uidrivers/wx26/widgets |
Date: |
Tue, 10 Apr 2007 02:09:13 -0500 (CDT) |
Author: reinhard
Date: 2007-04-10 02:09:13 -0500 (Tue, 10 Apr 2007)
New Revision: 9477
Modified:
trunk/gnue-forms/src/uidrivers/wx26/widgets/box.py
trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py
Log:
Make sure that a scrollbar is growable.
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/box.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/box.py 2007-04-10 06:59:37 UTC
(rev 9476)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/box.py 2007-04-10 07:09:13 UTC
(rev 9477)
@@ -113,9 +113,9 @@
"""
item = ui_widget.widget
- flags = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND
+ flags = wx.EXPAND
- if not ui_widget.growable:
+ if not ui_widget.is_growable():
box = wx.BoxSizer(wx.HORIZONTAL)
box.Add(item, 1, wx.ALIGN_CENTER_VERTICAL)
item = box
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py 2007-04-10
06:59:37 UTC (rev 9476)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/scrollbar.py 2007-04-10
07:09:13 UTC (rev 9477)
@@ -31,63 +31,74 @@
class UIScrollBar (_base.UIHelper):
- # ---------------------------------------------------------------------------
- # Create the wx widget
- # ---------------------------------------------------------------------------
+ # -------------------------------------------------------------------------
+ # Create the wx widget
+ # -------------------------------------------------------------------------
- def _create_widget_ (self, event, spacer):
+ def _create_widget_ (self, event, spacer):
- parent = event.container
+ parent = event.container
- csize = self.get_default_size()
- self.widget = wx.ScrollBar(parent, -1, size=csize, style=wx.SB_VERTICAL)
- self.getParent().add_widgets(self, spacer)
+ csize = self.get_default_size()
+ self.widget = wx.ScrollBar(parent, -1, size=csize,
+ style=wx.SB_VERTICAL)
+ self.getParent().add_widgets(self, spacer)
- wx.EVT_COMMAND_SCROLL(self.widget, self.widget.GetId(), self.__on_scroll)
+ wx.EVT_COMMAND_SCROLL(self.widget, self.widget.GetId(),
+ self.__on_scroll)
- return self.widget
+ return self.widget
- # ---------------------------------------------------------------------------
- # Handle changes of the adjustment's value
- # ---------------------------------------------------------------------------
+ # -------------------------------------------------------------------------
+ # Handle changes of the adjustment's value
+ # -------------------------------------------------------------------------
- def __on_scroll(self, event):
+ def __on_scroll(self, event):
- self._gfObject._event_scrollToRecord (event.GetPosition ())
- event.Skip ()
+ self._gfObject._event_scrollToRecord(event.GetPosition ())
+ event.Skip()
- # ---------------------------------------------------------------------------
- # Get the default size of a scrollbar
- # ---------------------------------------------------------------------------
+ # -------------------------------------------------------------------------
+ # Get the default size of a scrollbar
+ # -------------------------------------------------------------------------
- def _get_default_size_(self):
- """
- Get the default widget size.
+ 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.
+ 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
- """
+ @returns: tuple with default size
+ """
- if not self.managed:
- return (-1, self._uiDriver.cellHeight * self.chr_h)
- else:
- return (-1, -1)
+ if not self.managed:
+ return (-1, self._uiDriver.cellHeight * self.chr_h)
+ else:
+ return (-1, -1)
- # ---------------------------------------------------------------------------
- # adjust the scrollbar to a new position
- # ---------------------------------------------------------------------------
+ # -------------------------------------------------------------------------
+ # adjust the scrollbar to a new position
+ # -------------------------------------------------------------------------
- def _ui_adjust_scrollbar_(self, position, size, count):
+ def _ui_adjust_scrollbar_(self, position, size, count):
- self.widget.SetScrollbar(position, size, count, size - 1, True)
+ self.widget.SetScrollbar(position, size, count, size - 1, True)
+ # -------------------------------------------------------------------------
+ # Indicate whether this widget is vertically growable
+ # -------------------------------------------------------------------------
+
+ def is_growable(self):
+
+ return True
+
+
# -----------------------------------------------------------------------------
# Configuration data
# -----------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r9477 - trunk/gnue-forms/src/uidrivers/wx26/widgets,
reinhard <=