[comp.windows.ms.programmer] Dynamic Dialogs in Actor

dyer@motcid.UUCP (Bill Dyer) (04/16/91)

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.

Thanks,
Bill


-- 
___________________________________________________________________________
|  Can't shake the devil's hand,              | Bill Dyer, Motorola C.I.G. |
|  And say your only kidding.                 | motcid!dyerb@uunet.uu.net  |
|                   -They Might Be Giants     | (708) 632-7081             |

cms2839@isc.rit.edu (a.stranger) (04/17/91)

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));


-- 
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @     "Imagination keeps the shadows away  -  Xymox      @
       @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~@
       @       a.stranger  -  CMS2839@ritvax.isc.rit.edu        @

dyer@motcid.UUCP (Bill Dyer) (04/23/91)

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             |

gyugyi@earthsea.stanford.edu (Paul Gyugyi) (04/23/91)

To all Actor users:
I want to start an Actor e-mail newsletter, which I guess
I'll post to this group.  I would like people to send me
1 to 3 page letters of hints about using Actor.  For example,
I'm writing a nethack-like adventure game, and I'll talk about
how to redraw screens where every character could be a different
color, in an efficient way.  I'll also talk about how to use
the WRT with actor, since I got it with TPW.  If you have some
words of wisdom, here's a place to pass them on...


and to Bill Dyer in particular:

|> 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));

You should only have one 'Def' button, and that becomes the default.
The others should just be newButton or something...

One warning about Dynamic Dialogs:  If you have too
many controls, it won't work (I forget whether it crashed or
what).  But above a dozen controls, (your milage may vary),
you should go with resource file dialog boxes.
I remember a thread on Compu$erve about this a while ago.

--
Paul Gyugyi
gyugyi@earthsea.stanford.edu