[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7663 - in trunk/gnue-forms/src/uidrivers: gtk2 wx
From: |
btami |
Subject: |
[gnue] r7663 - in trunk/gnue-forms/src/uidrivers: gtk2 wx |
Date: |
Mon, 27 Jun 2005 08:41:54 -0500 (CDT) |
Author: btami
Date: 2005-06-27 08:41:52 -0500 (Mon, 27 Jun 2005)
New Revision: 7663
Modified:
trunk/gnue-forms/src/uidrivers/gtk2/dialogs.py
trunk/gnue-forms/src/uidrivers/wx/dialogs.py
Log:
fixed dialog dropdowns in wx when choices are not strings
Modified: trunk/gnue-forms/src/uidrivers/gtk2/dialogs.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/gtk2/dialogs.py 2005-06-27 12:19:02 UTC
(rev 7662)
+++ trunk/gnue-forms/src/uidrivers/gtk2/dialogs.py 2005-06-27 13:41:52 UTC
(rev 7663)
@@ -360,11 +360,12 @@
bmp = gtk.Image ()
bmp.set_from_file (imageURL)
- if sys.platform == 'win32':
- # TODO: remove this when pygtk win32 build accepts ypadding
+ try:
+ self.table.attach (bmp, 0, 2, row, row + 1, ypadding = 8)
+ except:
+ # TODO: remove this when pygtk win32 build accepts ypadding
+ # TODO pygtk 2.6.2 fails on Linux too
self.table.attach (bmp, 0, 2, row, row + 1)
- else:
- self.table.attach (bmp, 0, 2, row, row + 1, ypadding = 8)
# ---------------------------------------------------------------------------
@@ -507,7 +508,7 @@
codes = {'24': {'241': 'c-24-1', '242': 'c-24-2'},
'25': {'251': 'c-25-1'}}
- fields = [('Foo!', '/home/johannes/gnue/share/gnue/images/gnue.png', 'image',
+ fields = [('Foo!', '/home/tamas/gnue/share/gnue/images/gnue.png', 'image',
None, None, []),
('Username', '_username', 'string', 'frodo', None, \
[('Name of the user', None)]),
Modified: trunk/gnue-forms/src/uidrivers/wx/dialogs.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx/dialogs.py 2005-06-27 12:19:02 UTC
(rev 7662)
+++ trunk/gnue-forms/src/uidrivers/wx/dialogs.py 2005-06-27 13:41:52 UTC
(rev 7663)
@@ -290,6 +290,7 @@
for (tip, allowedValues) in elements:
(keys, data, defItem) = self.__getModel (master, allowedValues, default)
+ data = [str(d) for d in data]
combo = wxComboBox (self, -1, defItem or '', choices = data,
style = wxCB_READONLY)
@@ -301,7 +302,7 @@
combo._allowedValues = allowedValues
if tip:
- combo.SetToolTip (wxToolTip (tip))
+ combo.SetToolTip (wxToolTip (wxEncode(tip)))
drops.append (combo)
EVT_COMBOBOX (combo, -1, self.__comboChanged)
@@ -373,8 +374,8 @@
def __comboChanged (self, event):
combo = event.GetEventObject ()
- value = combo.GetValue ()
- newKey = combo._keys [combo._data.index (value)]
+ value = combo.GetStringSelection()
+ newKey = combo._keys[ combo._data.index (value)]
self.inputData [combo._field] = newKey
self.__updateDeps (combo, combo._master, combo._field, newKey)
@@ -433,11 +434,12 @@
for combo in combos:
(keys, data, defItem) = self.__getModel (master, combo._allowedValues,
combo._default)
+ data = [str(d) for d in data]
if keys or combo._keys:
combo.Enable (True)
combo.Clear ()
for description in data:
- combo.Append (description)
+ combo.Append (str(description))
combo._keys = keys
combo._data = data
@@ -515,7 +517,7 @@
codes = {'24': {'241': 'c-24-1', '242': 'c-24-2'},
'25': {'251': 'c-25-1'}}
- fields = [('Foo!', '/home/johannes/gnue/share/gnue/images/gnue.png', 'image',
+ fields = [('Foo!', '/home/tamas/gnue/share/gnue/images/gnue.png', 'image',
None, None, []),
('Username', '_username', 'string', 'frodo', None, \
[('Name of the user', None)]),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7663 - in trunk/gnue-forms/src/uidrivers: gtk2 wx,
btami <=