Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Escape key to close form

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Tue Apr 13, 2010 9:00 am    Post subject: Escape key to close form Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Apr 13, 2010 10:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu May 13, 2010 6:52 am    Post subject: Reply with quote

Version 3.15.0 has just been released and fixes this issue.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group