Livecode Wiki
(Adding categories)
Tag: categoryselect
(Adding categories)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Sent to the [[field]] with the selection when the selection is being removed from the field, and its contents '''have not changed.'''
+
Sent to the [[field]] with the selection when the selection is being removed from the field, and its contents '''have not changed. '''If there is a message handler by the same name in the message path, then it will be executed.
   
  +
== Message ==
 
Syntax:
 
Syntax:
 
exitField
 
exitField
   
  +
The selection is removed from a field (and the field loses focus) when another window is brought to the front, when the user clicks in another field, or when the user tabs out of the field. The field also loses focus when the [[select]] command is used to select text in another field. However, the [[exitField]] message is not sent when the user clicks another point in the same field. 
  +
 
The exitField message is sent to buttons whose menuMode is "comboBox", since the type-in box in a combo box behaves like a field.
  +
  +
The exitField message is sent only if the field's contents have not changed since the last time it received the openField message. If a field is closing and its contents have changed, the closeField message is sent instead of exitField.
  +
 
If the field's contents were changed by script using the [[put]] command, then exitField will still be sent. closeField is only sent when the contents are changed by the user.
  +
  +
== Message handler ==
 
Examples:
 
Examples:
 
on exitField -- remove visual signs that the field is being edited
 
on exitField -- remove visual signs that the field is being edited
Line 9: Line 19:
 
end exitField
 
end exitField
   
Handle the [[exitField]] message if you want to do something when the user
+
Use the exitField Message handler if you want to do something when the user leaves a field that hasn't been changed.
leaves a field that hasn't been changed.
 
 
The selection is removed from a field (and the field loses focus) when
 
another window is brought to the front, when the user clicks in another
 
field, or when the user tabs out of the field. The field also loses
 
focus when the [[select]] command is used to select text in another field.
 
However, the [[exitField]] message is not sent when the user clicks
 
another point in the same field. 
 
 
The [[exitField]] message is sent to buttons whose [[menuMode]] is
 
"comboBox", since the type-in box in a combo box behaves like a field. 
 
 
The [[exitField]] message is sent only if the field's contents have not
 
changed since the last time it received the [[openField]] message. If a
 
field is closing and its contents have changed, the [[closeField]] message
 
is sent instead of [[exitField]]. This means that if you want to take an
 
action when the selection is removed from a field (whether the field has
 
changed or not) you must handle both [[closeField]] and [[exitField]].
 
   
 
This means that if you want to take an action when the selection is removed from a field (whether the field has changed or not) you must handle both closeField and exitField.
 If the field's contents were changed by script using the [[put]] command, then exitField will still be sent. [[closeField]] is only sent
 
when the contents are changed by the user.
 
   
See also: [[openField]] (message), [[closeField]] (message), [[openField]] (message), [[focusOut]] (message), [[menuMode]] (property)
+
See also: [[openField]], [[closeField]], [[openField]], [[focusOut]] & [[menuMode]].
 
[[Category: ui]]
 
[[Category: ui]]
 
[[Category:Text processing]]
 
[[Category:Text processing]]
  +
[[Category:Fields]]

Latest revision as of 22:37, 27 June 2020

Sent to the field with the selection when the selection is being removed from the field, and its contents have not changed. If there is a message handler by the same name in the message path, then it will be executed.

Message[]

Syntax:

exitField

The selection is removed from a field (and the field loses focus) when another window is brought to the front, when the user clicks in another field, or when the user tabs out of the field. The field also loses focus when the select command is used to select text in another field. However, the exitField message is not sent when the user clicks another point in the same field. 

The exitField message is sent to buttons whose menuMode is "comboBox", since the type-in box in a combo box behaves like a field.

The exitField message is sent only if the field's contents have not changed since the last time it received the openField message. If a field is closing and its contents have changed, the closeField message is sent instead of exitField.

If the field's contents were changed by script using the put command, then exitField will still be sent. closeField is only sent when the contents are changed by the user.

Message handler[]

Examples:

on exitField -- remove visual signs that the field is being edited
  set the showBorder of the target to false
end exitField

Use the exitField Message handler if you want to do something when the user leaves a field that hasn't been changed.

This means that if you want to take an action when the selection is removed from a field (whether the field has changed or not) you must handle both closeField and exitField.

See also: openField, closeField, openField, focusOut & menuMode.