[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standard File Dialogs and Controls



In article <1992Dec2.033519.23619@fawlty.towers.oz.au> johnmac@fawlty.towers.oz.au (John MacLean) writes:
>Has anyone successfully added other EditLine controls to a standard
>file (save) dialog?

Well, GScii+ 2.3.1 has one when you Encode files.  It worked in 5.0.4 but
broke in 6.0 when I added keyboard navigation to the file list in 6.0.

If there is time for 6.0.1, I will make it work again.

Note that Standard File is based on the Dialog Manager; you'll want to
add an editLine dialog item, not an extended Line Edit control

Adding extended controls to dialogs has always been iffy...some people have
done it successfully, to my semi-amazement, but a Line Edit control would
definitely not help much.  Tabs don't get sent to extended controls in a SF
dialog--in 6.0 they are handled in a hard-coded way, and my plan is to have
them handled by ModalDialog, so that the active editLine dialog item would
cycle around through all the editLine items, including a special outside-the-
window item, and the file list would have a bold frame & do keyboard navigation
exactly when this off-screen editLine item was active.

>I can add another control to the dialog template, but it does not become
>a target (of keystrokes) control, because bit 14 of the moreflags field
>is not set.

I do not see how you managed to add a dialog template entry for an extended
control.

>When you press tab, you thus move between the list control and the
>filename EditLine, but not to the new EditLine control.

Yup, that's what happens in 6.0.  If you click in your item, it should
become active, but it still won't get keystrokes.

>Even if I do manage to make the control the target of keystrokes, how
>would I go about getting the value from the control?
>[Perhaps by getting its value inside the hook procedure whenever an
>event occurs on this control?]

Yes, or when an event occurs in any control that dismisses the dialog
(Open, Save, Accept, or whatever collection of non-Cancel dismissing
buttons are in your dialog).

>If this is not possible, is it possible to add other extended controls
>[such as a pop-up menu] to the standard save dialog box - and then
>get the value of the selected item back?

Apparently it's possible to add a pop-up as an extended control.  It's
not officially blessed, but I've heard of it being done & will try real
hard not to break whatever currently works.  I don't know if there's
a special trick to it or not, but definitely leave your control's refcon
field as ZERO, or you'll confuse the Dialog Manager severely.

-- 
David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II System Software Engineer         |   P.O. Box 875
Internet:dlyons@apple.com                 |   Cupertino, CA 95015-0875

My opinions are my own, not Apple's.