[futurebasic] Mouses in Windows

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: "Yates, Phil" <YATESP@...>
Date: Wed, 29 Apr 98 13:34:00 PDT
Code snippets to track what's what with your windows and where your mouse is :
Everything starting with a little "g" is a global. I create a window called 
"debug" which allows me to track everything going on as the programs starts 
up, runs, and terminates. Hope this helps someone, and allows bowerbid to 
track his mouse.

' In the Dialog event :

    CASE _cursEvent
      LONG IF DialogIdent = 0
        gMouseWindow = 0
        gMouseState = _MouseNotInWindow
      END IF
      '
    CASE _cursOver
      gMouseState = _MouseInWindow
      gMouseWindow = DIALOG(_cursEvent)
      SELECT DialogIdent
        CASE = 0
          gMouseField = 0
          gMouseButton = 0
        CASE < 0
          gMouseState = _MouseInField
          gMouseField = ABS(DialogIdent)
          gMouseButton = 0
        CASE > 0
          gMouseState = _MouseInButton
          gMouseButton = ABS(DialogIdent)
          gMouseField = 0
      END SELECT

' The event Loop :

DO
  HANDLEEVENTS
  FN TrackWindow
UNTIL gTheCowsComeHome

' In the INCL file or wherever

LOCAL
DIM ActWin,OutWin
LOCAL FN TrackWindow
  LONG IF gWinState(_DebugWindow) = _WinOpen        : ' User defined constant
    TEXT _monaco,9,0,0
    LONG COLOR 0,0,0
    ActWin = WINDOW (_ActiveWnd)
    OutWin = WINDOW (_OutputWnd)
    WINDOW OUTPUT _DebugWindow
    TEXT _monaco,9,0,0
    CALL MOVETO (10,30)
    PRINT "Act Win =  ";ActWin;".  Out Win = ";OutWin;"                     ";
    CALL MOVETO (10,45)
    PRINT "Mouse State = ";gMouseState;
    PRINT " Window =  ";gMouseWindow;" Field ";gMouseField
    WINDOW OUTPUT OutWin
  END IF
END FN

Regards All,

Phil Yates.

PS. I get my _very own_ G3/266 Minitower next week. I will now be able to 
crash programs over three times faster than I can now. Is this progress or 
what !!