Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!uwm.edu!bionet!agate!saturn!ssyx.ucsc.edu!sirkm From: sirkm@ssyx.ucsc.edu (Greg Anderson) Newsgroups: comp.sys.mac.programmer Subject: Re: ModalDialog filterprocs Summary: This is getting complicated! Message-ID: <10132@saturn.ucsc.edu> Date: 27 Dec 89 21:18:17 GMT References: <10125@saturn.ucsc.edu> <33385@ucbvax.BERKELEY.EDU> Sender: usenet@saturn.ucsc.edu Reply-To: sirkm@ssyx.ucsc.edu (Greg Anderson) Organization: UC Santa Cruz; Division of Social Sciences Lines: 85 Thanks to all who pointed out that my filter declaration should read: pascal Boolean cutPasteFileter( ^^^^^^^ DialogPtr dlog, EventRecord *theEvent, short *itemHit) ^^^^^ In article <33385@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >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. >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. Those are good suggestions, and are simple enough to implement. I'll add those features right away. >4.) handle Tab to tab backwards through the fields. How should that be done? Forge a mouseDown event inside the appropriate editable text field? >8.) support undo of the Edit commands, and of typing. >7.) handle -Z as a synonym for undo. My filterProc is being called from a dialog box that is invoked from a desk accessory, so I can't use globals in the usual way (I have a Handle that holds all of the global data, & pass that from routine to routine). Any suggestions on how I might pass this handle into the filterProc? >11.) Scrollbars are governed in a processor-speed-independent manner, so >they won't scroll too fast on fast machines. How do you determine if the user is clicking in a scrollbar? Use a custom filterProc for each dialog that 'knows' (via hard-coding) which items have scrollbars? >9.) & 10.) [stuff related to keyboard equivalents for scrolling lists deleted] I can do that, but there's still the problem of recognizing scrollable items (I'm begining to think that custom filterProcs, rather than one general one, is the only feasible solution to this problem) and getting the ListHandle passed into the filterProc. >At least, that is what _my_ filterProcs do. For an example, see my program >"Address Book Plus", from Power-Up! software of San Mateo, CA. I'll try to do that. >Do you think we should have: >a.) smart quotes? (i.e., replace "'" and '"' by the appropriate opening >and closing left and right quote marks.) I don't like smart quotes. They might be nice in a Word Processor, perhaps, but once someone put an INIT on my Mac (the Black Box?) that did smart quotes in ALL applications -- even the MPW editor! _That_ was very annoying. >b.) smart cut & paste? (i.e., when you cut text, it remembers whether the >text ended or began on a word boundary, and deletes extra white space if >so. When you paste, if deletes or inserts white space as necessary.) (This >is documented in the User Interface Guidelines. Few programs bother with >it.) Sounds like a nice feature, but I can see why few programs bother to do it. It's not very noticable when present, and not terribly annoying when absent. >c.) transform to and to in numeric >only fields? Since this is only a few lines of code, you might as well do it, but I think it should be an undocumented feature, not something that people start expecting all dialog boxes to do automatically. >--- David Phillip Oster -- No, I come from Boston. I just work >Arpa: oster@dewey.soe.berkeley.edu -- in cyberspace. >Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu ___\ /___ Greg Anderson ___\ /___ \ \ / / Social Sciences Computing \ \ / / \ /\/\ / University of California, Santa Cruz \ /\/\ / \/ \/ sirkm@ssyx.ucsc.edu \/ \/