Select text question

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Select text question

Ralph DiMola via use-livecode
I want a user to key a number in a field in an iOS app. Normally the field will already contain data which the user will be replacing, so I coded this

on openField
   set the keyboardType of me to "numeric"
   select text of me
end openField

What happens is that the selection can be seen taking place briefly (this is in the Simulator) and then reverts to a flashing cursor with the original data still in the field and no selection shown. (The numeric keyboard does open BTW, but I can’t see that as relevant).

What did I do wrong?

Graham
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Select text question

Ralph DiMola via use-livecode

Not sure about mobile, but does this help?
 
on openFieldset the keyboardType of me to "numeric"
put "" into meselect text of meend openField
 
Craig
 
 
-----Original Message-----
From: "Graham Samuel via use-livecode" <[hidden email]>
Sent: Thursday, October 8, 2020 8:45am
To: "How to use LiveCode" <[hidden email]>
Cc: "Graham Samuel" <[hidden email]>
Subject: Select text question



I want a user to key a number in a field in an iOS app. Normally the field will already contain data which the user will be replacing, so I coded this

on openField
 set the keyboardType of me to "numeric"
 select text of me
end openField

What happens is that the selection can be seen taking place briefly (this is in the Simulator) and then reverts to a flashing cursor with the original data still in the field and no selection shown. (The numeric keyboard does open BTW, but I can’t see that as relevant).

What did I do wrong?

Graham
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Select text question

Ralph DiMola via use-livecode
Thanks Craig. Somehow the return characters didn’t arrive in my email, but of course I understand what you mean. But this would simply empty the field,  wouldn’t it, whereas I want the user to see the text that was there before, selected. I thought that was what the ’select’ command for text was for.

Graham

> On 8 Oct 2020, at 15:30, craig--- via use-livecode <[hidden email]> wrote:
>
>
> Not sure about mobile, but does this help?
>
> on openFieldset the keyboardType of me to "numeric"
> put "" into meselect text of meend openField
>
> Craig
>
>
> -----Original Message-----
> From: "Graham Samuel via use-livecode" <[hidden email]>
> Sent: Thursday, October 8, 2020 8:45am
> To: "How to use LiveCode" <[hidden email]>
> Cc: "Graham Samuel" <[hidden email]>
> Subject: Select text question
>
>
>
> I want a user to key a number in a field in an iOS app. Normally the field will already contain data which the user will be replacing, so I coded this
>
> on openField
> set the keyboardType of me to "numeric"
> select text of me
> end openField
>
> What happens is that the selection can be seen taking place briefly (this is in the Simulator) and then reverts to a flashing cursor with the original data still in the field and no selection shown. (The numeric keyboard does open BTW, but I can’t see that as relevant).
>
> What did I do wrong?
>
> Graham
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Select text question

Ralph DiMola via use-livecode

Graham.
 
Ah, I see now. This is not an issue at all in ordinary LC, as you certainly know. What happens if you select the text twice in a row?
 
Craig
 
 
-----Original Message-----
From: "Graham Samuel via use-livecode" <[hidden email]>
Sent: Thursday, October 8, 2020 11:36am
To: "How to use LiveCode" <[hidden email]>
Cc: "Graham Samuel" <[hidden email]>
Subject: Re: Select text question



Thanks Craig. Somehow the return characters didn’t arrive in my email, but of course I understand what you mean. But this would simply empty the field, wouldn’t it, whereas I want the user to see the text that was there before, selected. I thought that was what the ’select’ command for text was for.

Graham

> On 8 Oct 2020, at 15:30, craig--- via use-livecode <[hidden email]> wrote:
>
>
> Not sure about mobile, but does this help?
>
> on openFieldset the keyboardType of me to "numeric"
> put "" into meselect text of meend openField
>
> Craig
>
>
> -----Original Message-----
> From: "Graham Samuel via use-livecode" <[hidden email]>
> Sent: Thursday, October 8, 2020 8:45am
> To: "How to use LiveCode" <[hidden email]>
> Cc: "Graham Samuel" <[hidden email]>
> Subject: Select text question
>
>
>
> I want a user to key a number in a field in an iOS app. Normally the field will already contain data which the user will be replacing, so I coded this
>
> on openField
> set the keyboardType of me to "numeric"
> select text of me
> end openField
>
> What happens is that the selection can be seen taking place briefly (this is in the Simulator) and then reverts to a flashing cursor with the original data still in the field and no selection shown. (The numeric keyboard does open BTW, but I can’t see that as relevant).
>
> What did I do wrong?
>
> Graham
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Select text question

Ralph DiMola via use-livecode
In reply to this post by Ralph DiMola via use-livecode
Untested, but try this:

on keyboardActivated
  select text of fld <whatever>
end keyboardActivated

If you get a selection flash when it sets twice, remove the command from
the openField handler.

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On October 8, 2020 7:47:46 AM Graham Samuel via use-livecode
<[hidden email]> wrote:

> I want a user to key a number in a field in an iOS app. Normally the field
> will already contain data which the user will be replacing, so I coded this
>
> on openField
>   set the keyboardType of me to "numeric"
>   select text of me
> end openField
>
> What happens is that the selection can be seen taking place briefly (this
> is in the Simulator) and then reverts to a flashing cursor with the
> original data still in the field and no selection shown. (The numeric
> keyboard does open BTW, but I can’t see that as relevant).
>
> What did I do wrong?
>
> Graham
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Select text question

Ralph DiMola via use-livecode
Jacque, that’s perfect. Where would I be without the knowledge and kindness displayed daily on this list!

Graham

> On 8 Oct 2020, at 18:58, J. Landman Gay via use-livecode <[hidden email]> wrote:
>
> Untested, but try this:
>
> on keyboardActivated
> select text of fld <whatever>
> end keyboardActivated
>
> If you get a selection flash when it sets twice, remove the command from the openField handler.
>
> --
> Jacqueline Landman Gay | [hidden email]
> HyperActive Software | http://www.hyperactivesw.com
> On October 8, 2020 7:47:46 AM Graham Samuel via use-livecode <[hidden email]> wrote:
>
>> I want a user to key a number in a field in an iOS app. Normally the field will already contain data which the user will be replacing, so I coded this
>>
>> on openField
>>  set the keyboardType of me to "numeric"
>>  select text of me
>> end openField
>>
>> What happens is that the selection can be seen taking place briefly (this is in the Simulator) and then reverts to a flashing cursor with the original data still in the field and no selection shown. (The numeric keyboard does open BTW, but I can’t see that as relevant).
>>
>> What did I do wrong?
>>
>> Graham
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode