Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: scrolling pane and scroller bar control
Pages: [1] Print
Author Topic: scrolling pane and scroller bar control  (Read 156 times)
dragoncity
Newbie
*
Offline Offline

Posts: 3


View Profile
scrolling pane and scroller bar control
« on: August 07, 2008, 09:28:25 PM »

Hi, I'm trying to write a data entry form with many fields, this form is longer than a typical
monitor viewing area.
Creating the form is easy, but I cannot work out how to scroll the whole form 'up/down'
when the user TAB's out of the last showing field bottom and display the 'hidden' fields.
Rebol actually does TAB to the next field and accepts data entry but you cannot see it
without manually moving the scroll slider.

How do I programmatically make the form 'move' up/down ? and sync the slider ?
 I've tried "all" the example code I can find and none seem to do the trick :-)

In the attached (modified cookbook-scroller.r) program I've added a few fields to illustrate the
problem. My need is for rapid data entry and using the mouse is really not a option, The program accepts user data, user TABS to navigate to next field, form slides as necessary, upon last field, data is saved, form cleared, cursor placed at first field, data entry continues.

Thanks for any ideas.

;; ===============================
  rebol ["cookbook-scroller2.r"]
  sub-panel: layout [
        across origin 5
        style label text bold right 60
        backcolor tan
        h2 leaf "Scrolling Sub Panel" return
        label "Name:" f1: field return
        label "Email:" f2: field return
        label "Info:" f3: area wrap return
        label "Month:"
        l1: text-list data system/locale/months return
        label "Day:" s1: slider 200x20 return
        label
        button "Submit"
        button "Cancel" [quit]
    ]

    out: layout [
        across
        h3 "Panel Scrolling Example" return
        space 0
        p1: box 300x300 coal frame black
        s1: scroller 16x300 [scroll-panel-vert p1 s1]
        return
        s2: scroller 300x16 [scroll-panel-horz p1 s2]
        return
    ]

    p1/pane: sub-panel

    scroll-panel-vert: func [pnl bar][
        pnl/pane/offset/y: negate bar/data *
            (max 0 pnl/pane/size/y - pnl/size/y)
        show pnl
    ]

    scroll-panel-horz: func [pnl bar][
        pnl/pane/offset/x: negate bar/data *
            (max 0 pnl/pane/size/x - pnl/size/x)
        show pnl
    ]

    update-panel: func [pnl vbar hbar] [
        pnl/pane/offset: 0x0
        s1/data: s2/data: 0
        vbar/redrag pnl/size/y / pnl/pane/size/y
        hbar/redrag pnl/size/x / pnl/pane/size/x
        show [pnl vbar hbar]
    ]

    update-panel p1 s1 s2
    view out
;; ============
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 66

Rebol veteran


View Profile WWW
Re: scrolling pane and scroller bar control
« Reply #1 on: November 19, 2008, 01:58:40 AM »

Hi,

I made a SCROLL-PANEL style and a FOCUS-SYSTEM-PATCH which work together to give you the functionality you're asking for.
http://anton.wildit.net.au/rebol/gui/scroll-panel.r
http://anton.wildit.net.au/rebol/patch/focus-system-patch.r

To see it working:
do http://anton.wildit.net.au/rebol/gui/demo-scroll-panel.r
do http://anton.wildit.net.au/rebol/gui/style-gallery.r
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: scrolling pane and scroller bar control
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2008, 09:11:45 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2315 Posts in 597 Topics by 4204 Members
Latest Member: hledamka.com

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc