Toggling hilite of list field line
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Toggling hilite of list field line
Hi all,
sorry for the basic question, but i can't figure this one out :-/
I've set the "click to toggle" of a list field to true -- great, i can click to toggle the hilite and put the list field into a state where no lines are hilited.
However, what I'm looking for is a way to do this in script - is this possible?
apparently it's not possible to set the hilite of the selectedLine...
many thanks
Stam
sorry for the basic question, but i can't figure this one out :-/
I've set the "click to toggle" of a list field to true -- great, i can click to toggle the hilite and put the list field into a state where no lines are hilited.
However, what I'm looking for is a way to do this in script - is this possible?
apparently it's not possible to set the hilite of the selectedLine...
many thanks
Stam
Re: Toggling hilite of list field line
Hi Stam,
not sure, what exactly are you after?
But it surely will be scriptable!
Hint:
If you did not already, in LC preferences -> General
check -> Property labels are -> Name of Livecode property
Then you see the names of all properties in the inspector that you can use in scripts
and not just the description of that property.
Best
Klaus
not sure, what exactly are you after?
But it surely will be scriptable!
Hint:
If you did not already, in LC preferences -> General
check -> Property labels are -> Name of Livecode property
Then you see the names of all properties in the inspector that you can use in scripts
and not just the description of that property.
Best
Klaus
Re: Toggling hilite of list field line
Hi Klaus
I'd like to put a listField in a state where no lines are hilited - this is not the default state and unless you set 'click to toggle' it's not possible not to hilite some line or other.
The scenario where this is used is a listField with many options and a separate searchField; when the user types in the searchField it should find and select a line in the listField - however when no matches found, it should select none.
It's that last bit I can't figure out, hope that makes sense....
A simple example: A listField called "texts" and a search field called "search". A button with this script
Code: Select all
on mouseUp pButtonNumber
doFind the text of field "search"
end mouseUp
command doFind pText
find string pText in field "texts"
if the foundLine is not empty then
select the foundLine
else
//code to deselect the hilitedLine so no lines hilited
end if
end doFind
Re: Toggling hilite of list field line
I should also say i've tried examining all the properties of the list field as i often find things may not be obvious in the inspector panel. I ran this in the multiline messagebox:
This shows a detailed listing of all the properties, but still couldn't see what i could use...
Grateful for any help!
Stam
Code: Select all
put the properties of field "texts" into myArray
combine myArray using return and ": "
put myArray
Grateful for any help!
Stam
Re: Toggling hilite of list field line
AHA!

Code: Select all
...
set the hilitedlines of fld "your listfield here" to EMPTY
...
Re: Toggling hilite of list field line
Perfect, thank you!!!
I was sure I tried that, but but have done something silly as this now works!
I was sure I tried that, but but have done something silly as this now works!