Progress
Programming
Handbook
Default Buttons in Dialog Boxes
In a graphical interface, dialog boxes typically have a default button. The default button receives RETURN key events whether or not it has focus, thereby allowing the user to execute the button’s action without having to tab to it or move the mouse to it. However, if the widget that currently has focus normally takes a RETURN press event, that widget, and not the default button, will receive the RETURN event. For example, another button in the frame can still receive the RETURN event.
A default button is recognizable to the user by an extra border. For example, in many editors, a dialog box appears if the user attempts to close a file without saving it, prompting the user to either save the file or close the file and lose any changes. When programming this type of application, the Save button is typically the default button in the dialog.
When defining a button, specify the DEFAULT option to indicate that it can be a default button. To make it the default button for the frame, specify the button in the frame’s DEFAULT–BUTTON option.
If you need to change a frame’s default button at run time, make sure that you specify the DEFAULT option for each button that potentially may become the default button. Then, at run time, change the frame’s DEFAULT–BUTTON attribute.
Note that if you define a default button in a frame that contains fill-ins, pressing RETURN does not move the cursor to the next field even if the SESSION:DATA–ENTRY–RETURN attribute is true.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |