Little Arrows, how they are working (and thank you Ken!)
Jan Schenkel
janschenkel at yahoo.com
Sun May 25 07:10:00 EDT 2003
--- François Cuneo <francois.cuneo at cuk.ch> wrote:
> >> Ken, thank you, I have founded it but...
> >> I have not understood how to work with this
> little arrows!!
> >> How can I do to script:
> >>
> >> If the key is up, then put 1 + 1 into tatsouin
> >> If the key is down then put 1 - 1 into tatsouin
> >>
> >> In fact, is it possible that somebody show me a
> little script
> >> in 4 lines about how little arrows are working?
> >
> > Actually, it doesn't increment or decrement values
> in a *variable*, but
> > in a field. So you do this:
> >
> > 1) Select the little arrows control from the
> Object library and click
> > "Place Object"
> > 2) Create a field next to the little arrows
> control that will hold the
> > value that the button will put there.
> > 3) Give the field a name (for example,
> "TestField")
> > 4) Open the properties palette for the little
> arrows control, go to
> > Custom Properties and set the cTargetField
> property to the name of your
> > field (in my case, "TestField")
> > 5) Open the properties palette for the field, go
> to Custom Properties
> > and add two properties: cMinValue and cMaxValue.
> In them, set the
> > minimum and maximum values (I used "1" for
> cMinValue and "100" for
> > cMaxValue).
> > 6) Set the script of the field to this:
> >
> > on closeField
> > end closeField
> >
> > That's it! Now choose the browse tool and the
> little arrows control will
> > increment or decrement the number in the field
> >
> > If you want to handle doing something after the
> number has been changed,
> > put it in the 'closeField' handler of the field.
> >
> > Hope this helps,
> Thank you very much Ken, it works, I have tried
> but!...... Hem...
>
> This Object Library is Little Arrows, yes, but not
> the little Arrows that we
> can create with the tools Palette.
>
> In fact, this Little Arrows in the tools Palette are
> "Scrollbar" category.
> This objects are very good because they are painted
> like the Aqua interface.
> So, I prefer to use it and... For me it's really
> important to understand how
> this Little Arrows (from the Tool Palette) are
> working.
>
> I have a review to write about Revolution, and I
> want all know...!:-)
> But for my application, this kind of little arrows
> are really important too.
>
> Thank you
>
> Françoois
>
Bonjour François,
As you had already found out, the little arrows are
actually scrollbar objects. So go to the Transcript
documentation ; use the 'Filter' filed at the top to
only show items which contan the word 'scrollbar'.
In this reduced list, you'll spot the functions
'scrollbarLineDec' and 'scrollbarLineInc' ; these are
the ones you're going to have to handle, as they'll be
sent when you click the 'up' and 'down' arrows
respectively.
Hope this helped,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the use-livecode
mailing list