[comp.sys.amiga] Getting right mouse button signals from Intuition

miker@laidbak.UUCP (Mike Roth) (01/15/87)

[ This is a better line-eater trap.  I'll be rich! ]


Here is a question for all you gurus out there (the ones who
aren't currently meditating, that is).


I am currently working on a program which has changable settings
on some lines.  I would like to be able to increment these lines
by pointing to them and hitting the right mouse button (the left
mouse button decrements).  I think this method is better than
hitting one of two arrow gadgets.

My problem is that when I hit the right mouse button, The screen title
bar changes.  I currently have MOUSEBUTTONS set as an IDCMP flag for
the window and get the SELECTUP and SELECTDOWN messages, but not the
MENUUP and MENUDOWN messages.  I don't use or need the menu facility
of Intuition.  My big question is:

How do you make Intuition send messages for MENUUP and MENUDOWN?


Thanks in Advance.


P.S.  I can sort of use MENUPICK, but it really doesn't send messages
      or treat the screen as I would like.

----------
Mike Roth  -  {ihnp4, allegra, sun}!laidbak!miker

chiu@princeton.UUCP (Kenneth Chiu) (01/15/87)

In article <838@laidbak.UUCP> miker@laidbak.UUCP (Mike Roth) writes:
>How do you make Intuition send messages for MENUUP and MENUDOWN?

You need to set RMBTRAP in the Window structure.  Check the IDCMP section
in the Intuition manual, or look at the include file.  It is not documented
very well in the manual.
-- 
Kenneth Chiu                                              UUCP: princeton!chiu
Princeton University Computer Science Department        BITNET: 6031801@PUCC

jesup@steinmetz.UUCP (01/16/87)

In article <838@laidbak.UUCP> miker@laidbak.UUCP (Mike Roth) writes:
>My problem is that when I hit the right mouse button, The screen title
>bar changes.  I currently have MOUSEBUTTONS set as an IDCMP flag for
>the window and get the SELECTUP and SELECTDOWN messages, but not the
>MENUUP and MENUDOWN messages.  I don't use or need the menu facility
>of Intuition.  My big question is:
>
>How do you make Intuition send messages for MENUUP and MENUDOWN?

The solution is to use RMBTRAP.  This will allow you to get messages for
the right mouse button as well as the left.  The thing to be careful for
is to remove the RMBTRAP when the mouse moves onto the menu bar.  This allows
the menus to be obtained when the mouse is on the menu bar.  This trick is
used in DPAINT and Egad, to name a few.  Normally, you never see anything from
the right mouse button, as Intuition eats it.
One other possibilty is to only enable RMBTRAP when the mouse is over one of
these items.
		Randell Jesup
		jesup@steinmetz.uucp (seismo!rochester!steinmetz!jesup)
		jesup@ge-crd.arpa

hobie@sq.UUCP (01/17/87)

[ The line eater is a myth! OPEN YOUR EYES AND BE FREE!!!! ]

Mike Roth (miker@laidbak.UUCP) writes:

>How do you make Intuition send messages for MENUUP and MENUDOWN?

	I believe that the IDCMP flag RMBTRAP (Right Mouse Button TRAP)
controls that sort of thing.  Look it up in the Intuition Manual in the
section on message passing.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Hobie Orris				|  "<vacuous pop tune quote>"
 SoftQuad Inc., Toronto, Ont.		|            or
 {ihnp4 | decvax | ? }!utzoo!sq!hobie	|  "<smug literary allusion>"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lines: 16

kaz@cadovax.UUCP (01/18/87)

In article <838@laidbak.UUCP> miker@laidbak.UUCP (Mike Roth) writes:
>I am currently working on a program which has changable settings
>on some lines.  I would like to be able to increment these lines
>by pointing to them and hitting the right mouse button (the left
>mouse button decrements).  I think this method is better than
>hitting one of two arrow gadgets.
>Mike Roth  -  {ihnp4, allegra, sun}!laidbak!miker

I just looked up the answer in the Intuition User interface document.
The answer is to set the RMBTRAP.  This window flag when set,
causes the right mouse button events to be trapped and broadcast as
events.  You can receive these events thru either the IDCMP or the
Console.

If you can, you might want to pick up a copy of the source to the
EGAD gadget editor.  It is a good example of how to use this flag
and just about all the other features of Intuition as well.


Kerry Zimmerman
#  {ucbvax,ihnp4,decvax}!trwrb!cadovax!kaz
#  cadovax!kaz@ucla-locus.arpa

miker@laidbak.UUCP (Mike Roth) (01/20/87)

<Oh great lineeater, here is my sacrifice>

I'd just like to thank everyone who responded to my query.  I now
have the mouse buttons working the way I want them to.  I don't
have a copy of the Intuition manual.  I have been getting by with
Compute!'s Amiga Programmers Guide.  It is quite handy, but obviously
leaves some things out.

I have not seen the Intuition manual in any stores.  Has it been
published (by AW maybe?) and generally available, or will I have to
order it from CA?  (I am obviously not a registered developer.)


Once again, thanks for the help.

---------
Mike Roth  -  {ihnp4, allegra, sun}!laidbak!miker

carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) (01/22/87)

In article <840@laidbak.UUCP> miker@laidbak.UUCP (Mike Roth) writes:
>
>I have not seen the Intuition manual in any stores.  Has it been
>published (by AW maybe?) and generally available, or will I have to
>order it from CA?  (I am obviously not a registered developer.)

   It is published by Addison-Wesley.  You can get it at big book
stores like Daltons or order it direct from A-W (617-944-8660).

   A-W publishes four of our manuals:
      Amiga Rom Kernel Exec
      Amiga Rom Kernel Libraries and Devices
      Amiga Intuition
      Amiga Hardware

   The AmigDOS Manual (3 dos manuals in one) is published by Bantam
(800-223-5780 except NY and Canada who call 212-765-6500).

carolyn
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Carolyn Scheppner -- CBM   >>Amiga Technical Support<<
                     UUCP  ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn 
                     PHONE 215-431-9180
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=