>Hi,
>
>I�d like an editable text field with certain behavior:
>
>1. I want the user to be able to delete characters but not to reduce the
>number of lines when deleting text within the field.
>
>How would you script that? I tried to use the >on backspaceKey< message
>in the field script to trap messages but don�t know how the program
>should distinguish deleted characters from deleted lines.
>
>2. Similarly the user should not be allowed to add lines to the field -
>pressing the return key should take the cursor one line down in the
>field.
>
>I tried the >on returnKey< message in the field script but the syntax
>seems to be wrong:
>
>            on returnKey
>                send arrowKey down to me
>            end returnKey
>
>
>
>Thanks for any help
>
>---------
>Sven


One approach which would work if you know in advance the number of lines
that the field will have is to make one field for each line you want.  You
can format & arrange the fields so that they appear to be a single field.
It will then be impossible to delete lines, and you can trap the return key
(using returnInField, not returnKey) & move the cursor to the next field (=
line):

on returnInField
  select after fld <nextLine>
end returnInField


Dave

Reply via email to