iTunes-type alternate colored lines in scrolling list field (Jan Schenkel)

valetia at mac.com valetia at mac.com
Wed Mar 5 07:08:01 EST 2003


Hi Jan,

I can't seem to get the patterns to line up properly with the textHeight of
the field.

Do you have examples of combinations of pattern dimensions and textHeights
that are known work together? (Or perhaps a method of calculating these?)

I've been trying to go with 16x16 since that's what the docs are
recommending for cross-platform compatibility, but none of the textHeight
integers seem to fit the patterns...

Valetia



> From: Jan Schenkel <janschenkel at yahoo.com>
> Reply-To: use-revolution at lists.runrev.com
> Date: Wed, 5 Mar 2003 03:47:33 -0800 (PST)
> To: use-revolution at lists.runrev.com
> Subject: Re: iTunes-type alternate colored lines in scrolling list field (Jan
> Schenkel)
> 
> 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/
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list