View previous topic :: View next topic |
Author |
Message |
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Tue Apr 13, 2010 9:00 am Post subject: Escape key to close form |
|
|
I have a form containing a Virtual Tree which I am trying to set to close when the user presses the Escape key, via the CancelButton property.
However, it seems that the Virtual Tree is intercepting the button press.
If I override the ProcessEscapeCmdKey method I can see that the base.ProcessEscapeCmdKey method returns true, and if I return false from the overriding method the form will close as expected.
However, I suspect that blindly returning false from the overriding method is not desirable.
Should the ProcessEscapeCmdKey method only return true if it actually cancelled something, e.g. if cell editing was in progress? In that case the user could use escape to cancel editing if that was what they were doing, or to close the form if there was nothing to cancel in the virtual tree.
I am currently using version 3.11.0.
Thanks
Andrew Rowley |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Apr 13, 2010 10:47 pm Post subject: |
|
|
The ProcessEscapeCmdKey (and ProcessEnterCmdKey) methods are only called when there is no active editor - so you can safely override them to return false all the time. If there is an active editor then the ProcessEditEscapeCmdKey method is called instead. The base methods should probably be returning false to enable this behaviour by default - we will fix this in the next release. _________________ Infralution Support |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu May 13, 2010 6:52 am Post subject: |
|
|
Version 3.15.0 has just been released and fixes this issue. _________________ Infralution Support |
|
Back to top |
|
|
|