Deutsches LiveCode Wiki
Advertisement

Specifies that a button will be automatically chosen when the user presses Return or Enter.Syntax:

set the default of <button> to {true | false}

Examples:

set the default of button "OK" to true
set the default of button otherButton to false

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(keyword) whose default property is true. (Also handle the returnInField and enterInField messages to ensure that the default button(keyword) 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(keyword) 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.

On OS X systems, the default button

throbs rhythmically instead of having a border. Because the throbbing button(keyword) is drawn by the operating system, its apppearance may not be correct if the button(keyword) is placed on top of another control. To avoid minor cosmetic problems, place default buttons directly on the card(keyword) rather than on top of other objects.

See also: enterInField (message),returnInField (message),card (object),button (object),dialogData (property),properties (property),defaultButton (property),acceleratorKey (property),location (property),

Advertisement