Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!ur-tut!dpvc From: dpvc@ur-tut.UUCP (David Cervone) Newsgroups: comp.sys.amiga Subject: Re: proportional gadgets Message-ID: <1244@ur-tut.UUCP> Date: Tue, 28-Apr-87 17:38:44 EDT Article-I.D.: ur-tut.1244 Posted: Tue Apr 28 17:38:44 1987 Date-Received: Thu, 30-Apr-87 03:19:03 EDT References: <3294@jade.BERKELEY.EDU> Reply-To: dpvc@tut.cc.rochester.edu.UUCP (Davide Cervone) Organization: Univ. of Rochester Computing Center Lines: 55 In article <3294@jade.BERKELEY.EDU> spencer@eris.BERKELEY.EDU (Randy Spencer) writes: > I am >working on that word processing project and I can't seem to figure >out how to let the user press in that area outside that gadgets knob >and have the mouse button repeat. I want to let the use scroll down >by pressing the mouse button down with the pointer near the bottom, >but now it only moves one window per click. > >If there are any ideas out there, please fill me in on them... > >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >Randy Spencer P.O. Box 4542 Berkeley CA 94704 (415)284-4740 Well, here's an idea: you set the GADGIMMEDIATE flag in the scroll gadget, then, when the gadget is hit, you get the message right away. When you receive the message, check to see if the KNOBHIT flag is set. If it is, ignore the hit and wait for the gadget to be releases (you also have RELVERIFY set, as usual). If KNOBHIT is not set, then the user has hit in one of the other areas of the gadget. You can tell which by comparing the current knob position to the previous position (which you have stored in a variable somewhere; you could use the input event's MouseX and MouseY fields, but that becomes complicated, as the knob has ALREADY been moved, and isn't were it used to be). When you know which way to move, scroll that direction. You've probably already gotten this far without me, but here's the trick: when you've finished with your scroll, check to see if the SELECTED flag is set in the scroll gadget's Flag field. If it is, the user is still holding down the button, so you should continue to scroll. When he lets go, SELECTED will no longer be set, so you stop scrolling and go back to waiting for more messages. If the scrolling happens too fast (it never does, though), you could call Delay() to slow it down a bit. When the user lets go, you will still receive a RELVERIFY message for the gadget. When you get a RELVERY you should check for KNOBHIT. If it was hit, then process the scroll as though the user moved the knob (that's what he did). If KNOBHIT is not set, then ignore the event, since you've already taken care of it above. I thank that shoudl work. If not, I have done it, and I acn go back and look to see in more detail what I did. Someone asked a question about MOUSEBUTTON messages and perportional gadgets a while back, and I just remembered something about that. If you have a RELVERIFY gadget, and the user presses the gadget, then moves the mouse away from the gadget (it becomes de-selected), and then lets go, you get a mouse up message. If he lets go over the gadget, you get the RELVERIFY message. In this way, you can get a mouse up with no mouse down. I don't remember whether the gadget also has to be GADGIMMEDIATE, or whether it makes any difference. I think it does. I'll have to go back and try it out again... Anyway, hope this is useful to someone. Davide P. Cervone University of Rochester DPVC@UORDBV.BITNET dpvc@tut.cc.rochester.edu dpvc@ur-tut.UUCP