forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclickCharChunk.xml
More file actions
48 lines (48 loc) · 4.47 KB
/
Copy pathclickCharChunk.xml
File metadata and controls
48 lines (48 loc) · 4.47 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
<doc>
<legacy_id>1844</legacy_id>
<name>clickCharChunk</name>
<type>function</type>
<syntax>
<example>the clickCharChunk</example>
<example>clickCharChunk()</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>User Interaction</category>
</classification>
<references>
<function tag="clickStack">clickStack Function</function>
<function tag="mouseCharChunk">mouseCharChunk Function</function>
<function tag="clickChar">clickChar Function</function>
<function tag="clickText">clickText Function</function>
</references>
<history>
<introduced version="1.0">Added.</introduced>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<web/>
<mobile/>
</classes>
<security>
</security>
<summary><glossary tag="return">Returns</glossary> the position of the <keyword tag="character">character</keyword> the user last clicked in a <keyword tag="field">field</keyword>.</summary>
<examples>
<example>the clickCharChunk</example>
<example>if word 2 of the clickCharChunk &lt; 100 then put the clickChar into me</example>
</examples>
<description>
<p>Use the <b>clickCharChunk</b> <control_st tag="function">function</control_st> within a <message tag="mouseDown">mouseDown</message>, <message tag="mouseUp">mouseUp</message>, or <message tag="selectionChanged">selectionChanged</message> <glossary tag="handler">handler</glossary> to determine where in the text the user clicked, in order to provide <glossary tag="hypertext">hypertext</glossary> (clickable text) or take some action based on the click.</p><p/><p><b>Value:</b></p><p>The <b>clickCharChunk</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a <glossary tag="chunk expression">chunk expression</glossary> of the form char <i>charNumber</i> to <i>charNumber</i> of field <i>fieldNumber</i>.</p><p/><p><b>Comments:</b></p><p>The <b>clickCharChunk</b> <control_st tag="function">function</control_st> is cleared at the next mouse click, as as after some editing actions such as deleting text. If the last click was not in a <keyword tag="field">field</keyword>, the <b>clickCharChunk</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> empty.</p><p/><p>The <i>charNum</i> is the <keyword tag="character">character</keyword> the <glossary tag="mouse pointer">mouse pointer</glossary> was over when the mouse was clicked. Moving the mouse before the <glossary tag="mouse button">mouse button</glossary> is released does not affect the <function tag="value">value</function> <glossary tag="return">returned</glossary> by the <b>clickCharChunk</b>.</p><p/><p>The first and second character numbers in the return value are always identical, unless the click was on a field but there was no text under it. In this case, the <b>clickCharChunk</b> <glossary tag="return">returns</glossary> a <glossary tag="chunk expression">chunk expression</glossary> of the form</p><p> char <i>charNumber</i> to <i>charNumber - 1</i> of field <i>fieldNumber</i></p><p>indicating the start of the <b>clickLine</b>. For example, if the mouse is over an empty <keyword tag="field">field</keyword>, the <b>clickCharChunk</b> <glossary tag="return">returns</glossary> char 1 to 0 of field <i>fieldNumber</i>.</p><p/><p>If the field is locked, the <b>clickCharChunk</b> <control_st tag="function">function</control_st> is most useful within a <glossary tag="handler">handler</glossary> (such as <message tag="mouseDown">mouseDown</message> or <message tag="mouseUp">mouseUp</message>) that is <glossary tag="trigger">triggered</glossary> by the mouse click.</p><p/><p>If the field is unlocked, <b>mouseDown</b> and <message tag="mouseUp">mouseUp</message> <glossary tag="message">messages</glossary> are not sent when the user clicks in the <keyword tag="field">field</keyword> (unless the user right-clicks or holds down the Control key while clicking). Use the <b>clickCharChunk</b> function within a <message tag="selectionChanged">selectionChanged</message> <glossary tag="handler">handler</glossary> to determine what <keyword tag="characters">characters</keyword> the user is editing in an <glossary tag="unlock">unlocked</glossary> <keyword tag="field">field</keyword>.</p><p/><p>To get the actual character clicked, use the <b>clickChar</b> <control_st tag="function">function</control_st>.</p>
</description>
</doc>