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 


@MousePos()
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


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

PostPosted: Tue Sep 16, 2003 12:46 pm    Post subject: @MousePos() Reply with quote

Ok, Big bug here (I think)

@MousePos() - looks like it is returning the coords rel. to the current dialog.

Check it out...

Code:

  DIALOG CREATE,New Dialog,10,10,181,135
  DIALOG ADD,TEXT,TEXT1,8,8,26,12,TEXT1
  DIALOG ADD,TEXT,TEXT2,26,7,26,12,TEXT2
  DIALOG ADD,BUTTON,BUTTON1,51,3,170,24,"Shows Wrong (But Should be right)"
  DIALOG ADD,BUTTON,BUTTON2,83,5,170,24,"Shows Right (But should be wrong)"
  DIALOG SHOW

  :evloop
  wait event,0
  %e = @event()
  goto %e
 
  :timer
  dialog set,text1,X=@mousepos(X)
  dialog set,text2,Y=@mousepos(Y)
  goto evloop
 
  :Button1Button
  dialog Popup,Item1|Item2|Item3,@mousepos(X),@mousepos(Y)
  goto evloop
 
  :button2button
  dialog Popup,Item1|Item2|Item3,@diff(@mousepos(X),@sysinfo(screenwidth)),@diff(@mousepos(X),@sysinfo(screenwidth))
#  dialog Popup,Item1|Item2|Item3,@mousepos(Y),@mousepos(X)
  goto evloop
 
  :close

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


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

PostPosted: Wed Sep 17, 2003 1:26 am    Post subject: Reply with quote

Any comments?
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Wed Sep 17, 2003 2:15 am    Post subject: Reply with quote

The same is happening for me, this is really strange. It looks like it reports correct values when no dialog is present?
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


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

PostPosted: Wed Sep 17, 2003 2:51 am    Post subject: Reply with quote

Ok, good. I'm not mad. Rolling Eyes This is a real problem. Confused
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 17, 2003 2:37 pm    Post subject: Reply with quote

PGWARE wrote:
The same is happening for me, this is really strange. It looks like it reports correct values when no dialog is present?


Yes I think this is there in VDS 4.x too Sad
Just move the dialog the popup menu starts shifting by the amount the dialog is moved !
And it goes on capturing other windows on the way.
I was driven crazy once and I thought I am nuts and used GetCursorPos API instead.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Sep 17, 2003 4:52 pm    Post subject: Reply with quote

Changing the behavior of this function is likely to break anything that works with it the way it is, such as the Dialog Designer, which the folks at CR won't thank me for. Especially if it's been this way since VDS 4, we'll probably have to live with it as it is.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Sep 17, 2003 5:15 pm    Post subject: Reply with quote

Just looked at this and @mousepos() just calls the GetCursorPos API function. So why it should return the co-ordinates relative to the dialog is a complete mystery to me.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Wed Sep 17, 2003 6:06 pm    Post subject: Reply with quote

As you can see by trying this script (VDS 3, 4, 5), @mousepos() is still working pretty
much okay:

Code:
  option decimalsep,.
  option fieldsep,|
  DIALOG CREATE,Cursor Position,-1,0,193,69
  DIALOG ADD,TEXT,tX,8,8,,,"X (left) position:"
  DIALOG ADD,TEXT,tY,32,8,,,"Y (top) position:"
  DIALOG ADD,TEXT,tXp,8,104,,,???
  DIALOG ADD,TEXT,tYp,32,104,,,???
  DIALOG SHOW
:timer
  parse "tXp;tYp",@mousepos(xy)
:evloop
  wait event,0.1
  goto @event()
:close


Rather the DIALOG POPUP command expects coordinates relative to the dialog's upper
left corner, but this has always been like this at least since VDS 3, so I do not think this
should be changed.

So I think the code attached to the "Shows Right (But should be wrong)" should indeed
be the way to go. Your script contains a few mistakes though, corrected here:

Code:
  DIALOG CREATE,New Dialog,10,10,181,135
  DIALOG ADD,TEXT,TEXT1,8,8,26,12,TEXT1
  DIALOG ADD,TEXT,TEXT2,26,7,26,12,TEXT2
  DIALOG ADD,BUTTON,BUTTON1,51,3,170,24,"Shows Wrong (But Should be right)"
  DIALOG ADD,BUTTON,BUTTON2,83,5,170,24,"Shows Right (But should be wrong)"
  DIALOG SHOW

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

:timer
  dialog set,text1,X=@mousepos(X)
  dialog set,text2,Y=@mousepos(Y)
  goto evloop

:Button1Button
  dialog Popup,Item1|Item2|Item3,@mousepos(Y),@mousepos(X)
  goto evloop

:button2button
  dialog Popup,Item1|Item2|Item3,@diff(@mousepos(Y),@dlgpos(,T)),@diff(@mousepos(X),@dlgpos(,L))
  # dialog Popup,Item1|Item2|Item3,@mousepos(Y),@mousepos(X)
  goto evloop

:close


Still it is not working well exactly as it is using the dialog coordinates rather than the
dialog client area's coordinates which the DIALOG POPUP command seems to be
expecting the supplied coordinates to be relative to.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 17, 2003 6:49 pm    Post subject: Reply with quote

Tommy Your example works OK but LiquidCode's example you corrected still does not work and certainly shows the same unexpected behaviour including the menu postion shift caused by moving the dialog.. I am confused Confused Some thing to with OS ???
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Sep 18, 2003 8:43 am    Post subject: Reply with quote

Quote:
Still it is not working well exactly as it is using the dialog coordinates rather than the dialog client area's coordinates which the DIALOG POPUP command seems to be expecting the supplied coordinates to be relative to.


Yes, the code relativizes the X,Y co-ordinates to the dialog client area although there still appears to be a bug as it looks as if the X and Y values are reversed. I'm informed the release of the update will be at least a week away so there is time to get this issue fixed, but at the moment I'm unclear what to do. Should it be left as it is, left as it is but with the X and Y swapped back, or made to use screen co-ordinates as the help file says?

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


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

PostPosted: Thu Sep 18, 2003 11:02 am    Post subject: Reply with quote

personally, I like the screen coords. as the help file says. Wink
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Sep 18, 2003 4:56 pm    Post subject: Reply with quote

I think I go with LiquidCode as for screen coords(makes more sense I think) X and Y may be left probably with a note in the help file.
But will it not break Dialog Designer ?? I don't know if it uses this.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Thu Sep 18, 2003 5:27 pm    Post subject: Reply with quote

How about adding an extra parameter for @mousepos(XY,S) S telling it to use system wide values rather then localized. This way it doesn't break any previous programs and new programs can use the new param for system wide screen values
Back to top
View user's profile Send private message
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Thu Sep 18, 2003 5:38 pm    Post subject: Reply with quote

PGWARE wrote:
How about adding an extra parameter for @mousepos(XY,S) S telling it to use system wide values rather then localized. This way it doesn't break any previous programs and new programs can use the new param for system wide screen values


I think Prakash's suggestion would be the best way to go if it is possible to add into the update.

- Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Sep 18, 2003 6:49 pm    Post subject: Reply with quote

Me too. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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