First selection in a drawer

Bruce Lewis lewisbruce at
Sat Feb 26 19:47:09 EST 2005

Problem unexpectedly solved.

If " select text of field "SearchFld" " is in the calling btn, the text is
selected in the drawer and the next keystroke erases the selection and
types in the ordinary way.

The problem seems to be when you try to do this is an openstack or opencard
handler in the stack that becomes the drawer.

For the record, I made the following observations:

If an openStack or openCard handler selects the text of the field, then the
drawer opens with the text highlighted. However, all subsequent keystrokes
go to the original stack.

If there is no handler to select the text, the text is not highlighted, but
subsequent behaviour is no different.

Whether or not the text is highlighted, the next keystrokes go the original

If the user clicks on the drawer, but not on a control, nothing happens to
the fld.

If the user wants to type into the field in the drawer, the user can:

1. Click on any control in the drawer (including a btn or label field). The
field with the text becomes active. If the text was not highlighted, it
becomes highlighted. Typing erases the text in the field and replaces it.
This is the desired behaviour.

2. Click in the fld. Behaviour is as expected. The contents of the field
are no longer highlighted. The text cursor appears where you clicked and
you type as normal.

Clicking anywhere under script control had no effect, with or without a wait.

If the first keystroke after opening the drawer is a tab, the text cursor
goes to the end of the text in the fld. However, you cannot then type.
Nothing happens in the drawer. The tab also operates as a tab in the
original stack and highlights the next field there.

I guess this is a peculiarity of drawers.



At 1:08 PM -0500 2/26/05, Bruce Lewis wrote:
>I would like to press a button to open a stack as a drawer and then have
>the next keystrokes type into a field on the drawer.
>The card script contains:
>on opencard
>  select text of field "SearchFld"
>end opencard
>If I open the stack as a palette, the text in field "SearchFld" is selected
>and typing automatically replaces it.
>If I open the stack as a drawer, the text is highlighted and appears to be
>selected. But keystrokes do not affect it. If the cursor is in a field in
>the top stack, keystrokes continue to go that field. If the cursor is not
>in a field, the keystrokes just disappear.
>Any thoughts would be appreciated.

More information about the use-livecode mailing list