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 


In Focus???

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


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

PostPosted: Mon Jan 14, 2002 2:52 pm    Post subject: In Focus??? Reply with quote

Hi All,
Does anyone know of a way to find out which dialog element has the focus with VDS 3.x?

_________________
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
Garrett
Moderator Team


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

PostPosted: Mon Jan 14, 2002 8:12 pm    Post subject: Reply with quote

Not possible in VDS 3.x to find out what the focus is on. Unless there's some API for that. VDS 4 does have that though "@focus()".
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


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

PostPosted: Tue Jan 15, 2002 6:15 pm    Post subject: Reply with quote

Thanks Garrett
For the reply so since there is no way to do this with VDS. I wrote a DLL to do get the handle of the control that has the focus Cool I will be posting it soon for everyone out there...

_________________
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
Garrett
Moderator Team


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

PostPosted: Wed Jan 16, 2002 3:08 am    Post subject: Reply with quote

Mindpower,

That's really nice of you... Thanks for making the dll and for passing it on to others. Smile

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Wed Jan 16, 2002 3:44 pm    Post subject: Reply with quote

Well it is somewhat possible, you can use the 'DESIGN' style which is undocumented. It will generate a CLICK event for all controls I think.

DIALOG CREATE,New Dialog,-1,0,240,160,DESIGN

The other hidden commands are DIALOG ATTACH and DIALOG DETACH, which attachs/detachs the resizing arrows on the control, you probably wont need these to get focus however.

Just keep a variable marked whenever a click event is made for any control and you'll know which one last had the mouse/focus.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


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

PostPosted: Wed Jan 16, 2002 11:52 pm    Post subject: Reply with quote

Nice idea Prakash, however...

DESIGN causes a CLICK event as long as the element is clicked on,
but not using the TAB key. Also, since it generates a CLICK event for
all elements, it kills many standard events (BUTTON, EXIT, etc.), and
practically eliminates access to COMBO list items...
__________________________________________________________________________________________________________________________
Code:

rem -- VDS3 & VDS4 compatible --
OPTION SCALE, 96
Title By Mac
DIALOG CREATE,Design Style,-1,0,300,200,DESIGN
  DIALOG ADD,BUTTON,B1,5,5,60,20
  DIALOG ADD,TEXT,T1,8,70,,," Text Element "
  DIALOG ADD,EDIT,E1,30,5,290,20,"Edit Element",,EXIT
  DIALOG ADD,COMBO,C1,55,5,290,20,"Combo Element"
  DIALOG ADD,LIST,L1,80,5,290,115
  DIALOG ADD,STATUS,Stat,"Focus ="
DIALOG SHOW

LIST ADD, L1, List Element
LIST LOADTEXT, C1,
"Option 1
"Option 2
"Option 3
"Option 4

:EVLOOP
  WAIT EVENT
  %e = @event()
  DIALOG SET,Stat,"Focus = "@substr(%e, 1, @diff(@len(%e),5))
  goto %e

:B1BUTTON
  rem -- Not accessible ---
  INFO This is a BUTTON event...
  goto EVLOOP

:E1EXIT
  rem -- Not accessible ---
  INFO Edit EXIT event...
  goto EVLOOP

:B1CLICK
:T1CLICK
:E1CLICK
:C1CLICK
:L1CLICK
  INFO This is a CLICK event...
  goto EVLOOP
 
:CLOSE
  EXIT


Another option might be to just extract the element name from
standard events (CLICK, BUTTON, etc.).

_________________
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
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