Field highlited

Mark Smith marksmithhfx at gmail.com
Fri Jul 14 12:14:19 EDT 2023


BTW, is there a way of determining the default highlight colour? When I select some text in a field it highlights to a light blue color, but I can’t find where that color is set.

Thanks
Mark


> On 13 Jul 2023, at 11:01 pm, Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list