| View previous topic :: View next topic |
| Author |
Message |
Estas Contributor


Joined: 31 Jan 2004 Posts: 66 Location: Germany
|
Posted: Mon Apr 24, 2006 3:47 pm Post subject: React to pressing "ENTER" in an edit dialog elemen |
|
|
Hi all,
how can I react to and "ENTER" in an edit dialog element?
To be more exact, after a user inputs some text in an edit field and presses "Enter" afterwards, I need to perfom a check.
How do I detect this "Enter" input?
Greetings Mike _________________ Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece. |
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Mon Apr 24, 2006 6:48 pm Post subject: |
|
|
The EXIT style will detect a focus change by Tab/Mouse but you probably need a button to for an Enter event. Try:
| Code: | DIALOG CREATE,EnterTest,-1,0,193,65
DIALOG ADD,EDIT,EDIT1,10,7,180,19
DIALOG ADD,BUTTON,BUTTON1,36,123,64,24,OK,,DEFAULT
# or the button could be hidden
# DIALOG ADD,BUTTON,BUTTON1,0,0,0,0,OK,,DEFAULT
DIALOG SHOW
:Evloop
wait event
goto @event()
:BUTTON1BUTTON
%T = @dlgtext(edit1)
if %T
info %T
end
goto evloop
:Close
exit |
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Apr 25, 2006 3:22 am Post subject: |
|
|
there is a button you can create on your interface that when the ENTER button is pressed, then it gets to work
i can't remember the syntax for that button, perhaps a search in the vds help file will help ... from memory, there is a reference there of how to do it
serge _________________
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Tue Apr 25, 2006 3:34 am Post subject: |
|
|
| When you assign a Button the "Default" syle as above it will react to the Enter key. |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Apr 25, 2006 4:11 am Post subject: |
|
|
ooppss!!!
didn't look at your code just your comment about EXIT and assumed your code dealt with that
serge _________________
|
|
| Back to top |
|
 |
Estas Contributor


Joined: 31 Jan 2004 Posts: 66 Location: Germany
|
Posted: Tue Apr 25, 2006 8:41 am Post subject: |
|
|
Thanks - perfect,
thats exactly what I wanted - I didn't know about the "Default" Option.
Greeting Mike _________________ Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|