[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8109 - trunk/gnue-designer/src/base/tools
From: |
btami |
Subject: |
[gnue] r8109 - trunk/gnue-designer/src/base/tools |
Date: |
Wed, 30 Nov 2005 16:54:33 -0600 (CST) |
Author: btami
Date: 2005-11-30 16:54:32 -0600 (Wed, 30 Nov 2005)
New Revision: 8109
Modified:
trunk/gnue-designer/src/base/tools/PropertyEditor.py
Log:
fixed 'Setting entry properties doesn't stick' bug
Modified: trunk/gnue-designer/src/base/tools/PropertyEditor.py
===================================================================
--- trunk/gnue-designer/src/base/tools/PropertyEditor.py 2005-11-25
10:33:33 UTC (rev 8108)
+++ trunk/gnue-designer/src/base/tools/PropertyEditor.py 2005-11-30
22:54:32 UTC (rev 8109)
@@ -219,17 +219,22 @@
# (Integer, Boolean, Dropdown, Char)
if self.attributes[key].has_key('ValueSet'):
field = LimitedSetEditor(self.fieldPanel,self.attributes[key])
+ EVT_COMBOBOX(field, field.GetId(), self.__valueModified)
elif self.attributes[key].has_key('References'):
tag, attr = self.attributes[key]['References'].split('.')
objectList = self.editor.instance.getObjectList(tag)
field = LinkedTextEditor(self.fieldPanel, self.attributes[key],
objectList, attr)
+ EVT_COMBOBOX(field, field.GetId(), self.__valueModified)
elif self.attributes[key]['Typecast'] == GTypecast.boolean:
field = BoolEditor(self.fieldPanel,self.attributes[key])
+ EVT_COMBOBOX(field, field.GetId(), self.__valueModified)
elif self.attributes[key]['Typecast'] in (GTypecast.integer,
GTypecast.number, GTypecast.whole):
field = IntEditor(self.fieldPanel,self.attributes[key])
+ EVT_SPINCTRL(field, field.GetId(), self.__valueModified)
else:
field = TextEditor(self.fieldPanel,self.attributes[key])
+ EVT_TEXT(field, field.GetId(), self.__valueModified)
# Generate a tooltip from the description.
# Note that tooltips can have {Name} tokens
@@ -248,9 +253,6 @@
except KeyError:
pass
- EVT_KILL_FOCUS(field, self.__valueModified)
- EVT_KEY_UP(field, self.__enterPressed)
-
# Align the centers of the field and label
fx, fy = field.GetSizeTuple()
lx, ly = label.GetSizeTuple()
@@ -262,7 +264,6 @@
# Next y...
y += maxy
-
# Set the initial value of the cells to the current property values
if hasattr(object, xkey):
field.SetValue(object.__dict__[xkey])
@@ -306,16 +307,14 @@
for field in self.fields:
field.SetSize((fw, field.GetSize().y))
- # If user presses enter, create an ObjectModified event
- def __enterPressed(self, event):
- if event.GetKeyCode() == WXK_RETURN:
- self.__valueModified(event)
- event.Skip()
-
# Notify system that the object has been modified
def __valueModified(self, event):
field = event.GetEventObject()
- attr = self.rowList[self.fields.index(field)][1]
+ try:
+ attr = self.rowList[self.fields.index(field)][1]
+ except ValueError:
+ return
+
value = field.GetValue()
xkey = attr.replace(':','__')
@@ -343,7 +342,7 @@
self.object.__dict__[xkey] = value
newVal = {attr: value}
-
+
self.editor.dispatchEvent('ObjectModified',
object=self.object,
originator=__name__,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8109 - trunk/gnue-designer/src/base/tools,
btami <=