Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!wuarchive!decwrl!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: ModalDialog filterprocs Message-ID: <33385@ucbvax.BERKELEY.EDU> Date: 27 Dec 89 10:47:53 GMT References: <10125@saturn.ucsc.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 64 In article <10125@saturn.ucsc.edu> sirkm@ssyx.ucsc.edu (Greg Anderson) writes: >I wrote a filterproc for ModalDialog that allows the user to cut, copy >and paste to fields in a modal dialog box by pressing command-c, command-x >and command-v, respectively. The filterproc works great--cutting and >pasting work as expected. However, if the user presses , >ModalDialog no longer returns with itemHit = 1. >pascal int cutPasteFilter( DialogPtr dlog, EventRecord *theEvent, int *itemHit ) ^^^ Should be: pascal Boolean cutPasteFilter( ... remember, in pascal a Boolean and an "int" are not the same, or even compatible. A pascal Boolean TRUE looks like 0x01?? as an integer on the stack. In addition, your filterProc should also: 1.) handle -. or as synonyms for Cancel. 2.) handle as a synonym for clear (from the edit menu.) 3.) handle the & keys on the extended keyboard. 4.) handle Tab to tab backwards through the fields. 5.) On synonyms for Edit commands, flash the word "Edit" on the menu bar. 6.) On synonyms for buttons, flash the button for a fraction of a second before disposing the dialog. 7.) handle -Z as a synonym for undo. 8.) support undo of the Edit commands, and of typing. 9.) if the dialog includes any scrollbars, then the and keys one the extended keyboard apply to the scrollbar. If there are more than one scrollbar, they apply to the one with data that was most recently acted upon. 10.)