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 
> <use-livecode@lists.runrev.com> 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 
>> <use-livecode@lists.runrev.com> 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

Reply via email to