[futurebasic] Re: [FB] scrolling with cursor-arrows and other keys

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

From: Joe Lewis Wilkins <PepeToo@...>
Date: Tue, 19 Oct 1999 18:09:10 -0700
Jim Henson wrote:

> and them there F Keys .. A BIGGER MYSTERY ..

Jim here' a of FN I use to use FKeys. Obviously, you'll need to provide the
action!

LOCAL FN doFKeys (x%)                             '(x = vKeyCode%)
  DIM result%
  'See Table 4-1 on page 30 in "Extending the Macintosh Toolbox".
  'Counting starts with A = 0, C = 8, etc.
  LONG IF gCurrentBk% = 0 AND (x% <> 97 AND x% <> 96) AND x% <> 115
    SOUND "OpSound"
    EXIT FN
  END IF
  TEXT _geneva,10,0
  SELECT x%                                       'Which fKey
    CASE 122                                      '1
     'The buttons do the same thing as the FKeys, so they get hilited!
      BUTTON #_waterTypeBtn,_markedBtn
      FN doWaterTypeBtn
      BUTTON #_waterTypeBtn,_activeBtn
    CASE 120                                      '2
      BUTTON #_waterSizeBtn,_markedBtn
      FN doWaterSizeBtn
      BUTTON #_waterSizeBtn,_activeBtn
    CASE 99                                       '3
      BUTTON #_coolerTypeBtn,_markedBtn
      FN doCoolerTypeBtn
      BUTTON #_coolerTypeBtn,_activeBtn
    CASE 118                                      '4
      BUTTON #_cupTypeBtn,_markedBtn
      FN doCupTypeBtn
      BUTTON #_cupTypeBtn,_activeBtn
    CASE 96                                       '5
      BUTTON _IDsFBtn,_markedBtn
      FN doIDs ("Product")
      DELAY 200
      BUTTON _IDsFBtn,_activeBtn
    CASE 97                                       '6
      BUTTON _EquipmentFBtn,_markedBtn
      FN doOtherRefs(_iEquipment,_false)
      DELAY 200
      BUTTON _EquipmentFBtn,_activeBtn
    CASE 98                                       '7
      BUTTON _LocationsFBtn,_markedBtn
      FN doOtherRefs(_iLocations,_false)
      DELAY 200
      BUTTON _LocationsFBtn,_activeBtn
    CASE 100                                      '8
      BUTTON _NamesFBtn,_markedBtn
      FN doOtherRefs(_iNames,_false)
      DELAY 200
      BUTTON _NamesFBtn,_activeBtn
    CASE 101                                      '9
      BUTTON _HazardsFBtn,_markedBtn
      FN doOtherRefs(_iHazards,_false)
      DELAY 200
      BUTTON _HazardsFBtn,_activeBtn
    CASE 109                                      '10
      BUTTON _MemosFBtn,_markedBtn
      FN doOtherRefs(_iMemos,_false)
      DELAY 200
      BUTTON _MemosFBtn,_activeBtn
    CASE 103                                      '11
      BUTTON _ChkRecFBtn,_markedBtn
      FN doChkRecord(_iChkRecord,_false)
      DELAY 200
      BUTTON _ChkRecFBtn,_activeBtn
      '-----------------------------------------------
    CASE 111                                      '12
      FN doHelp(0)
    CASE 105                                      '13
      BUTTON #_cutEntryBtn,_markedBtn
      FN doCutEntry
      DELAY 200
      BUTTON #_cutEntryBtn,_activeBtn
    CASE 107                                      '14
      BUTTON #_copyEntryBtn,_markedBtn
      FN doCopyEntry
      DELAY 200
      BUTTON #_copyEntryBtn,_activeBtn
    CASE 113                                      '15
      BUTTON #_pasteEntryBtn,_markedBtn
      FN doPasteEntry
      DELAY 200
      BUTTON #_pasteEntryBtn,_activeBtn
      '-----------------------------------------------
    CASE 114                                      'help
      FN doHelp(0)
    CASE 115   : FN doRouteStatus(_true)          'home
    CASE 116   : EDIT FIELD #_cupPriceEF + 4      'page up
    CASE 117   : SOUND "OpSound"                  'delete forward
    CASE 119   : FN doLockingLine1                'end
    CASE 121   : FN the1stBlankDateLine%          'page down
  END SELECT
  TEXT _monaco,9,0
END FN                                            'FN doFKeys

 Following is just a part of the FN (called from the Main Event Loop)
that calls FN doFKeys

  SELECT macEvnt%
    CASE _keyDwnEvt
      vKeyCode% = PEEK (EVENT + _evtMessage + 2)
      LONG IF vKeyCode% > 95 AND vKeyCode% < 123
        gWasFKey% = _true
        FN doFKeys (vKeyCode%)
      XELSE

If you have any questions, please let me know.

Joe Wilkins