Check connection and timeout

2023-07-13 Thread Ludovic THEBAULT via use-livecode
Hello,

I use this code to check is there is an internet connection :

 tsNETSETTIMEOUTS 60,0,2000,6,5,1000

 put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
tRecvHeaders
   
   if tResult begins with "tsneterr:" then
  return false 
   else
  return true 
   end if
 

But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
have a 30 seconds timeout.

Is there an other settings ?

Thanks.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Convert date

2023-07-13 Thread Neville Smythe via use-livecode
Jacque: Nice! Particularly as a demonstration of the variety of ways to achieve 
an objective in LC and different coding styles. I’ll add the snippets to my own 
version.

The ISO date (aka sql date) format is my favourite because it avoids the 
ambiguity of the English/American ordering of day, month and mostly because it 
works for sorting. I could wish it were universally adopted.

Neville Smythe




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Convert date

2023-07-13 Thread ambassador--- via use-livecode
Neville Smythe wrote:
> I seem to have hallucinated that the built-in convert handler recognised
> the ISO date and dateTime formats (-MM-DD, -MM-DD 
> hh:mm:ss+-http://hh.ss, etc) but I must have written my own conversion
> routines in a former life.
> But one would have to ask… Why doesn’t it?
> After all, the original ISO 8601 standard was adopted 1988!

https://quality.livecode.com/show_bug.cgi?id=4636
 
-- 
 Richard Gaskin
 Fourth World Systems
 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread ambassador--- via use-livecode
Paul Dupuis wrote:
 
> I have a LC9 field object - just a scrolling field (not a list field)
with
> a lot of text. The user selects some text and then click a button
near
> the field. I want the selection to remain highlighted, but when you 
>
click outside the field the highlight goes away.

Any simple solutions
> to this. Some property I am just blanking on? In
another app, I've used
> the "selectionChanged" message to (1) set the
background color of
> the selection to a highlight color and store the
start and end characters
> as custom properties of the field. I'm hoping
there is an easier way I am
> just missing.
> OR
>

There should be a feature enhancement: set the 
> preserveHighlight of
field X to true
That keeps the highlighted selection
> unless or until you make a new one
in that field



 
https://quality.livecode.com/show_bug.cgi?id=3327
 
-- 
 Richard Gaskin
 Fourth World Systems
 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Paul Dupuis via use-livecode

On 7/12/2023 6:21 PM, Paul Dupuis via use-livecode wrote:
I have a LC9 field object - just a scrolling field (not a list field) 
with a lot of text. The user selects some text and then click a button 
near the field. I want the selection to remain highlighted, but when 
you click outside the field the highlight goes away.



Thanks to Richmond, Mark, and Jacque for your responses.

So, I actually need to note the position of the selected (i.e. char x to 
y) rather than the selected text itself.


Indeed, if you have text highlighted in a lock, scrolling text field 
(autohilite on) and click a button, the highlight does not go away. 
However, if you click on another field it does. I need a solution where 
the highlight appears to remain in the primary "Content" field no matter 
what else the user clicks on in terms of other UI actions.


So, it still seems the "best" way to do this is using the on 
selectioChanged message and getting the selectedChunk and if not empty 
and word 2 is not > word 4 (insertion point), then save word 2 as the 
start and word 4 as the end and change the background color of the 
selected range to the highlight color, clearing another of background color


This makes it appear that the selection remains, updates it when the use 
makes a new selection, but sacrifices any other use of background color 
for the text in the field (which I can live with)


Thanks all,

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Convert date

2023-07-13 Thread J. Landman Gay via use-livecode

On 7/13/23 3:19 AM, Neville Smythe via use-livecode wrote:

I seem to have hallucinated that the built-in convert handler recognised the 
ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) but 
I must have written my own conversion routines in a former life.

But one would have to ask… Why doesn’t it? After all, the original ISO 8601 
standard was adopted 1988!


I've been collecting handlers for this for some years. I have four now. I didn't note where the 
first two came from, but here's what I have:


on formatTime
  put the long time into tTime
  convert tTime to dateItems
  split tTime by ","
  return format("%02d:%02d:%02d",tTime[4],tTime[5],tTime[6])
end formatTime


function sqlDate pDate
  convert pDate to dateitems
  set the numberformat to "00"
  return merge("[[item 1 of pDate]]-[[item 2 of pDate + 0]]-[[item 3 of pDate + 
0]]")
end sqlDate



-- Mark Waddingham, sql date and time:

function convertDateTimeToISO pDateTime
  local tTimeZone
  convert pDateTime to internet date
  put the last word of pDateTime into tTimeZOne
  convert pDateTime to dateitems
  return format("%04d-%02d-%02d %02d:%02d:%02d%s", \
item 1 of pDateTime, item 2 of pDateTime, item 3 of pDateTime, \
item 4 of pDateTime, item 5 of pDateTime, item 6 of pDateTime, 
tTimeZone)
end convertDateTimeToISO


-- Klaus Major, using seconds:
function smpt_lite tSecs
   return format("%02d:%02d:%02d", tSecs div 3600, (tSecs mod 3600) div 60,
tSecs mod 60)
end smpt_lite

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread J. Landman Gay via use-livecode

On 7/13/23 2:58 PM, J. Landman Gay via use-livecode wrote:

On 7/13/23 1:18 PM, Mark Smith via use-livecode wrote:

Hi Paul, try “the selectedText".


Whaddya know...it works!

Another way is to turn off traversalOn in the button. That prevents the focus 
from changing.



Actually, I've been trying different button and field settings and no matter what I do, the 
selection doesn't go away It doesn't matter if I click a button or directly on the card. I'm 
not sure what changed because it didn't used to be that way.


LC 9.6.9.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Search for an app in Google Play Store

2023-07-13 Thread J. Landman Gay via use-livecode

On 7/11/23 2:44 PM, Klaus major-k via use-livecode wrote:

You could try writing to support and see if they can tell you what's wrong.


yes, worth a try, do you have the supports email address?


Sorry for the late reply, you may have found it already but you can write to 
support here:


Scroll to the middle of the page, there's a button.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Crazy question: is it possible/reasonable to use Python in LC?

2023-07-13 Thread Mike Kerner via use-livecode
there are no crazy questions
there is, however, bat-guano-crazy geoff canyon
anyway, i think you will have to write the parser, linker, lexical
analyzer, etc., and all the other pre-compiler stuff that you would
have to write for any language. i'm not aware of something like a DLL
for python.
even better, while we're wondering, wouldn't it be great if we could
implement any interpreted grammar? i'd love it, because our erp
software is written in a a BASIC-COBOL-Fortran thing. I could dump all
the 1970's-era tools for managing forms and databases and replace them
with something nicer.

On Thu, Jul 13, 2023 at 4:04 PM Geoff Canyon via use-livecode
 wrote:
>
> I've been playing with Python, and it has a lot of nice qualities, but a
> built-in GUI isn't one of them (no apologies to tkinter).
>
> So it would be interesting/nice to be able to open LC, add a button to a
> stack, and put some python into the script of that button and have it just
> work, with access to the rest of the LC stack/controls as usual.
>
> Obviously that's not possible, but how close can we come? I assume it would
> be possible to write a shell command to trigger a python script, but that
> seems complex and sub-optimal, especially when thinking about having to
> bundle together all the bits and bobs from the LC UI to pass as arguments
> to the Python script instead of having it able to just reference what it
> needs on the fly.
>
> Anyway, wondering if anyone else has thought about this.
>
> gc
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> 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
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Crazy question: is it possible/reasonable to use Python in LC?

2023-07-13 Thread Geoff Canyon via use-livecode
I've been playing with Python, and it has a lot of nice qualities, but a
built-in GUI isn't one of them (no apologies to tkinter).

So it would be interesting/nice to be able to open LC, add a button to a
stack, and put some python into the script of that button and have it just
work, with access to the rest of the LC stack/controls as usual.

Obviously that's not possible, but how close can we come? I assume it would
be possible to write a shell command to trigger a python script, but that
seems complex and sub-optimal, especially when thinking about having to
bundle together all the bits and bobs from the LC UI to pass as arguments
to the Python script instead of having it able to just reference what it
needs on the fly.

Anyway, wondering if anyone else has thought about this.

gc
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread J. Landman Gay via use-livecode

On 7/13/23 1:18 PM, Mark Smith via use-livecode wrote:

Hi Paul, try “the selectedText".


Whaddya know...it works!

Another way is to turn off traversalOn in the button. That prevents the focus 
from changing.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Mark Smith via use-livecode
Hi Paul, try “the selectedText".

Create a scrolling text field, call it fld1, and put a large amount of text in 
it.
Create 2 buttons: one with “on mouse down, answer “Hello World” and the other 
with “on mouse down, answer the selectedText of field “fld1”

Now highlight an area of text in fld1. Click either button, the highlight in 
the text does not go away. The first button responds with “Hello World” and the 
second responds with the highlighted text in fld1.

I am using LC 10 if that makes a difference, although just tested in 9.6.8 and 
it worked there as well. 

Mark

> On 12 Jul 2023, at 11:21 pm, Paul Dupuis via use-livecode 
>  wrote:
> 
> I have a LC9 field object - just a scrolling field (not a list field) with a 
> lot of text. The user selects some text and then click a button near the 
> field. I want the selection to remain highlighted, but when you click outside 
> the field the highlight goes away.
> 
> Any simple solutions to this. Some property I am just blanking on? In another 
> app, I've used the "selectionChanged" message to (1) set the background color 
> of the selection to a highlight color and store the start and end characters 
> as custom properties of the field. I'm hoping there is an easier way I am 
> just missing.
> 
> OR
> 
> There should be a feature enhancement: set the preserveHighlight of field X 
> to true
> That keeps the highlighted selection unless or until you make a new one in 
> that field
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Richmond via use-livecode

I just did this:

on mouseLeave
   put the selectedText of fld "f1" into fld "f2"
end mouseLeave

you can then do whatever you want with your button on the basis of the 
contents of fld "f2"


Best, Richmond.

On 13.07.23 20:20, Bob Sneidar via use-livecode wrote:

Correction:

on openField
put long id of the target into pField
if the savedChunk of pField is not empty then
   put the savedChunk of pField into tSelection
   select tSelection
Set the savedChunk of pField to empty
end if
pass openField
end openField



On Jul 13, 2023, at 10:12 AM, Bob Sneidar  wrote:


Untested

This in a frontScript:

on openField
   put long id of the target into pField
   set the selection to the savedChunk of pField — if you want to restore the 
last selection
   Set the savedChunk of pField to empty
   pass openField
end openField

on exitField
   put the long id of the target into pField
   set the savedChunk of pField to the selectedChunk
   pass exitField
end exitField

Bob S



On Jul 13, 2023, at 9:50 AM, William Prothero via use-livecode 
 wrote:

Folks,
A possible strategy is to change the color of a line in a field, when it is selected. 
There would need to be a script that could simply returns the content of a line of a 
specified color, changes the color to "unselected", or whatever your need 
requires. You could have multiple lines selected, and other variations as needed.

Just thinking.
Bill

William A. Prothero, PhD
Prof Emeritus, Dept of Earth Science
University of California, Santa Barbara


On Jul 13, 2023, at 9:06 AM, Craig Newman via use-livecode 
 wrote:

Paul.

I think that Bob S. is correct. The change in focus is sort of built into the 
engine, and a field cannot “remember” such a thing.

A fun kludge would be to create one or more overlays, however you like those to 
look, and apply them to the field of interest. These overlays can be managed in 
terms of their rects, depending on the formatted properties of the hilted line 
or lines. They can be shown and hidden as well.

I am struggling not to do this just for fun. So you do it, because I bet that 
the team has bigger fish to fry.

Craig


On Jul 13, 2023, at 11:27 AM, Bob Sneidar via use-livecode 
 wrote:

I do not see how that could work. In Windows, buttons can have the focus, which 
means a field would always lose it.

What I do when I need something like this is I save the selection (or 
selectedChunk or some such thing) as a property of the field upon exitField. 
You could even put that in a frontScript and reference the target. Then in the 
field script re-select the text upon enterField.

Bob S



On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
 wrote:

I have a LC9 field object - just a scrolling field (not a list field) with a 
lot of text. The user selects some text and then click a button near the field. 
I want the selection to remain highlighted, but when you click outside the 
field the highlight goes away.

Any simple solutions to this. Some property I am just blanking on? In another app, I've 
used the "selectionChanged" message to (1) set the background color of the 
selection to a highlight color and store the start and end characters as custom 
properties of the field. I'm hoping there is an easier way I am just missing.

OR

There should be a feature enhancement: set the preserveHighlight of field X to 
true
That keeps the highlighted selection unless or until you make a new one in that 
field


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode
Correction: 

on openField
   put long id of the target into pField
   if the savedChunk of pField is not empty then
  put the savedChunk of pField into tSelection
  select tSelection
   Set the savedChunk of pField to empty
   end if
   pass openField
end openField


> On Jul 13, 2023, at 10:12 AM, Bob Sneidar  wrote:
> 
> 
> Untested
> 
> This in a frontScript: 
> 
> on openField
>   put long id of the target into pField
>   set the selection to the savedChunk of pField — if you want to restore the 
> last selection
>   Set the savedChunk of pField to empty
>   pass openField
> end openField
> 
> on exitField
>   put the long id of the target into pField
>   set the savedChunk of pField to the selectedChunk
>   pass exitField
> end exitField
> 
> Bob S
> 
> 
>> On Jul 13, 2023, at 9:50 AM, William Prothero via use-livecode 
>>  wrote:
>> 
>> Folks,
>> A possible strategy is to change the color of a line in a field, when it is 
>> selected. There would need to be a script that could simply returns the 
>> content of a line of a specified color, changes the color to "unselected", 
>> or whatever your need requires. You could have multiple lines selected, and 
>> other variations as needed.
>> 
>> Just thinking.
>> Bill
>> 
>> William A. Prothero, PhD
>> Prof Emeritus, Dept of Earth Science
>> University of California, Santa Barbara
>> 
>>> On Jul 13, 2023, at 9:06 AM, Craig Newman via use-livecode 
>>>  wrote:
>>> 
>>> Paul.
>>> 
>>> I think that Bob S. is correct. The change in focus is sort of built into 
>>> the engine, and a field cannot “remember” such a thing.
>>> 
>>> A fun kludge would be to create one or more overlays, however you like 
>>> those to look, and apply them to the field of interest. These overlays can 
>>> be managed in terms of their rects, depending on the formatted properties 
>>> of the hilted line or lines. They can be shown and hidden as well.
>>> 
>>> I am struggling not to do this just for fun. So you do it, because I bet 
>>> that the team has bigger fish to fry.
>>> 
>>> Craig
>>> 
 On Jul 13, 2023, at 11:27 AM, Bob Sneidar via use-livecode 
  wrote:
 
 I do not see how that could work. In Windows, buttons can have the focus, 
 which means a field would always lose it. 
 
 What I do when I need something like this is I save the selection (or 
 selectedChunk or some such thing) as a property of the field upon 
 exitField. You could even put that in a frontScript and reference the 
 target. Then in the field script re-select the text upon enterField. 
 
 Bob S
 
 
>> On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
>>  wrote:
> 
> I have a LC9 field object - just a scrolling field (not a list field) 
> with a lot of text. The user selects some text and then click a button 
> near the field. I want the selection to remain highlighted, but when you 
> click outside the field the highlight goes away.
> 
> Any simple solutions to this. Some property I am just blanking on? In 
> another app, I've used the "selectionChanged" message to (1) set the 
> background color of the selection to a highlight color and store the 
> start and end characters as custom properties of the field. I'm hoping 
> there is an easier way I am just missing.
> 
> OR
> 
> There should be a feature enhancement: set the preserveHighlight of field 
> X to true
> That keeps the highlighted selection unless or until you make a new one 
> in that field
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your 
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Convert date

2023-07-13 Thread Mark Smith via use-livecode
Thanks Bob. Sounds very useful. How does one access (or locate) the master 
library?

Cheers,
Mark


Sent from my iPhone

> On Jul 13, 2023, at 4:24 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> I wrote a formatDate function years ago that called this "sql date". Maybe I 
> should rename it “ISO Date” or just add a case for it. There is also an “sql 
> time” format in the function formatTime. This way you can put format date(the 
> date, “sql date”) && formative(the time, “sql time”) to get an sql datetime 
> format for a database column. They should be in the Master Library.
> 
> I suppose a lot of things could be done by the engine, but as was discussed 
> years ago, what LC is NOT is a development environment that does almost 
> anything. What it IS is a development environment that has the TOOLS to do 
> almost anything.
> 
> Bob S
> 
> 
> On Jul 13, 2023, at 1:19 AM, Neville Smythe via use-livecode 
>  wrote:
> 
> I seem to have hallucinated that the built-in convert handler recognised the 
> ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) 
> but I must have written my own conversion routines in a former life.
> 
> But one would have to ask… Why doesn’t it? After all, the original ISO 8601 
> standard was adopted 1988!
> 
> Neville Smythe
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode

Untested

This in a frontScript: 

on openField
   put long id of the target into pField
   set the selection to the savedChunk of pField — if you want to restore the 
last selection
   Set the savedChunk of pField to empty
   pass openField
end openField

on exitField
   put the long id of the target into pField
   set the savedChunk of pField to the selectedChunk
   pass exitField
end exitField

Bob S


> On Jul 13, 2023, at 9:50 AM, William Prothero via use-livecode 
>  wrote:
> 
> Folks,
> A possible strategy is to change the color of a line in a field, when it is 
> selected. There would need to be a script that could simply returns the 
> content of a line of a specified color, changes the color to "unselected", or 
> whatever your need requires. You could have multiple lines selected, and 
> other variations as needed.
> 
> Just thinking.
> Bill
> 
> William A. Prothero, PhD
> Prof Emeritus, Dept of Earth Science
> University of California, Santa Barbara
> 
>> On Jul 13, 2023, at 9:06 AM, Craig Newman via use-livecode 
>>  wrote:
>> 
>> Paul.
>> 
>> I think that Bob S. is correct. The change in focus is sort of built into 
>> the engine, and a field cannot “remember” such a thing.
>> 
>> A fun kludge would be to create one or more overlays, however you like those 
>> to look, and apply them to the field of interest. These overlays can be 
>> managed in terms of their rects, depending on the formatted properties of 
>> the hilted line or lines. They can be shown and hidden as well.
>> 
>> I am struggling not to do this just for fun. So you do it, because I bet 
>> that the team has bigger fish to fry.
>> 
>> Craig
>> 
>>> On Jul 13, 2023, at 11:27 AM, Bob Sneidar via use-livecode 
>>>  wrote:
>>> 
>>> I do not see how that could work. In Windows, buttons can have the focus, 
>>> which means a field would always lose it. 
>>> 
>>> What I do when I need something like this is I save the selection (or 
>>> selectedChunk or some such thing) as a property of the field upon 
>>> exitField. You could even put that in a frontScript and reference the 
>>> target. Then in the field script re-select the text upon enterField. 
>>> 
>>> Bob S
>>> 
>>> 
> On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
>  wrote:
 
 I have a LC9 field object - just a scrolling field (not a list field) with 
 a lot of text. The user selects some text and then click a button near the 
 field. I want the selection to remain highlighted, but when you click 
 outside the field the highlight goes away.
 
 Any simple solutions to this. Some property I am just blanking on? In 
 another app, I've used the "selectionChanged" message to (1) set the 
 background color of the selection to a highlight color and store the start 
 and end characters as custom properties of the field. I'm hoping there is 
 an easier way I am just missing.
 
 OR
 
 There should be a feature enhancement: set the preserveHighlight of field 
 X to true
 That keeps the highlighted selection unless or until you make a new one in 
 that field
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Paul Dupuis via use-livecode
Thank your Bob, Craig, and William for the responses. It appears the way 
I have done it in the past is the "best" option. I was hoping there was 
some clever trick I don't know, but it is what it is. I'll do what I 
have done before. Thanks again.


On 7/12/2023 6:21 PM, Paul Dupuis via use-livecode wrote:
I've used the "selectionChanged" message to (1) set the background 
color of the selection to a highlight color and store the start and 
end characters as custom properties of the field.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread William Prothero via use-livecode
Folks,
A possible strategy is to change the color of a line in a field, when it is 
selected. There would need to be a script that could simply returns the content 
of a line of a specified color, changes the color to "unselected", or whatever 
your need requires. You could have multiple lines selected, and other 
variations as needed.

Just thinking.
Bill

William A. Prothero, PhD
Prof Emeritus, Dept of Earth Science
University of California, Santa Barbara

> On Jul 13, 2023, at 9:06 AM, Craig Newman via use-livecode 
>  wrote:
> 
> Paul.
> 
> I think that Bob S. is correct. The change in focus is sort of built into the 
> engine, and a field cannot “remember” such a thing.
> 
> A fun kludge would be to create one or more overlays, however you like those 
> to look, and apply them to the field of interest. These overlays can be 
> managed in terms of their rects, depending on the formatted properties of the 
> hilted line or lines. They can be shown and hidden as well.
> 
> I am struggling not to do this just for fun. So you do it, because I bet that 
> the team has bigger fish to fry.
> 
> Craig
> 
>> On Jul 13, 2023, at 11:27 AM, Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> I do not see how that could work. In Windows, buttons can have the focus, 
>> which means a field would always lose it. 
>> 
>> What I do when I need something like this is I save the selection (or 
>> selectedChunk or some such thing) as a property of the field upon exitField. 
>> You could even put that in a frontScript and reference the target. Then in 
>> the field script re-select the text upon enterField. 
>> 
>> Bob S
>> 
>> 
 On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
  wrote:
>>> 
>>> I have a LC9 field object - just a scrolling field (not a list field) with 
>>> a lot of text. The user selects some text and then click a button near the 
>>> field. I want the selection to remain highlighted, but when you click 
>>> outside the field the highlight goes away.
>>> 
>>> Any simple solutions to this. Some property I am just blanking on? In 
>>> another app, I've used the "selectionChanged" message to (1) set the 
>>> background color of the selection to a highlight color and store the start 
>>> and end characters as custom properties of the field. I'm hoping there is 
>>> an easier way I am just missing.
>>> 
>>> OR
>>> 
>>> There should be a feature enhancement: set the preserveHighlight of field X 
>>> to true
>>> That keeps the highlighted selection unless or until you make a new one in 
>>> that field
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Craig Newman via use-livecode
Paul.

I think that Bob S. is correct. The change in focus is sort of built into the 
engine, and a field cannot “remember” such a thing.

A fun kludge would be to create one or more overlays, however you like those to 
look, and apply them to the field of interest. These overlays can be managed in 
terms of their rects, depending on the formatted properties of the hilted line 
or lines. They can be shown and hidden as well.

I am struggling not to do this just for fun. So you do it, because I bet that 
the team has bigger fish to fry.

Craig

> On Jul 13, 2023, at 11:27 AM, Bob Sneidar via use-livecode 
>  wrote:
> 
> I do not see how that could work. In Windows, buttons can have the focus, 
> which means a field would always lose it. 
> 
> What I do when I need something like this is I save the selection (or 
> selectedChunk or some such thing) as a property of the field upon exitField. 
> You could even put that in a frontScript and reference the target. Then in 
> the field script re-select the text upon enterField. 
> 
> Bob S
> 
> 
>> On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
>>  wrote:
>> 
>> I have a LC9 field object - just a scrolling field (not a list field) with a 
>> lot of text. The user selects some text and then click a button near the 
>> field. I want the selection to remain highlighted, but when you click 
>> outside the field the highlight goes away.
>> 
>> Any simple solutions to this. Some property I am just blanking on? In 
>> another app, I've used the "selectionChanged" message to (1) set the 
>> background color of the selection to a highlight color and store the start 
>> and end characters as custom properties of the field. I'm hoping there is an 
>> easier way I am just missing.
>> 
>> OR
>> 
>> There should be a feature enhancement: set the preserveHighlight of field X 
>> to true
>> That keeps the highlighted selection unless or until you make a new one in 
>> that field
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode
I do not see how that could work. In Windows, buttons can have the focus, which 
means a field would always lose it. 

What I do when I need something like this is I save the selection (or 
selectedChunk or some such thing) as a property of the field upon exitField. 
You could even put that in a frontScript and reference the target. Then in the 
field script re-select the text upon enterField. 

Bob S


> On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode 
>  wrote:
> 
> I have a LC9 field object - just a scrolling field (not a list field) with a 
> lot of text. The user selects some text and then click a button near the 
> field. I want the selection to remain highlighted, but when you click outside 
> the field the highlight goes away.
> 
> Any simple solutions to this. Some property I am just blanking on? In another 
> app, I've used the "selectionChanged" message to (1) set the background color 
> of the selection to a highlight color and store the start and end characters 
> as custom properties of the field. I'm hoping there is an easier way I am 
> just missing.
> 
> OR
> 
> There should be a feature enhancement: set the preserveHighlight of field X 
> to true
> That keeps the highlighted selection unless or until you make a new one in 
> that field


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Convert date

2023-07-13 Thread Bob Sneidar via use-livecode
I wrote a formatDate function years ago that called this "sql date". Maybe I 
should rename it “ISO Date” or just add a case for it. There is also an “sql 
time” format in the function formatTime. This way you can put format date(the 
date, “sql date”) && formative(the time, “sql time”) to get an sql datetime 
format for a database column. They should be in the Master Library.

I suppose a lot of things could be done by the engine, but as was discussed 
years ago, what LC is NOT is a development environment that does almost 
anything. What it IS is a development environment that has the TOOLS to do 
almost anything.

Bob S


On Jul 13, 2023, at 1:19 AM, Neville Smythe via use-livecode 
 wrote:

I seem to have hallucinated that the built-in convert handler recognised the 
ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) but 
I must have written my own conversion routines in a former life.

But one would have to ask… Why doesn’t it? After all, the original ISO 8601 
standard was adopted 1988!

Neville Smythe

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Convert date

2023-07-13 Thread Neville Smythe via use-livecode
I seem to have hallucinated that the built-in convert handler recognised the 
ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) but 
I must have written my own conversion routines in a former life.

But one would have to ask… Why doesn’t it? After all, the original ISO 8601 
standard was adopted 1988!

Neville Smythe


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode