Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!tank!shamash!nic.MR.NET!srcsip!gorby!mnkonar From: mnkonar@gorby.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: select multiple items MDEF Keywords: mdef, select Message-ID: <18302@srcsip.UUCP> Date: 8 Mar 89 03:16:40 GMT References: <3749@geaclib.UUCP> Sender: news@src.honeywell.COM Reply-To: mnkonar@gorby.UUCP (Murat N. Konar) Organization: Honeywell Systems & Research Center, Camden, MN Lines: 51 In article <3749@geaclib.UUCP> rae@geac.uucp (Reid Ellis) writes: > >So now I'm thinking, "Hey, how about selecting an item if you hit >Enter while that item is highlighted?" Ok, so now I have an >idea. The next thing to resolve is its scope. Is it possible to >do this only from an MDEF? If I return from an MDEF with the menu >still drawn on the screen, will the application immediately get >another mouseDown inMenuBar event? Or will I need to write my own >MBAR def as well? How about emulating the extended selection idea by using the shift key to keep the menu down until you have made your selections? As to how, you will probably have to patch MenuSelect since this routine (or a routine it calls) is responsible for calling the MDEF and tracking the mouse. These things would need to happen in your patch: 1) you will have to check to see if the shift key is down. If not yor patch should emulate the real MenuSelect exactly. 2) If the shift key is down, call the (standard) MDEF with the draw message. (don't forget to save the bits behind the menu). I would use the check mark method of marking selected items rather than highlighting because then you should be able use Apple's MDEF and not write your own. 3) Once the selections are made and the shift key is released you should restore the bits you saved in 2). 4) the tricky part: You really are trying to fake the application into thinking you made many separate menu selections. If only one item is selected, just return that items id and menu number. If there are more items selected, you still return the first item but also post a mouse down event in the menu bar. This will trick the application into calling MenuSelect again. Your MenuSelect returns the next item and posts another event if there's a pending item. The bottom line is: I don't think you need to write a custom MDEF or an MBDF to do what you want. I seem to remember somthing on the net about Apple not wanting anyone to go about writing any custom MBDFs yet anyway. ______________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar (UUCP)