In article <10403@palm-dev-forum>, "Ben Combee" <[EMAIL PROTECTED]> wrote:
> I'm trying to figure out a quandry here. I've got a modal dialog that I
> want to display, with the focus set on the text field when the window is
> opened. This is my code:
>
> // activate first dialog: SymbolLookup
> lookupFrm = FrmInitForm(SymbolLookupForm);
>
> FrmSetFocus(lookupFrm,
> FrmGetObjectIndex(lookupFrm, SymbolLookupSearchTermField));
> FrmSetActiveForm(lookupFrm);
> hitButton = FrmDoDialog(lookupFrm);
>
> With the code like this, I get the blinking cursor when the form is
> displayed.
>
> If I transpose the two calls to FrmSetFocus and FrmSetActiveForm, such that
> my form is made active before the set focus call, the form is displayed with
> no blinking cursor. However, the text field is active, and graffiti written
> will cause characters to be inserted into the field and the cursor become
> visible.
>
> What does the act of making a form active have to do with the focused
> control? Since the form isn't drawn until the FrmDoDialog(), why should the
> order matter?
Don't know, but I never use FrmSetActiveForm anyway. I use almost
the same code as you, just without the FrmSetActiveForm line. And
It works like a charm. Why do you want to make the form active in
the first place? I think this is done implicit by FrmDoDialog (or
FrmInitForm?).
> On a related question... do I always need to turn on the "save bits" flag
> for sub-screen modal dialogs like this? I noticed on my 3.2 ROM that if
> that bit was off, the modal form was drawn without erasing its background,
> and when it was dismissed, the reactivated form underneath it was not
> redrawn.
>
> Thanks!
I don't really know, but I would interprete the "save bits" as
following: If this flag is set, I want that the OS cares about
refreshing the screen, when the form is dismissed (by either
restoring the saved bits or by queueing a frmUpdateEvent event.
Otherwise I will care about it myself. So yes, I consider the
current behaviour correct.
--
Remo <[EMAIL PROTECTED]> / / / /
----------------------------------------- -===(o<0=0=0=0=0=0=0=0>===-
Do NOT remove .nospam from email address! \ \ \ \
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/