Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ftpbox!motsrd!motcid!dyer From: dyer@motcid.UUCP (Bill Dyer) Newsgroups: comp.windows.ms.programmer Subject: Re: Dynamic Dialogs in Actor Keywords: Actor Dialogs Buttons Message-ID: <6236@graphite32.UUCP> Date: 22 Apr 91 17:35:43 GMT References: <6203@graphite32.UUCP> <1991Apr17.050112.28564@isc.rit.edu> Distribution: usa Organization: Motorola Inc. - Cellular Infrastructure Div., Arlington Heights, IL 60004 Lines: 37 In article <1991Apr17.050112.28564@isc.rit.edu> cms2839@isc.rit.edu (a.stranger) writes: >In article <6203@graphite32.UUCP> dyer@motcid.UUCP (Bill Dyer) writes: >>I am creating dynamic diaologs in Actor. The dialogs have several >>buttons. How can I create the dialog so that when I press return >>(after entering text for instance) a default button selection will be >>used. For instance, if I have an "OK" button and a "Cancel" button >>I would like "return" to be the equivalent of pressing the OK button >>with the mouse. I don't want to have to hit Alt-o or reach for >>my mouse to finish up the dialog. > > from page 490 of the Actor manual : >Dialog1 := new(DialogDesign); >/* other buttons , test , size settings and controls */ >addItem(Dialog1, newDefButton(DlgItem, "OK", IDOK, 50@50, 32@16, 0)); > That's fine and dandy, I RTFM (from cover to cover) and I know how to create the buttons. My question is how do I make the "OK" button the default when return is entered. If I press the tab key enough times to get through the input, the "OK" button will be highlighted. However, I want the dialog box to pop up with the "OK" button already highlighted so I can enter my data and then simply press return. If I have the following code: Dialog1 := new(DialogDesign); addItem(Dialog1, newDefButton(DlgItem, "OK", IDOK, 50@50, 32@16, 0)); addItem(Dialog1, newDefButton(DlgItem, "Cancel", IDOK, 50@70, 32@16, 0)); If I simply press return when the dialog pops up, I want IDOK to be returned, it however does not seem to work this way by default (as several other people have told me). -- _____________________________________________________________________________ | don't know about you | Bill Dyer, Motorola C.I.G.| | but i am un chien andalusia | motcid!dyerb@uunet.uu.net | | -Pixies | (708) 632-7081 |