[futurebasic] Re: [FB] Scroll With Up & Down Arrows

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Tue, 19 Oct 1999 22:03:33 -0500

Jim Henson wrote:

> Mornin' All,
>
> I have a wild desire ..
>
> Is it possible to "Train" the up & down arrows to scroll a scroll btn ..

Jim--

Here's a demo that does just that:

_upArrow = 30
_downArrow = 31
_scrollMin = 0                                    'change as required
_scrollMax = 20                                   'change as required
'---------------------------------
LOCAL FN DoDialog
  evnt = DIALOG(0)
  id = DIALOG(evnt)
  SELECT CASE evnt
    CASE _btnClick
      '(This event triggered when user moves
      'scroll thumb with mouse.  Just note the
      'new position and display it in the edit field.)
      EDIT$(1) = STR$(BUTTON(1))
    CASE _evKey
      LONG IF id = _upArrow OR id = _downArrow
        thumb = BUTTON(1)                         'read current position
        SELECT CASE id
          CASE _upArrow
            IF thumb > _scrollMin THEN DEC(thumb)
          CASE _downArrow
            IF thumb < _scrollMax THEN INC(thumb)
        END SELECT
        SCROLL BUTTON 1, thumb                    'set new position
        EDIT$(1) = STR$(thumb)
      END IF
    CASE _wndClose
      END
  END SELECT
END FN
'=================================
WINDOW 1, "", (0,0)-(100,400), _docNoGrow
current = _scrollMin
SCROLL BUTTON 1, current, _scrollMin, _scrollMax, 5, (42,10)-(58,350),
_scrollOther
TEXT _sysFont, 12
EDIT FIELD 1, "0", (10,370)-(90,390), _statNoFramed, _centerJust
ON DIALOG FN DoDialog
DO
  HANDLEEVENTS
UNTIL _false