Disable/Enable selected lines in a field
Rob Cozens
rcozens at pon.net
Wed Mar 3 10:13:46 EST 2004
Hi Glen,
>I have two fields where a user hilites single or multiple lines in
>field "aChoiceList" and then presses a button "Yes" which copies the
>selected lines into field "aSelectedList".
>
>What I am wanting to do is to some how gray out the lines and
>disable them from being selected in field "aChoiceList" that now
>show in the field "aSelectedList.
>
>If the user selects lines in the field "aSelectedList and clicks
>another button "return" then the lines are removed from the field
>"aSelectedList and the associated lines in the field "aChoiceList"
>become ungrayed and available to select again in the future.
>
Have you checked out the possibility of setting the textcolor of the
lines instead of the hilite?
>on mouseUp
> lock screen
put return&(fld "aSelectedList") into previousSelections
get fld "aChoiceList"
repeat with x = 1 to the number of lines of it
/* I don't think "repeat for each line aLine in..."
gets you the textColor*/
if the textColor of line x of fld "aChoiceList" is not grey
then next repeat
if offset(cr&(line x of it)&cr,previousSelections)<>0 then next repeat
> put line x of it & cr after fld "aSelectedList"
> end repeat
>
> unlock screen
>end mouseUp
>
To select" a line, set its textColor to grey; to deselect it, set the
textColor to empty.
--
Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.net/who.htm
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list