[gnue] r10058 - trunk/gnue-forms/src/uidrivers/wx/widgets
[email protected] Wed, 25 Nov 2009 17:31:24 -0600 (CST)
| Newsgroups | gmane.comp.cms.gnue.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: reinhard
Date: 2009-11-25 17:31:24 -0600 (Wed, 25 Nov 2009)
New Revision: 10058
Modified:
trunk/gnue-forms/src/uidrivers/wx/widgets/entry.py
Log:
Fixed growing of entries for fields with unlimited length.
Modified: trunk/gnue-forms/src/uidrivers/wx/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/widgets/entry.py 2009-11-25 23:24:48 UTC (rev 10057)
+++ trunk/gnue-forms/src/uidrivers/wx/widgets/entry.py 2009-11-25 23:31:24 UTC (rev 10058)
@@ -759,13 +759,24 @@
def can_grow_x(self):
+ # Checkboxes are never growable.
+ if self._gfObject.style.lower() == 'checkbox':
+ return False
+
# Multiline entries are always growable.
if self._gfObject.style.lower() == 'multiline':
return True
- if self.get_field_length() > 32:
+ # If an explicit minimum and maximum width are given, the entry is
+ # growable.
+ if self.min_width and self.max_width:
return True
+ # If the field is longer than 32 characters long, the entry is
+ # growable.
+ if self.get_field_length() == 0 or self.get_field_length() > 32:
+ return True
+
return False
# -------------------------------------------------------------------------