Commit by: stearns
Modified files:
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.183 1.184
chandler/parcels/osaf/framework/blocks/detail/Detail.py 1.100 1.101

Log message:
Fix 2619: ( TextCtrls in detail view should handle the OnEnter case), r=capps
- For AEs, EndControlEdit when the wxAEBlock gets an 'enter' keypress
- for non-AEs that validate, do validation when we get an 'enter'

non-AEs that don't validate write back on every keystroke - debatably bad, but 
this'll go away in 0.6 anyway.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.183&r2=text&tr2=1.184
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/detail/Detail.py.diff?r1=text&tr1=1.100&r2=text&tr2=1.101

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.183 
chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.184
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.183       Wed Mar 
 9 11:44:40 2005
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py     Wed Mar  9 
11:56:42 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.183 $"
-__date__ = "$Date: 2005/03/09 19:44:40 $"
+__version__ = "$Revision: 1.184 $"
+__date__ = "$Date: 2005/03/09 19:56:42 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm";
 
@@ -1462,6 +1462,7 @@
         # create the control to use for editing
         control = self.editor.Create(self.blockItem.widget, -1)
         control.Bind(wx.EVT_KILL_FOCUS, self.onLoseFocusFromControl)
+        control.Bind(wx.EVT_KEY_UP, self.OnKeyPressedFromControl)
         self.control = control # remember the widget created (aka the control)
 
     def destroyControl(self):
@@ -1486,6 +1487,12 @@
         self.wxSynchronizeWidget() #resync, so we'll draw without the control.
         event.Skip()
 
+    def OnKeyPressedFromControl(self, event):
+        if event.m_keyCode == wx.WXK_RETURN:
+            self.editor.EndControlEdit(self.blockItem.getItem(), 
self.blockItem.getAttributeName(), self.control)
+        else:
+            event.Skip()
+
 class AEBlock(RectangularChild):
     """
       Attribute Editor Block

Index: chandler/parcels/osaf/framework/blocks/detail/Detail.py
diff -u chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.100 
chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.101
--- chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.100       Tue Mar 
 8 10:18:07 2005
+++ chandler/parcels/osaf/framework/blocks/detail/Detail.py     Wed Mar  9 
11:56:42 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.100 $"
-__date__ = "$Date: 2005/03/08 18:18:07 $"
+__version__ = "$Revision: 1.101 $"
+__date__ = "$Date: 2005/03/09 19:56:42 $"
 __copyright__ = "Copyright (c) 2004-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm";
 
@@ -666,7 +666,7 @@
         
     def onKeyPressed (self, event):
         # called when we get an event; to saves away the data and skips the 
event
-        self.saveTextValue()
+        self.saveTextValue(validate = event.m_keyCode == wx.WXK_RETURN)
         event.Skip()
         
     def OnDataChanged (self):

_______________________________________________
Commits mailing list
Commits@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to