--- a/controls/LocationCellEditor.py Sun Mar 18 15:37:04 2012 +0100
+++ b/controls/LocationCellEditor.py Sun Mar 18 18:11:46 2012 +0100
@@ -72,11 +72,13 @@
self._init_ctrls(parent)
self.Locations = locations
self.VarType = None
+ self.Default = False
def SetVarType(self, vartype):
self.VarType = vartype
def SetValue(self, value):
+ self.Default = value
self.Location.SetValue(value)
def GetValue(self):
@@ -100,9 +102,11 @@
def OnLocationChar(self, event):
keycode = event.GetKeyCode()
- if keycode in [wx.WXK_RETURN, wx.WXK_TAB, wx.WXK_ESCAPE]:
+ if keycode in [wx.WXK_RETURN, wx.WXK_TAB]:
self.Parent.Parent.ProcessEvent(event)
- self.Parent.Parent.SetFocus()
+ elif keycode == wx.WXK_ESCAPE:
+ self.Location.SetValue(self.Default)
+ self.Parent.Parent.CloseEditControl()
else:
event.Skip()
@@ -147,7 +151,7 @@
self.Table.SetValueByName(row, 'Location', loc)
return True
return False
-
+
def SetSize(self, rect):
self.CellControl.SetDimensions(rect.x + 1, rect.y,
rect.width, rect.height,