Allowing user to change size and location of a field

Glen Bojsza gbojsza at gmail.com
Wed Mar 7 11:32:39 EST 2012


Hello,

I would like to allow a user to be able to change the size and location of
a text field in an application.

The following allows the user to select the field via right-shift click and
then with the pointer tool move the field to where they want and resize the
field.

With the next right-shift click the field is deselected and the browse tool
is shown.

Problem is the user cannot put text into the field anymore?

Am I approaching this correctly?

on mouseDown theButton
   if theButton is 3 AND the shiftkey is down then
      get the selected of me
      switch it
         case  "true"
            set the selected of me to false
            set the tool to browse
            select empty
            break
         case  "false"
            set the selected of me to true
            set the tool to pointer
            break
      end switch
   else
      pass mouseDown
      end if
end mouseDown

Another question which may not be able to be answered is... can you limit
the number of characters in the field based on the new size the user has
made?

thanks,

Glen



More information about the Use-livecode mailing list