Hi Gabrielle,

That is great Gabrielle .... it wasnt just me going mad then !!!
Have you submitted this patch for the consideration as part of vid 1.3 ?


The updated area/scroller program is as follows :

rebol [
    title: "Area with scroller"
    author: "Phil Bevan"
    date: 10-Dec-2003
    version 0.0.2
]

stylize/master
[
    Slider: Slider with [
        use [c] [
            c: second :redrag
            either 15470763 = checksum mold c [
                insert c [state: none]
            ] [print "CANNOT APPLY SLIDER PATCH!"]
        ]
    ]
    Scroller: Scroller with [
        use [c] [
            c: second :redrag
            either 15470763 = checksum mold c [
                insert c [state: none]
            ] [print "CANNOT APPLY SCROLLER PATCH!"]
        ]
    ]
]

pos-scroll: func [tx sc /local tsize ts-max tmp] [
    tsize: size-text tx                                  ; calculate size of text
    either tsize/y <= tx/size/y                          ; is text is smaller 
    [sc/redrag 1 sc/data: 0]                             ; set dagger to 1, slider 
data to 0
    [
        sc/redrag tx/size/y / tsize/y                    ; set dagger size  = (area y 
size)/(text y size)
        show sc
        ts-max: tsize/y - tx/size/y                      ; ts-max = maximum value of 
top of dagger
        tmp: min 1 (- tx/para/scroll/y / ts-max)         ; calculate slider position
        sc/data: tmp                                     ; set slider poition
    ]
    show sc                                              ; show scroller
]

lv-lay: layout [
    space 0
    across
    tx: area 400x200 feel [ 
        engage: func [face action event] [
            ctx-text/edit/engage face action event
            if all [event/type = 'key] [pos-scroll tx scrl]
        ]
    ]
    scrl: scroller 16x200 [scroll-para tx scrl]
]

pos-scroll tx scrl                                       ; set initial dagger size
view lv-lay



> 
> === Original Message ===
> 
> 
> Hi Phil,
> 
> On Thursday, December 11, 2003, 4:41:52 AM, you wrote:
> 
> puc> Does anyone know why I had to insert the ugly line
> puc>  if all [sl/data = 1 tmp = 1] [tmp: 0.999]
> puc> in this code.
> 
> IIRC this is a workaround for a bug in slider/redrag.
> 
> I use this patch that fixes the bug:
> 
>         Slider: Slider with [
>             use [c] [
>                 c: second :redrag
>                 either 15470763 = checksum mold c [
>                     insert c [state: none]
>                 ] [print "CANNOT APPLY SLIDER PATCH!"]
>             ]
>         ]
>         Scroller: Scroller with [
>             use [c] [
>                 c: second :redrag
>                 either 15470763 = checksum mold c [
>                     insert c [state: none]
>                 ] [print "CANNOT APPLY SCROLLER PATCH!"]
>             ]
>         ]
> 
> Regards,
>    Gabriele.
> -- 
> Gabriele Santilli <[EMAIL PROTECTED]>  --  REBOL Programmer
> Amiga Group Italia sez. L'Aquila  ---   SOON: http://www.rebol.it/
> 
> -- 
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
> 
> 

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to