Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!bbn!bbn.com!mesard From: mesard@bbn.com (Wayne Mesard) Newsgroups: comp.sys.mac.programmer Subject: Customizing SFGetFile: adding a button/multiple files Message-ID: <37794@bbn.COM> Date: 27 Mar 89 17:14:49 GMT Sender: news@bbn.COM Reply-To: mesard@BBN.COM (Wayne Mesard) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 45 I'm writing a simple application to process one or more (user-specified files) and I want to make some changes to SFGetFile. I have two questions: 1) I want to add a check box to the bottom of the dialog box. Since this is a simple change, I thought it'd be better to use the standard DLOG (ID = -4000) and add the control by hand (rather than building a new dialog completely duplicating what's already in the System's version). That way, I retain compatibility with future versions of SFGetFile. So I put the following in my dialog hook: case firstTime: hCtl = GetNewControl(CENSOR_CTLID, (WindowPtr) dialog); OffsetRect(&((**hCtl).contrlRect), 0, dialog->portRect.bottom); dialog->portRect.bottom = (**hCtl).contrlRect.bottom + 5; break; This gets the control inserted in the window, but item-hit events never get generated for it (ie., my dialog hook doesn't get called when I click on my new control). This seems reasonable, since the number of items is probably checked before the dialog hook is ever called. So, I wound up creating a new DLOG after all, which can't be so bad, since its what they do in TN47, but it just seemed wrong. Am I being too anal about this? I have reason to believe it can be done, since LSC has a "Smart Link" check box in the "Open Project" dialog, and looking through its resource fork, I didn't see a replacement for the standard SFGetFile DLOG. 2) I want the user to be able to select multiple files (via shift-click and command-click). Assuming that item 7 (the file name list) uses the list manager I should be able to do this if I can just get my hands on the ListHandle (to modify the selFlags and to see which fields are selected when the user hits Open). Is this possible? I'm not anxious to rewrite the SFGetFile LDEF just because no one saw fit to give me access to its data structure. (Again, I'm assuming that it really does use Mr. List Manager.) Any tips appreciated. I will summarize all useful eMail responses. Thanks in advance. -- unsigned *Wayne_Mesard(); MESARD@BBN.COM BBN, Cambridge, MA