default | |||||||
Type | property | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Associations | button | ||||||
Summary | Specifies that a button will be automatically chosen when the user presses Return or Enter. | ||||||
Introduced | 1.0 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Example |
| ||||||
Values |
| ||||||
Related | Keyword: default, card, button Property: dialogData, properties, defaultButton, acceleratorKey, location Message: enterInField, returnInField Object: card, button Glossary: object, property, rectangle, handle, OS X, focus, insertion point, message, appearance, control, dialog box | ||||||
Description | Use the default property when designing cards to be used as dialog boxes. The familiar appearance of the default button is a cue to users about what to expect when they use the shortcut of pressing Return or Enter. When the user presses Enter or Return and there is no active control, LiveCode sends a mouseUp message to the button whose default property is true. (Also handle the returnInField and enterInField messages to ensure that the default button is activated even if there is a text insertion point or a control is focused.) If more than one button's default is true, the message is sent to the button whose default property was set to true most recently. Changing a button's default property increases its size, so it also changes its rectangle (and related properties). Changing the default property does not change the button's location. *Cross-platform note:* On OS X systems, the default button throbs rhythmically instead of having a border. Because the throbbing button is drawn by the operating system, its apppearance may not be correct if the button is placed on top of another control. To avoid minor cosmetic problems, place default buttons directly on the card rather than on top of other objects. | ||||||
Tags | ui |