paul at researchware.com
Fri Jul 14 12:38:58 EDT 2023
Use the effective keyword as in:
put the effective hiliteColor of field X into tHiliteColor
It will figure out the color by inheritance. If you just put the
hiliteColor of field X (without it being set specifically for field X)
your get empty
On 7/14/2023 12:14 PM, Mark Smith wrote:
> 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.
>> 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:
More information about the use-livecode