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 


Right click on a list? Possible?

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


Joined: 10 May 2001
Posts: 789

PostPosted: Wed May 01, 2002 5:37 pm    Post subject: Right click on a list? Possible? Reply with quote

Hello,

I would like to know if it`s possible to have an event when a user right clicks on a certain item of a List Dialog?

Example:

- 10 items in a list
- User right clicks on the 3rd item in the list
- Returned information would be info @item(list) for example

I looked in the help, but only doubleclick and single click is mentionned.

I know about @click but that would not focus on the right clicked item of the list...

Thanks... Cool
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed May 01, 2002 6:35 pm    Post subject: Reply with quote

Hey Marty!

You can use the DESIGN style on the dialog to
simulate the RIGHT CLICK. NO EXTERNAL DLL NEEDED!
I'll post this code in the VDS4 code section as well.

BUT you do now need to know that *ALMOST* EVERY element will
generate a click event.

I also created code to use VDSKey.dll if the DESIGN style will not
work for your program.

Code:

rem Code without dll
   dialog CREATE,Right click List,-1,0,197,191,CLASS RCL,DESIGN
   rem *** Modified by Dialog Designer on 5/1/02 - 14:12 ***
   dialog ADD,LIST,LIST1,4,8,180,144,,,
   dialog ADD,TEXT,TEXT1,158,12,,,Right click on an item
   dialog SHOW

   list loadtext,list1
"item0
"item1
"item2
"item3
"item4

:evloop
   wait event
   %e = @event()
   goto %e

:LIST1CLICK
if @equal(@click(B),RIGHT)
   window click,#RCL,@diff(@mousepos(X),@dlgpos(,L)),@diff(@mousepos(Y),@dlgpos(,T))
   info @dlgtext(list1)
end
goto evloop

:close
   stop



Code:

            rem code WITH dll
   external VDSKey.dll
   dialog CREATE,Right click List,-1,0,197,191,CLASS RCL
   rem *** Modified by Dialog Designer on 5/1/02 - 14:12 ***
   dialog ADD,LIST,LIST1,4,8,180,144,,,
   dialog ADD,TEXT,TEXT1,158,12,,,Right click on an item
   dialog SHOW

   list loadtext,list1
"item0
"item1
"item2
"item3
"item4

:evloop
   wait event,0
   %e = @event()
   goto %e

:timer
   if @equal(@winactive(C),RCL)
      if @keyboard(rbutton)
         window click,#RCL,@diff(@mousepos(X),@dlgpos(,L)),@diff(@mousepos(Y),@dlgpos(,T))
         info @dlgtext(list1)
      end
   end
   goto evloop

:close
   stop


_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed May 01, 2002 6:45 pm    Post subject: Reply with quote

I'll try that and let you know... thanks!
Back to top
View user's profile Send private message Send e-mail 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