Problem with Fields
Dave
dave at looktowindward.com
Wed Mar 28 20:04:20 EDT 2007
Hi,
I have a number of fields that the user can change. When they select
a field I want its old contents selected so that if they start to
type it overwrites the current contents. If they want to edit the
contents then they click again to de-select the text.
I tried your suggestion and it worked! Not sure why though?
The reason I added it without using the "send" command was because in
the documentation for "openField" it says:
Examples:
on openField -- when clicking in the field, select all its text
select text of the target
end openField
Which is exactly what I want to do!
All the Best
Dave
openField
Type: message
Syntax: openField
Objects (or Types): field
See Also: closeField message, exitField message, focusIn message,
select command, selection keyword
Introduced: 1.0
Changed: 1.0
Platform Support:
Summary:
Sent to an unlocked field when you click or select text in that field.
Examples:
on openField -- when clicking in the field, select all its text
select text of the target
end openField
Handle the openField message if you want to do something when the
user enters a field.
Comments:
The openField message is sent to buttons whose menuMode is
"comboBox", since the type-in box in a combo box behaves like a field.
The openField message is not sent to locked fields. When a locked
field becomes active (focused) or when text in it is selected by a
handler, the focusIn message is sent to it.
On 28 Mar 2007, at 16:49, Eric Chatonet wrote:
> Hi Dave,
>
> Probably you could use:
>
> on openField
> send "SelectText" to me in 0 milliseconds
> end openField
> --------------------------
> on SelectText
> select the text of the target
> end SelectText
>
> But I really don't understand the concept ;-)
> From an ergonomic point of view, I mean.
> Nevertheless, keep in mind that sending messages instead of calling
> them directly may solve many problems...
>
> Best regards from Paris,
> Eric Chatonet.
>
> Le 28 mars 07 à 17:24, Dave a écrit :
>
>> Hi,
>>
>> I have the following Script on a number of fields:
>>
>> on openField
>> select the text of me
>> end openField
>>
>> on closeField
>> end closeField
>>
>> I want the whole of the field to be Selected when the user clicks
>> into the field.
>>
>> When I run this, the field gets selected (the focus border comes
>> on), the field data is selected momentarily but then it gets
>> deselected!
>>
>> I have the following properties set on this field:
>>
>> Visible
>> Don't Wrap
>> Opaque
>> Focusable
>> Focus Border
>> Tab on Return
>> Three Dimensional
>> Show Border
>>
>> AutoHiLite
>>
>> All the Rest are off.
>>
>> I could swear this used to work fine, but I'm now using RunRev
>> 2.8.0.370 it seems to have stopped working. So I'm not sure if
>> it's something else I've done or something that has changed in
>> RunRev.
>>
>> One other thing, the fields are part of a group which is part of
>> another Group, not sure if this would cause a problem or not.
>>
>> Any suggestions?
>>
>> All the Best
>> Dave
More information about the use-livecode
mailing list