IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: Haim on November 03, 2006, 02:07:16 AM

Title: Closing a dialog with the Esc key
Post by: Haim on November 03, 2006, 02:07:16 AM
Hi,
I guess I am the first to try this child board out   :)
Is there an automatic way to have a dialog close in response of the user hitting the Esc key? (similar to reacting to the Enter key as if the default button was clicked)

Haim
Title: Re: Closing a dialog with the Esc key
Post by: Ionic Wind Support Team on November 03, 2006, 02:17:43 AM
The OS reserves ID numbers of 1 and 2 for OK and CANCEL buttons.  When creating your dialog give the CANCEL button the ID of 2 and close the dialog in response to that button in your OnControl handler.

When you press the escape key the default dialog process checks to see if a button with an ID of 2 exists, and if so presses it.  It can also be a hidden button if you don't want it to be visible to the user, but still want ESC key functionality

Title: Re: Closing a dialog with the Esc key
Post by: Haim on November 03, 2006, 02:22:26 AM
So simple,
but I did not know it...   :-[

Thanks for showing me,

Haim