iTunes-type alternate colored lines in scrolling list field
Sarah
sarahr at genesearch.com.au
Wed Mar 5 17:19:01 EST 2003
Greg,
Download Chipp's altFldHeader stack from
http://www.altuit.com/webs/altuit2/RunRev/Downloads.htm
This gives you a group of header buttons that allow you to resize the
columns of a field. You can also specify whether you want the button to
be active and if so, you can put a sort routine in each one, or set a
property that specifies the type of sort to do, and have a general sort
routine that uses this. If you store the settings for the last sort,
you can do reverse sorts if the same sort button is clicked a second
time.
Cheers,
Sarah
On Wednesday, March 5, 2003, at 07:52 pm, Greg Saylor wrote:
> Hello,
>
> I was very interested in this, because it's exactly what I want to
> do...
> But, I am wondering how can you do this so that it is even more like
> iTunes?... What I mean is, I need to be able to sort the various
> columns
> with the little vertical arrows depending on which field was sorted and
> how it was sorted... The fields I have are going to be either numeric,
> alphanumeric, and a date in the format of "03-02-2003"...
>
> Thanks so much!
>
> - 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
>>
>> 2) if you want pixel-per-pixel' scrolling, things get
>> a bit more complicated, but it is possible ; here's
>> the way I did it :
>> - create a pattern in your favourite painting app
>> - import it as an image
>> - create a rectangle the size of the field > 'Foo'
>> - set its lineSize to 0
>> - use the 'Colors' palette to set the
>> backgroundPattern of the rectangle to your imported
>> pattern
>> - group the rectangle > 'Bar'
>> - set the margins of group "Bar" to 0
>> - set the lockLocation of group "Bar" to true
>> - move the group behind the field
>> - set the field's opaque to false
>> Now a few more steps are needed to make it scroll
>> well:
>> - set the script of the field to :
>> on scrollbarDrag
>> set the scroll of group "Bar" to the scroll of me
>> end scrollbarDrag
>> on InitBkgnd
>> put the rect of graphic "Foo" into tBgRect
>> put the formattedHeight of me into tHeight
>> add (tHeight - item 4 of tRect - item 2 of tRect)
>> \
>> to item 4 of tRect
>> end InitBkgnd
>> - and use the message box to :
>> set the scroll of grp "Bar" to 1
>> set the scroll of fld "List" to 1
>> send "InitBkgnd" to fld "List"
>>
>> You may have to fiddle some positions a bit with
>> respect to the field margins, and you'll have to make
>> sure the list field has a fixed line height.
>>
>> Hope this helped,
>>
>> Jan Schenkel.
>
>
>
> _______________________________________________
> 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