This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathclickChunk.lcdoc
More file actions
82 lines (61 loc) · 2.96 KB
/
clickChunk.lcdoc
File metadata and controls
82 lines (61 loc) · 2.96 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Name: clickChunk
Type: function
Syntax: the clickChunk
Syntax: clickChunk()
Summary:
<return|Returns> the position of the <word> or <grouped text> that the
user last clicked.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, mobile
Example:
the clickChunk
Example:
select the clickChunk
Returns:
The <clickChunk> <function> <return|returns> a <chunk expression> of the
form char startChar to endChar of field fieldNumber.
Description:
Use the <clickChunk> function within a <mouseDown>, <mouseUp>, or
<selectionChanged> <handler> to determine which <word> or
<grouped text|text group> the user clicked, in order to provide
<hypertext> (clickable text) or take some action based on the click.
The <clickChunk> <function> is cleared at the next mouse click, as well
as after some editing actions such as deleting text. If the last click
was not in a <field>, the <clickChunk> <function> <return|returns>
empty.
The returned value reports the word the user clicked: the startChar is
the first <character> of the <word>, and the endChar is the last
<character>. If the <textStyle> of the clicked text is "link", the
<return value|returned value> specifies the entire <grouped text|text
group>.
>*Important:* Words are defined a little differently by the
> <clickChunk> <function> than the way they are used in
> <chunk expression|chunk expressions>. A word, for purposes of the
> <clickChunk>, is any text delimited by spaces, tabs, returns, or
> punctuation. If you click a punctuation <character>, only that
> <character> is returned. This means that, for example, clicking a
> hyphenated word only returns the part of the word that was clicked.
The returned value indicates the text that the mouse pointer was over
when the mouse was clicked. Moving the mouse before the mouse button is
released does not affect the value returned by the <clickChunk>.
If the field is locked, the <clickChunk> function is most useful within
a <handler> (such as <mouseDown> or <mouseUp>) that is
<trigger|triggered> by the mouse click.
If the field is unlocked, mouseDown and <mouseUp> <message|messages> are
not sent when the user clicks in the <field> (unless the user
right-clicks or holds down the Control key while clicking). Use the
<clickChunk> <function> within a <selectionChanged> <handler> to
determine what <characters> the user is editing in an <unlock|unlocked>
<field>.
To get the text of the word or text group clicked, use the <clickText>
<function>.
References: function (control structure), clickText (function),
selectedChunk (function), dropChunk (function), clickStack (function),
clickChar (function), return (glossary), chunk expression (glossary),
handler (glossary), return value (glossary), trigger (glossary),
message (glossary), unlock (glossary), grouped text (glossary),
hypertext (glossary), character (keyword), characters (keyword),
word (keyword), field (keyword), mouseDown (message), mouseUp (message),
selectionChanged (message), textStyle (property)
Tags: ui