How to create a single line entry field?

Mark Schonewille m.schonewille at economy-x-talk.com
Fri Feb 16 13:19:10 EST 2007


Hi Tiemo,


1)

on enterInField
   -- do something
end enterInField

or

on returnInField
   -- do something
end enterInField


2)

Recently, I set the lof of an invisible stack to the screenloc and  
made it the active window before using the answer command. This was  
to set the loc of the answer windows to the screenloc on Windows.

You could also add a preOpenStack handler to the answer and ask  
dialog stack, which sets the loc of the stack to a property:

on preOpenStack
   -- existing part of script here if necessary
   set the loc of me to cCustomLoc
end preOpenStack

You can now set the loc before using the answer command:

on foo
   set the cCustomLoc of stack "Answer Dialog" to the screenLoc
   answer "Hello World"
end foo

You might want to search the mail list archives for more solutions. I  
know there are.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz

Op 16-feb-2007, om 19:07 heeft Tiemo Hollmann TB het volgende  
geschreven:

> Hello,
>
> Probably a simple newbee question:
>
> 1. how can I realize a single line field, where the user can enter  
> text and
> commits with enter key?
>
> In my standard scenario the enter key makes a CR into the field, so  
> that the
> text breaks and disappears in the unvisible line 1 of 2 of my  
> textfield
> (because it has only 1 line visible)
>
>
>
> I have a handler:
>
> on rawkeyUp keyCode
>
> in the field, where I handle the key entries. But even if I try to  
> capture
> the keyCode 65293 ( EnterKey) and break the rawkeyUp, revolution  
> puts the CR
> into the field.
>
>
>
> Is there a field property "single line field" or something like that?
>
>
>
> 2. is there a chance to set the location of the ask and answer dialog,
> instead of default centred?
>
>
>
> Thank you
>
> Tiemo
>
>
>
>




More information about the use-livecode mailing list