forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dialog edit field question/problem

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
JohnSawyer
Newbie


Joined: 25 Feb 2003
Posts: 8
Location: San Diego, CA

PostPosted: Thu Mar 13, 2003 7:26 pm    Post subject: Dialog edit field question/problem Reply with quote

I have a dialog setup with several edit controls and 2 buttons (ok/cancel). I want to have the user fill out the fields and hit <enter> so they don't have to use their mouse, or change the focus to the OK button. How do I do this?

John Sawyer
VDS Noob.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Mar 13, 2003 7:33 pm    Post subject: Reply with quote

Add the DEFAULT style when you create the OK (or whatever) button:

DIALOG ADD,BUTTON,OK,5,5,50,25,,,DEFAULT

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Mar 14, 2003 10:28 pm    Post subject: Reply with quote

thanks for that mac...i can now use this in one of my programs...have been wondering how to do it Sad

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 14, 2003 10:57 pm    Post subject: Reply with quote

Glad to help out Serge. Wink

Another thing I have done to use the ENTER key on multiple
edit boxes (with the EXIT style as needed), is add a dummy
ENTER button like this:
Code:

DIALOG ADD,BUTTON,Enter,0,0,0,0,,,DEFAULT

Then under the EnterBUTTON label:
Code:

:EnterBUTTON
  rem -- "%%hwnd" is the window identifier --
  WINDOW SEND, %%hwnd, @tab()
  rem -- catch any EXIT events --
  %e = @event()
  if %e
     goto %e
  end
  goto EVLOOP

This allows ya to just keep hitting the ENTER key, and when
ya get all the data entered, the last EDIT box "EXIT" event
allows ya to save it (or whatever). Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Mar 14, 2003 11:07 pm    Post subject: Reply with quote

thanks again mac...now i understand the use to EXIT...i had read about it but didn't quite understand it...i can now add that to it too!

thanks once again Smile

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Mar 14, 2003 11:54 pm    Post subject: Reply with quote

Cool, Mac. Been wondering how to do that Wink
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group