[comp.sys.atari.st] Drawing rubber-bands

Stefan_Rupp@ac2.maus.de (Stefan Rupp) (05/31/91)

Hello,

>It's easy enough to determine the start point by using the EventMulti
>loop to detect the mouse button's first click, but how does one keep
>track of the mouse cursor and draw to it AND know when the mouse button
>is clicked again?
>
>Is it necessary to drop out of the EventMulti loop and use lower-level
>facilities?

No! If you want to follow the path of your mouse-cursor, you may do a
event-multi call with parameter MU_M1 (Mouse-Event 1). Just set the width and
height of the rectangle to 1 pixel and if you move the mouse and the cursor
leaves the rectangle, you'll recieve a MU_M1-Event.

Ciao,
     struppi

harryk@bucsf.bu.edu (Harry Karayiannis) (06/02/91)

In article <5753@ac2.maus.de> Stefan_Rupp@ac2.maus.de (Stefan Rupp) writes:
>
>Hello,
>
>>It's easy enough to determine the start point by using the EventMulti
>>loop to detect the mouse button's first click, but how does one keep
>>track of the mouse cursor and draw to it AND know when the mouse button
>>is clicked again?
>>
>>Is it necessary to drop out of the EventMulti loop and use lower-level
>>facilities?
>
>No! If you want to follow the path of your mouse-cursor, you may do a
>event-multi call with parameter MU_M1 (Mouse-Event 1). Just set the width and
>height of the rectangle to 1 pixel and if you move the mouse and the cursor
>leaves the rectangle, you'll recieve a MU_M1-Event.
>

Or you can use the AES function rubbox() that does the whole job for you
(note that some compilers, such as Laser C, call the function
 rubberbox()
)

===============================================================================
			     Harry Karayiannis          Post:
      ||   |#   ||					  15 N.Beacon, #316
     |#|  ||#|  |#|	     Boston University		  Allston, MA 02134
     |#|  ||#|  |#|	     Computer Science Dpt.	  U.S.A.
    |##|  ||#|  |##|				        _______________________
    ||#|  ||#|  ||#|				       |INTERnet:
   ////   ||||   \\\\	     % fortune -o	       |  harryk@bucsf.bu.edu
 /////    ||||    \\\\\	     "Hackers do it with       |BITnet:
///// ATARI ST     \\\\\      fewer instructions"      |  cscrzcc@buacca.bu.edu
=======================================================|_______________________