forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloseField.lcdoc
More file actions
63 lines (46 loc) · 2.07 KB
/
closeField.lcdoc
File metadata and controls
63 lines (46 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Name: closeField
Type: message
Syntax: closeField
Summary:
Sent to a <field(keyword)> when the <focus> is being removed from that
<field(keyword)> and the <field(object)|field's> content has changed.
Associations: field
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
on closeField -- make sure the user has entered a valid date
if the text of me is not a date then
beep
answer "Please enter a date."
select text of me
end if
end closeField
Description:
Handle the <closeField> <message> if you want to make sure a
<field(object)|field's> content is correct after it has 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 <closeField> <message> is not sent when the user
clicks in the same <field>.
The <closeField> <message> is not sent when a <handler> changes the
field's contents using the <put> <command>.
If the lookAndFeel <property> is set to "Macintosh", the <closeField>
<message> is generally not sent when another control (such as a
<button(keyword)>) is clicked. This is because clicked buttons do not
receive the <focus> on <Mac OS|Mac OS systems>, and therefore the
<selection> remains active.
The <closeField> <message> is also sent to <button(object)|buttons>
whose <menuMode> is "comboBox", since the type-in box in a <combo box>
behaves like a <field>.
If a field is closing and its contents have not changed, the <exitField>
<message> is sent instead of <closeField>.
References: put (command), focus (command), select (command),
property (glossary), field (glossary), handler (glossary),
message (glossary), Mac OS (glossary), command (glossary),
combo box (glossary), field (keyword), selection (keyword),
button (keyword), openField (message), exitField (message),
focusOut (message), field (object), button (object), menuMode (property)
Tags: ui