Constraining an input field's contents to be a single line.

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

Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
I'm sure there must be an easy way I'm missing ..... he said in hope :-)

I want a field to contain a single line of data - i.. no CRs.

I've done the easy bit (a handler for returninfield).

I can even do the moderate bit -  a 'pastekey' handler, and check for
CRs in the clipboard - but that doesn't apply to mobile (or at least,
the dict says it doesn't).

Is there any way to handle it on mobile ?

Thanks
Alex.

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
If you have a mobile text field object, then have you looked at
inputReturnKey?


On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
[hidden email]> wrote:

> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>
> I want a field to contain a single line of data - i.. no CRs.
>
> I've done the easy bit (a handler for returninfield).
>
> I can even do the moderate bit -  a 'pastekey' handler, and check for CRs
> in the clipboard - but that doesn't apply to mobile (or at least, the dict
> says it doesn't).
>
> Is there any way to handle it on mobile ?
>
> Thanks
> Alex.
>
> _______________________________________________
> 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




--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
did that work, alex?

On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]>
wrote:

> If you have a mobile text field object, then have you looked at
> inputReturnKey?
>
>
> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
> [hidden email]> wrote:
>
>> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>>
>> I want a field to contain a single line of data - i.. no CRs.
>>
>> I've done the easy bit (a handler for returninfield).
>>
>> I can even do the moderate bit -  a 'pastekey' handler, and check for CRs
>> in the clipboard - but that doesn't apply to mobile (or at least, the dict
>> says it doesn't).
>>
>> Is there any way to handle it on mobile ?
>>
>> Thanks
>> Alex.
>>
>> _______________________________________________
>> 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
>
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
Thanks for the prompt Mike.

Short answer - don't know yet, though I suspect I'm going to have to
find out.

I do not currently have "mobile text field objects" - all I have are
just standard LC fields, so returninfield is all I need for the 'return'
part of the problem - no need for 'inputReturnKey'.

However, I also want to trap any attempt to paste in text containing
CRs; I can do that for traditional platforms with a 'pasteKey' handler -
but that doesn't seem to apply to LC fields on mobile, and also there
doesn't appear to be any direct equivalent for mobile text fields
(though there may be other ways to achieve the same result on mobile
text fields - I really haven't looked at them yet).

In fact, maybe that's the question I *should* ask.
     "Should i be  (can I reasonably get away with) using LC fields in
an app targeted for mobiles, or do I really need to use mobile text fields ?

Thanks
Alex.

On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:

> did that work, alex?
>
> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]>
> wrote:
>
>> If you have a mobile text field object, then have you looked at
>> inputReturnKey?
>>
>>
>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
>> [hidden email]> wrote:
>>
>>> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>>>
>>> I want a field to contain a single line of data - i.. no CRs.
>>>
>>> I've done the easy bit (a handler for returninfield).
>>>
>>> I can even do the moderate bit -  a 'pastekey' handler, and check for CRs
>>> in the clipboard - but that doesn't apply to mobile (or at least, the dict
>>> says it doesn't).
>>>
>>> Is there any way to handle it on mobile ?
>>>
>>> Thanks
>>> Alex.
>>>
>>> _______________________________________________
>>> 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
>>
>>
>>
>> --
>> On the first day, God created the heavens and the Earth
>> On the second day, God created the oceans.
>> On the third day, God put the animals on hold for a few hours,
>>     and did a little diving.
>> And God said, "This is good."
>>
>
>


_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
If "textchanged" triggers on paste, you can probably use that..

On Wed, Sep 20, 2017 at 3:40 PM, Alex Tweedly via use-livecode <
[hidden email]> wrote:

> Thanks for the prompt Mike.
>
> Short answer - don't know yet, though I suspect I'm going to have to find
> out.
>
> I do not currently have "mobile text field objects" - all I have are just
> standard LC fields, so returninfield is all I need for the 'return' part of
> the problem - no need for 'inputReturnKey'.
>
> However, I also want to trap any attempt to paste in text containing CRs;
> I can do that for traditional platforms with a 'pasteKey' handler - but
> that doesn't seem to apply to LC fields on mobile, and also there doesn't
> appear to be any direct equivalent for mobile text fields (though there may
> be other ways to achieve the same result on mobile text fields - I really
> haven't looked at them yet).
>
> In fact, maybe that's the question I *should* ask.
>     "Should i be  (can I reasonably get away with) using LC fields in an
> app targeted for mobiles, or do I really need to use mobile text fields ?
>
> Thanks
> Alex.
>
> On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:
>
>> did that work, alex?
>>
>> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]>
>> wrote:
>>
>> If you have a mobile text field object, then have you looked at
>>> inputReturnKey?
>>>
>>>
>>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
>>> [hidden email]> wrote:
>>>
>>> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>>>>
>>>> I want a field to contain a single line of data - i.. no CRs.
>>>>
>>>> I've done the easy bit (a handler for returninfield).
>>>>
>>>> I can even do the moderate bit -  a 'pastekey' handler, and check for
>>>> CRs
>>>> in the clipboard - but that doesn't apply to mobile (or at least, the
>>>> dict
>>>> says it doesn't).
>>>>
>>>> Is there any way to handle it on mobile ?
>>>>
>>>> Thanks
>>>> Alex.
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> On the first day, God created the heavens and the Earth
>>> On the second day, God created the oceans.
>>> On the third day, God put the animals on hold for a few hours,
>>>     and did a little diving.
>>> And God said, "This is good."
>>>
>>>
>>
>>
>
> _______________________________________________
> 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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
On 20/09/2017 22:44, Mike Bonner via use-livecode wrote:
> If "textchanged" triggers on paste, you can probably use that..

textchanged does trigger - but *after* the text has appeared. With
returninfield and pastekey I get the message first - and can prevent the
character being inserted.

In order to use textchanged, I'll need to keep a local copy of the field
content so that if I do find a CR I can restore the previous content and
selection point - but on a very quick try that does seem to work OK.

I'll have to check it out more thoroughly, and then try it on mobile,
but it sounds like it should work -  thanks.

Alex.

> On Wed, Sep 20, 2017 at 3:40 PM, Alex Tweedly via use-livecode <
> [hidden email]> wrote:
>
>> Thanks for the prompt Mike.
>>
>> Short answer - don't know yet, though I suspect I'm going to have to find
>> out.
>>
>> I do not currently have "mobile text field objects" - all I have are just
>> standard LC fields, so returninfield is all I need for the 'return' part of
>> the problem - no need for 'inputReturnKey'.
>>
>> However, I also want to trap any attempt to paste in text containing CRs;
>> I can do that for traditional platforms with a 'pasteKey' handler - but
>> that doesn't seem to apply to LC fields on mobile, and also there doesn't
>> appear to be any direct equivalent for mobile text fields (though there may
>> be other ways to achieve the same result on mobile text fields - I really
>> haven't looked at them yet).
>>
>> In fact, maybe that's the question I *should* ask.
>>      "Should i be  (can I reasonably get away with) using LC fields in an
>> app targeted for mobiles, or do I really need to use mobile text fields ?
>>
>> Thanks
>> Alex.
>>
>> On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:
>>
>>> did that work, alex?
>>>
>>> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]>
>>> wrote:
>>>
>>> If you have a mobile text field object, then have you looked at
>>>> inputReturnKey?
>>>>
>>>>
>>>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
>>>> [hidden email]> wrote:
>>>>
>>>> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>>>>> I want a field to contain a single line of data - i.. no CRs.
>>>>>
>>>>> I've done the easy bit (a handler for returninfield).
>>>>>
>>>>> I can even do the moderate bit -  a 'pastekey' handler, and check for
>>>>> CRs
>>>>> in the clipboard - but that doesn't apply to mobile (or at least, the
>>>>> dict
>>>>> says it doesn't).
>>>>>
>>>>> Is there any way to handle it on mobile ?
>>>>>
>>>>> Thanks
>>>>> Alex.
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>
>>>>
>>>> --
>>>> On the first day, God created the heavens and the Earth
>>>> On the second day, God created the oceans.
>>>> On the third day, God put the animals on hold for a few hours,
>>>>      and did a little diving.
>>>> And God said, "This is good."
>>>>
>>>>
>>>
>> _______________________________________________
>> 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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
yes it does.

Bob S


> On Sep 20, 2017, at 14:44 , Mike Bonner via use-livecode <[hidden email]> wrote:
>
> If "textchanged" triggers on paste, you can probably use that..


_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
The easiest thing to do is to use a mobile input field, but if you aren't
interested in doing that,
Let's see:
Crazy idea that I haven't tried 1:  You might be able to trap the field
getting the focus, and if it does get the focus, lock the screen until you
can process textChanged, keyDown, etc., remembering to re-lock the screen
each time.
Crazy idea that I haven't tried 2: You might also be able to use two layers
- a transparent field with transparent text and a display field with normal
text.  When the user does something on the transparent field, you process
it and update the display field underneath.  That would allow you to
capture the return and ignore it.

On Wed, Sep 20, 2017 at 6:28 PM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> yes it does.
>
> Bob S
>
>
> > On Sep 20, 2017, at 14:44 , Mike Bonner via use-livecode <
> [hidden email]> wrote:
> >
> > If "textchanged" triggers on paste, you can probably use that..
>
>
> _______________________________________________
> 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
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Easiest way... add this to the field

on returninField
   exit returninField
end returninField





-----
Andy Piddock


My software never has bugs. It just develops random features.

TinyIDE a Free alternative minimalist IDE Plugin for LiveCode
TinyIDE


Script editor Themer for LC http://2108.co.uk 

PointandSee is a FREE simple but full featured under cursor colour picker / finder.
http://www.pointandsee.co.uk  - made with LiveCode
--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Add this to the field script

on returninField
   exit returninField
end returninField



-----
Andy Piddock


My software never has bugs. It just develops random features.

TinyIDE a Free alternative minimalist IDE Plugin for LiveCode
TinyIDE


Script editor Themer for LC http://2108.co.uk 

PointandSee is a FREE simple but full featured under cursor colour picker / finder.
http://www.pointandsee.co.uk  - made with LiveCode
--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Did you already try the following?
This works here, also with pasted text.

on textchanged
  lock screen; lock messages
  put the selectedChunk into sc
  replace cr with space in me -- or with empty
  select sc
  unlock screen; unlock messages
end textchanged

> > Mike B. wrote:
> > If "textchanged" triggers on paste, you can probably use that..
>
> Alex T. wrote
> textchanged does trigger - but *after* the text has appeared. With
> returninfield and pastekey I get the message first - and can prevent the
> character being inserted.
>
> In order to use textchanged, I'll need to keep a local copy of the field
> content so that if I do find a CR I can restore the previous content and
> selection point - but on a very quick try that does seem to work OK.
>
> I'll have to check it out more thoroughly, and then try it on mobile,
> but it sounds like it should work -  thanks.

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Have you tried...?

*on* rawKeyDown
   *if* pKeyPressed is 65293 *then*
      replace cr with empty in me
      select after me
   *end if*
   pass rawKeyDown
*end* rawKeyDown


On Wed, Sep 20, 2017 at 5:40 PM, Alex Tweedly via use-livecode <
[hidden email]> wrote:

> Thanks for the prompt Mike.
>
> Short answer - don't know yet, though I suspect I'm going to have to find
> out.
>
> I do not currently have "mobile text field objects" - all I have are just
> standard LC fields, so returninfield is all I need for the 'return' part of
> the problem - no need for 'inputReturnKey'.
>
> However, I also want to trap any attempt to paste in text containing CRs;
> I can do that for traditional platforms with a 'pasteKey' handler - but
> that doesn't seem to apply to LC fields on mobile, and also there doesn't
> appear to be any direct equivalent for mobile text fields (though there may
> be other ways to achieve the same result on mobile text fields - I really
> haven't looked at them yet).
>
> In fact, maybe that's the question I *should* ask.
>     "Should i be  (can I reasonably get away with) using LC fields in an
> app targeted for mobiles, or do I really need to use mobile text fields ?
>
> Thanks
> Alex.
>
> On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:
>
>> did that work, alex?
>>
>> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]>
>> wrote:
>>
>> If you have a mobile text field object, then have you looked at
>>> inputReturnKey?
>>>
>>>
>>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
>>> [hidden email]> wrote:
>>>
>>> I'm sure there must be an easy way I'm missing ..... he said in hope :-)
>>>>
>>>> I want a field to contain a single line of data - i.. no CRs.
>>>>
>>>> I've done the easy bit (a handler for returninfield).
>>>>
>>>> I can even do the moderate bit -  a 'pastekey' handler, and check for
>>>> CRs
>>>> in the clipboard - but that doesn't apply to mobile (or at least, the
>>>> dict
>>>> says it doesn't).
>>>>
>>>> Is there any way to handle it on mobile ?
>>>>
>>>> Thanks
>>>> Alex.
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> On the first day, God created the heavens and the Earth
>>> On the second day, God created the oceans.
>>> On the third day, God put the animals on hold for a few hours,
>>>     and did a little diving.
>>> And God said, "This is good."
>>>
>>>
>>
>>
>
> _______________________________________________
> 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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
what do the asterisks do?

On Thu, Sep 21, 2017 at 6:58 AM, Roger Eller via use-livecode <
[hidden email]> wrote:

> Have you tried...?
>
> *on* rawKeyDown
>    *if* pKeyPressed is 65293 *then*
>       replace cr with empty in me
>       select after me
>    *end if*
>    pass rawKeyDown
> *end* rawKeyDown
>
>
> On Wed, Sep 20, 2017 at 5:40 PM, Alex Tweedly via use-livecode <
> [hidden email]> wrote:
>
> > Thanks for the prompt Mike.
> >
> > Short answer - don't know yet, though I suspect I'm going to have to find
> > out.
> >
> > I do not currently have "mobile text field objects" - all I have are just
> > standard LC fields, so returninfield is all I need for the 'return' part
> of
> > the problem - no need for 'inputReturnKey'.
> >
> > However, I also want to trap any attempt to paste in text containing CRs;
> > I can do that for traditional platforms with a 'pasteKey' handler - but
> > that doesn't seem to apply to LC fields on mobile, and also there doesn't
> > appear to be any direct equivalent for mobile text fields (though there
> may
> > be other ways to achieve the same result on mobile text fields - I really
> > haven't looked at them yet).
> >
> > In fact, maybe that's the question I *should* ask.
> >     "Should i be  (can I reasonably get away with) using LC fields in an
> > app targeted for mobiles, or do I really need to use mobile text fields ?
> >
> > Thanks
> > Alex.
> >
> > On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:
> >
> >> did that work, alex?
> >>
> >> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <[hidden email]
> >
> >> wrote:
> >>
> >> If you have a mobile text field object, then have you looked at
> >>> inputReturnKey?
> >>>
> >>>
> >>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
> >>> [hidden email]> wrote:
> >>>
> >>> I'm sure there must be an easy way I'm missing ..... he said in hope
> :-)
> >>>>
> >>>> I want a field to contain a single line of data - i.. no CRs.
> >>>>
> >>>> I've done the easy bit (a handler for returninfield).
> >>>>
> >>>> I can even do the moderate bit -  a 'pastekey' handler, and check for
> >>>> CRs
> >>>> in the clipboard - but that doesn't apply to mobile (or at least, the
> >>>> dict
> >>>> says it doesn't).
> >>>>
> >>>> Is there any way to handle it on mobile ?
> >>>>
> >>>> Thanks
> >>>> Alex.
> >>>>
> >>>> _______________________________________________
> >>>> 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
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> On the first day, God created the heavens and the Earth
> >>> On the second day, God created the oceans.
> >>> On the third day, God put the animals on hold for a few hours,
> >>>     and did a little diving.
> >>> And God said, "This is good."
> >>>
> >>>
> >>
> >>
> >
> > _______________________________________________
> > 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
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
The text WAS formatted and colorized.  Apparently the listserv modified
it.  The words enclosed in asterisks WERE in bold.

~Roger


On Thu, Sep 21, 2017 at 8:59 AM, Mike Kerner via use-livecode <
[hidden email]> wrote:

> what do the asterisks do?
>
> On Thu, Sep 21, 2017 at 6:58 AM, Roger Eller via use-livecode <
> [hidden email]> wrote:
>
> > Have you tried...?
> >
> > *on* rawKeyDown
> >    *if* pKeyPressed is 65293 *then*
> >       replace cr with empty in me
> >       select after me
> >    *end if*
> >    pass rawKeyDown
> > *end* rawKeyDown
> >
> >
> > On Wed, Sep 20, 2017 at 5:40 PM, Alex Tweedly via use-livecode <
> > [hidden email]> wrote:
> >
> > > Thanks for the prompt Mike.
> > >
> > > Short answer - don't know yet, though I suspect I'm going to have to
> find
> > > out.
> > >
> > > I do not currently have "mobile text field objects" - all I have are
> just
> > > standard LC fields, so returninfield is all I need for the 'return'
> part
> > of
> > > the problem - no need for 'inputReturnKey'.
> > >
> > > However, I also want to trap any attempt to paste in text containing
> CRs;
> > > I can do that for traditional platforms with a 'pasteKey' handler - but
> > > that doesn't seem to apply to LC fields on mobile, and also there
> doesn't
> > > appear to be any direct equivalent for mobile text fields (though there
> > may
> > > be other ways to achieve the same result on mobile text fields - I
> really
> > > haven't looked at them yet).
> > >
> > > In fact, maybe that's the question I *should* ask.
> > >     "Should i be  (can I reasonably get away with) using LC fields in
> an
> > > app targeted for mobiles, or do I really need to use mobile text
> fields ?
> > >
> > > Thanks
> > > Alex.
> > >
> > > On 20/09/2017 17:01, Mike Kerner via use-livecode wrote:
> > >
> > >> did that work, alex?
> > >>
> > >> On Mon, Sep 18, 2017 at 4:41 PM, Mike Kerner <
> [hidden email]
> > >
> > >> wrote:
> > >>
> > >> If you have a mobile text field object, then have you looked at
> > >>> inputReturnKey?
> > >>>
> > >>>
> > >>> On Mon, Sep 18, 2017 at 4:17 PM, Alex Tweedly via use-livecode <
> > >>> [hidden email]> wrote:
> > >>>
> > >>> I'm sure there must be an easy way I'm missing ..... he said in hope
> > :-)
> > >>>>
> > >>>> I want a field to contain a single line of data - i.. no CRs.
> > >>>>
> > >>>> I've done the easy bit (a handler for returninfield).
> > >>>>
> > >>>> I can even do the moderate bit -  a 'pastekey' handler, and check
> for
> > >>>> CRs
> > >>>> in the clipboard - but that doesn't apply to mobile (or at least,
> the
> > >>>> dict
> > >>>> says it doesn't).
> > >>>>
> > >>>> Is there any way to handle it on mobile ?
> > >>>>
> > >>>> Thanks
> > >>>> Alex.
> > >>>>
> > >>>> _______________________________________________
> > >>>> 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
> > >>>>
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> On the first day, God created the heavens and the Earth
> > >>> On the second day, God created the oceans.
> > >>> On the third day, God put the animals on hold for a few hours,
> > >>>     and did a little diving.
> > >>> And God said, "This is good."
> > >>>
> > >>>
> > >>
> > >>
> > >
> > > _______________________________________________
> > > 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
> >
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
> _______________________________________________
> 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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
confuse people. It's a function of copying from his email app.

Bob S


> On Sep 21, 2017, at 05:59 , Mike Kerner via use-livecode <[hidden email]> wrote:
>
> what do the asterisks do?


_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
Yes, I was trying to be funny, but it didn't work like I was hoping...

On Thu, Sep 21, 2017 at 10:43 AM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

> confuse people. It's a function of copying from his email app.
>
> Bob S
>
>
> > On Sep 21, 2017, at 05:59 , Mike Kerner via use-livecode <
> [hidden email]> wrote:
> >
> > what do the asterisks do?
>
>
> _______________________________________________
> 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
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Alex Tweedly wrote:
 > I do not currently have "mobile text field objects" - all I have
 > are just standard LC fields, so returninfield is all I need for
 > the 'return' part of the problem - no need for 'inputReturnKey'.

If this is just for yourself then the following may not matter much,
since you know what to expect and can handle whatever you choose to make.

But if this app is for others to use, using a LiveCode-native field
instead of a mobile-native field will very quickly show why
mobile-native fields are important.

Ideally of course, given the central role editable text plays in apps,
there would be just one object that can work in the IDE and on the device.

And fortunately that was funded a while back:

Infinite LiveCode: Native Field Object
https://livecode.com/project/infinite-livecode-native-field-object/

IIRC that completion is dependent on the completion of some other
aspects of LCB which are still being refined, so in the meantime we need
to work with what we have, weighing the tradeoffs between LC-native
fields and mobile-native.

The biggest is how selection is handled.  LC-native fields will bring up
the device keyboard when entered, and you can type into them.  But
that's petty much it.  Designed as they were for the desktop, selection
is fundamentally different.

The mobile-native text editing experience users are accustomed to allows
them to drag-select text, or long-press to select a word, and once a
selection has been made handle controls appear at each end of the
selection run, which can be dragged to adjust the selection.

There's also a popup panel that the OS provides when a text selection is
active in a mobile-native field, offering a menu of options for common
commands like Cut, Copy, Paste, Select All, and sometimes Search and others.

When attempting to emulate mobile-native fields using LC-native fields,
you'll have to make all of those UI elements from scratch.  And since
clipboard control is not currently supported by LC on mobile as it is on
the desktop, any sort of copy and paste that would work between apps as
users expect would be difficult if not impossible to achieve.

But when using a mobile-native field, you get all that for free.

For a brief while I once considered trying to come up with a framework
for emulating mobile-native fields with LC-native fields.  It was
daunting enough to deal with the tedium of crafting the selection
handles, and the absence of integrated clipboard support ultimately
prompted me to stop and put my time into more productive tasks.

You're a very talented and nimble thinker, but I suspect you'll find
that until we get one field control that works in both the IDE and on
mobile devices, you'll have a much better time focusing on ways to use
mobile-native fields.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
Me too. :-)

Bob S


> On Sep 21, 2017, at 08:11 , Mike Kerner via use-livecode <[hidden email]> wrote:
>
> Yes, I was trying to be funny, but it didn't work like I was hoping...


_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
In reply to this post by Tom Glod via use-livecode
On 21/09/2017 16:14, Richard Gaskin via use-livecode wrote:

> Alex Tweedly wrote:
> > I do not currently have "mobile text field objects" - all I have
> > are just standard LC fields, so returninfield is all I need for
> > the 'return' part of the problem - no need for 'inputReturnKey'.
>
> If this is just for yourself then the following may not matter much,
> since you know what to expect and can handle whatever you choose to make.
>
> But if this app is for others to use, using a LiveCode-native field
> instead of a mobile-native field will very quickly show why
> mobile-native fields are important.
>
That's exactly what I've been missing - I've been fretting about one or
two details of LC-fields on mobile, not realizing that there are
overwhelming limitations that mean I should just forget about LC-native
fields if mobile is a primary target.

So now I need to go off and figure out the most appropriate way (for the
short term) to handle having different controls for different platforms.

So I've learnt a lot - but taken rather longer than I should have to
realize I was counting angels on the wrong pinheads :-)

Thanks to everyone for all the suggestions that helped to get me here.

Alex.

_______________________________________________
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: Constraining an input field's contents to be a single line.

Tom Glod via use-livecode
well, if you have tmc2, then native mobile fields are a breeze.  If you
don't, then they're still pretty easy once you make your first one.

On Thu, Sep 21, 2017 at 7:32 PM, Alex Tweedly via use-livecode <
[hidden email]> wrote:

> On 21/09/2017 16:14, Richard Gaskin via use-livecode wrote:
>
> Alex Tweedly wrote:
>> > I do not currently have "mobile text field objects" - all I have
>> > are just standard LC fields, so returninfield is all I need for
>> > the 'return' part of the problem - no need for 'inputReturnKey'.
>>
>> If this is just for yourself then the following may not matter much,
>> since you know what to expect and can handle whatever you choose to make.
>>
>> But if this app is for others to use, using a LiveCode-native field
>> instead of a mobile-native field will very quickly show why mobile-native
>> fields are important.
>>
>> That's exactly what I've been missing - I've been fretting about one or
> two details of LC-fields on mobile, not realizing that there are
> overwhelming limitations that mean I should just forget about LC-native
> fields if mobile is a primary target.
>
> So now I need to go off and figure out the most appropriate way (for the
> short term) to handle having different controls for different platforms.
>
> So I've learnt a lot - but taken rather longer than I should have to
> realize I was counting angels on the wrong pinheads :-)
>
> Thanks to everyone for all the suggestions that helped to get me here.
>
> Alex.
>
>
> _______________________________________________
> 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
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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