little arrows Increase/decrease a field value

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sat Oct 8 10:25:26 EDT 2005


Hi Bob,

Little arrows in Rev do not work as expected.
For instance, the thumb position that should be passed as a parameter  
with the scrollbarLineInc and scrollbarLineDec messages are not passed.
But the messages themselves are sent by the engine.
So you can write:

on scrollbarLineInc
   if fld "ButtonWidth" = 0 then exit scrollbarLineInc
   -- lower limit
   subtract 1 from fld "ButtonWidth"
end scrollbarLineInc
----------------------------
on scrollbarLineDec
   if fld "ButtonWidth" = 100 then exit scrollbarLineDec
   -- higher limit
   add 1 to fld "ButtonWidth"
end scrollbarLineDec

In addition, note that the messages are inverted: up arrow triggers  
the scrollbarLineDec(rease) message and the down one the  
scrollbarLineInc(rease) message :-)

Hope this helps.

Best Regards from Paris,

Eric Chatonet.

Le 8 oct. 05 à 14:07, rev at armbase.com a écrit :

> Hi All
>
> i've searched the docs on the little arrows (in the tools). I wanty  
> to increase
> the numeric value of a field using the little arrows at the side
>
> It seems that they are Scrollbars and A search for scrollbars says  
> use something
> like this.
> on scrollbarLineDec
>   Put field ButtonWidth into tBtnWidth
>   put (BtnWidth + 1) into BtnWidth
>   Put BtnWidth into field ButtonWidth
> end scrollbarLineDec
>
> on scrollbarLineInc
>     Put field ButtonWidth into tBtnWidth
>   put (BtnWidth -1) into BtnWidth
>   Put BtnWidth into field ButtonWidth
> end scrollbarLineInc
>
> These both fail (when the () are removed the don't work either)
>
> I would have thought that something as simple as this and in the  
> tools would
> have a section in the docs?
>
> Heeeelp. :-)
>
> Cheers
> Bob

----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        eric.chatonet at sosmartsoftware.com/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------




More information about the use-livecode mailing list