[futurebasic] Re: getting mouse to do more work

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

From: BMichael <BMichael@...>
Date: Sun, 25 Jan 1998 19:19:44 EST
>Does anybody have any suggestions on how to add 'invisible buttons' that 
>stay invisible?

Sure... just don't use buttons! You can get the "x,y" location of a mouse 
click and base your responses on that, using the single-click event 
handler, or you can create "regions" on screen and test for whether the 
x-y position was within the region. (Same thing, only you don't have as 
much calculation in the event handler.)

For example, if you wanted a click anywhere in the "right half" of the 
screen to be "go to next page" and a click anywhere in the "left half" to 
be "go to prior page" _unless_ the mouse was at the top, in which case 
you want to quit... I'd do something like this;

DIM mouseX,mouseY,screenMidX
mouseX = MOUSE(_horz)
mouseY = MOUSE(_vert)
screenMidX = SYSTEM(_scrnWidth) / 2
LONG IF mouseX > screenMidX
  INC(gPg%)
  FN pageChange
XELSE
  LONG IF mouseY < 20        'at top of screen
    gProgramEnds% = _zTrue
  XELSE
    DEC(gPg%)
    FN pageChange
  END IF
END IF     

Bill