iTunes-type alternate colored lines in scrolling list field (Jan Schenkel)
Jan Schenkel
janschenkel at yahoo.com
Wed Mar 5 06:51:01 EST 2003
Hi Greg,
Now I remember what I thought afterwards I should have
added to this scenario:
- make TWO patterns, one where the white is on top and
the blue below, and vice versa.
- change the script slightly to :
constant kPatternOneID = "456789"
constant kPatternTwoID = "987654"
-- better change these to the correct image IDs
on scrollbarDrag
put the scroll of me into tScroll
put the effective textHeight of me into
tLineHeight
if (tScroll MOD tLineHeight) is not 0 then
set the scroll of me to \
((tScroll DIV tLineHeight) * tLineHeight)
end if
-- update the background pattern
put (tScroll MOD tLineHeight) MOD 2 into tOddEven
if tOddEven = 0 then
set the backgroundPattern of me to kPatternOneID
else
set the backgroundPattern of me to tPatternTwoID
end if
end scrollbarDrag
Hope this cleared a few things up,
Jan Schenkel.
--- Greg Saylor <gsaylor at net-virtual.com> wrote:
> Hi Jan,
>
> Sorry for a second email on the same subject --
> hopefully this won't
> cause confusion for you.. I did what you said below
> and it works except
> that the pattern does not seem to scroll when the
> field scrolls... Am I
> doing something wrong or did I miss something
> important?..
>
> - Greg
>
> >Hi Valetia,
> >
> >There are two ways to go, depending on what you
> want.
> >1) if you're okay with 'line-per-line' scrolling of
> >your field, you can simply:
> >- create a pattern in your favourite painting app
> >- import it as an image
> >- use the 'Colors' palette to set the
> >backgroundPattern of the field to your imported
> >pattern
> >- set the script of the field to :
> > on scrollbarDrag
> > put the scroll of me into tScroll
> > put the effective textHeight of me into
> >tLineHeight
> > if (tScroll MOD tLineHeight) is not 0 then
> > set the scroll of me to \
> > ((tScroll DIV tLineHeight) * tLineHeight)
> > end if
> > end scrollbarDrag
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
More information about the use-livecode
mailing list