Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Problems... Message-ID: <8534@hoptoad.uucp> Date: 16 Sep 89 04:47:22 GMT References: <13707@megaron.arizona.edu> <13295@reed.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 47 In article <13707@megaron.arizona.edu> gerhard@arizona.edu (Gerhard Mehldau) writes: >(2) The File Menu in the same application has an "Import" item which uses > SFPGetFile() together with a customized dialog. > The dialog contains several TextEdit items; however, > tabbing doesn't move the I-beam cursor as it does in other dialogs. > What am I doing wrong? In article <13295@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes: >Relax -- it's just Standard File interpreting Tab to mean Change Volume. Try >it with a floppy in your drive and you'll see what I mean... >Now, I don't know how to keep SF from doing this -- Any net leads? Pretty easy. The SFPGetFile call needs to be passed an event filter parameter that does the necessary thing, then nullifies the event or otherwise signals that the event should not be processed any further. Check for a key-down event with the code for tab (0x9) and TESelect to pick the non-selected field. Assuming you do this with a switch on the character code, here's a case in C that does it: case 0x9: switch (EditField(dlog)) { case text1: tmp = text2; break; case text2: tmp = text1; break; } SelIText(dlog, tmp, 0, 32767); *item = 0; return true; The function EditField is my anal-retentive way of pretending not to look at data structures; whether it's a macro or a routine, the value is ((DialogPeek)dialog)->editField + 1. This approach can readily be adapted for more items simply by adding more cases, each of which selects the (circular) next item. You can also do a similar trick with arrow keys, but I recommend doing it only for the left and right arrow keys, so as not to interfere with the standard file keyboard selection shortcuts. Unfortunately, if you have even one TextEdit item in a get file dialog, then the user can't select from the keyboard by typing the file name, so consider use of this feature very carefully. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "It is better to be a human being dissatisfied than a pig satisfied; better to be Socrates dissatisfied than a fool satisfied." -- John Stuart Mill, UTILITARIANISM (1863)