If the gact_followmouse flag is set for a gadget, the application will receive mouse movement broadcasts as long as the gadget is active. This section covers the behavior of proportional, boolean and string gadgets, although there are major caveats in some cases: * Unlike idcmp_gadgetup and idcmp_gadgetdown intuimessages, the iaddress field of an idcmp_mousemove intuimessage does not point to the gadget. The application must track the active gadget (this information is readily obtained from the IDCMP_GADGETDOWN message) instead of using the IAddress field. Right Wrong ----- ----- imsg=GetMsg(win->UserPort); imsg=GetMsg(win->UserPort); class=imsg->Class; class=imsg->Class; code=imsg->Code; code=imsg->Code; /* OK */ /* ILLEGAL ! */ iaddress=imsg->IAddress; gadid=((struct Gadget *) imsg->IAddress)->GadgetID; ReplyMsg(imsg); ReplyMsg(imsg); Using the code in the left column, it is acceptable to get the address of a gadget with gadid=((struct Gadget *)iaddress)->GadgetID but only after you have checked to make sure the message is an idcmp_gadgetup or idcmp_gadgetdown. * boolean gadgets only receive mouse messages if both gact_relverify and gact_followmouse are set. those cases described below with GACT_RELVERIFY cleared do not apply to boolean gadgets. * In general, idcmp_mousemove messages are sent when the mouse changes position while the gadget is active. boolean and proportional gadgets are active while the mouse button is held down, thus mouse move messages will be received when the user "drags" with the mouse. string gadgets are active until terminated by keyboard entry or another object becomes active (generally by user clicking the other object). gact_followmouse string gadgets will generate mouse moves the entire time they are active, not just when the mouse button is held. The broadcasts received differ according to the gadget's flag settings. If using the gact_immediate and gact_relverify activation flags, the program gets a gadget down message, receives mouse reports (idcmp_mousemove) as the mouse moves, and receives a gadget up message when the mouse button is released. For boolean gadgets, the mouse button must be released while the pointer is over the gadget. If the button is not released over the boolean gadget, an idcmp_mousebuttons message with the SELECTUP qualifier will be sent. If only using the gact_immediate activation flag, the program gets a gadget down message and receives mouse reports as the mouse moves. The mouse reports will stop when the user releases the mouse select button. This case does not apply to boolean gadgets as gact_relverify must be set for boolean gadgets to receive mouse messages. If only using the GACT_RELVERIFY activation flag, the program gets mouse reports followed by an up event for a gadget. For boolean gadgets, the idcmp_gadgetup event will only be received if the button was released while the pointer was over the gadget. If the button is not released over the boolean gadget, a idcmp_mousebuttons message with the selectup qualifier will be received if the program is receiving these events. If neither the gact_immediate nor the gact_relverify activation flags are set, the program will only receive mouse reports. This case does not apply to boolean gadgets as gact_relverify must be set for boolean gadgets to receive mouse messages.