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 


Which element has the focus?

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


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Mon Aug 26, 2002 5:55 pm    Post subject: Which element has the focus? Reply with quote

I thought I remembered a post about how to determine which dialog element has the focus at a given time. I've looked but haven't turned up anything.
Am I just feeling the effects of this Monday or is there a way to tell?
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Aug 26, 2002 6:09 pm    Post subject: Reply with quote

Maybe you can try to make something with the EXIT style...

Or make something that sends a character to your dialog, and check which edit-box is changing. After that, send a @key(DEL) to remove that input...
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Aug 26, 2002 6:20 pm    Post subject: Reply with quote

If you're using VDS 4.x, then use the @focus() function to return the element name which currently has the focus.


-Garrett
Back to top
View user's profile Send private message
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Mon Aug 26, 2002 7:00 pm    Post subject: Reply with quote

Good to know... I'm using 3.51 but have been thinking about buying 4.5...

Until then, maybe I'll try to work with skit3000's suggestions. Thanks!
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Aug 26, 2002 9:18 pm    Post subject: Reply with quote

Hi Hortalonus,
You could also use the Win32 API to get the windows handle of the active element. Here is the code for use with the gadget.dll.

Code:

External Gadget.dll,<Reg Code>
%%user32 = @Gadget(LoadLib,user32.dll)
Gadget Declare,GetFocus,%%user32,GetFocus,Void As Pointer,Handle


Title Test
  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,108,32,64,24,BUTTON1
  DIALOG ADD,BUTTON,BUTTON2,108,144,64,24,BUTTON2
  DIALOG ADD,EDIT,EDIT1,40,28,180,20,EDIT1
  DIALOG SHOW
  Rem Now just call the function like the next line when you want to know
  rem which element has the focus.
  %%ActiveElement = @Gadget(GetFocus,NULL)
  Info This is the VDS element that has the focus %%ActiveElement.

:Evloop
  wait event
  goto @event()
:BUTTON1BUTTON
  info Replace this line with code to process the BUTTON1BUTTON event
  goto evloop
:BUTTON2BUTTON
  info Replace this line with code to process the BUTTON2BUTTON event
  goto evloop
:Close
  info Replace this line with code to be executed before the dialog closes
  exit



Have fun...

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Tue Aug 27, 2002 12:08 am    Post subject: Reply with quote

I posted a couple of examples to find the element focus:

http://www.vdsworld.com/forum/viewtopic.php?p=3299#3299

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
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Tue Aug 27, 2002 3:47 pm    Post subject: Reply with quote

Very Happy Hey, thanks for all the ideas! It is much appreciated.
Back to top
View user's profile Send private message Send e-mail
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