Page 1 of 1
Posted: Tue Jan 28, 2003 8:09 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
If I place a gadget on x10-y10 and go with the mouse to the upper left
corner of the gadget and get with WindowMouseX() and WindowMouseY()
different values than x10-y10 it's just not logical to me.
It seems that WindowMouseX() and WindowMouseY() refers to the whole
Window including Borders and Titlebar, not the Client/Inner Area which
can be populated by the coder.
So if people have different Themes (like XP or Classical etc.) there
will be different results.
What du you think
BTW: I placed this topic here instead in the BUG section, because
(I suppose) it's a point of view and not a real bug.
Have a nice day...
Franco
Posted: Tue Jan 28, 2003 8:36 pm
by BackupUser
Restored from previous forum. Originally posted by plouf.
this has been changed in a latest version so visible area start from 0,0 so when you draw in window or putting gadgets they will not displayed wrong when user has changed settings makeing them fatter or thinner and i think its correct this way, you can get system default window caption and frame with
Debug GetSystemMetrics_(#SM_CYCAPTION )
Debug GetSystemMetrics_(#SM_CYSIZEFRAME)
but i agree that these two should somehow intergrated in PB commands set for cases like these

)
Christos
Posted: Tue Jan 28, 2003 9:29 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Mouse functions with caption and sizeborder calculated in would be better.
WindowAreaMouseX() and WindowAreaMouseY() maybe?
Or change existing functions?
Fred?
Regards,
Berikco
http://www.benny.zeb.be/purebasic.htm
Posted: Wed Jan 29, 2003 8:56 am
by BackupUser
Restored from previous forum. Originally posted by fred.
Ok, I will change that and break some existing programs

. That's a kind of sport !
Fred - AlphaSND
Posted: Wed Jan 29, 2003 11:19 am
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Yes, its always fun to change your old code again
Regards,
Berikco
http://www.benny.zeb.be/purebasic.htm
Posted: Wed Jan 29, 2003 12:32 pm
by BackupUser
Restored from previous forum. Originally posted by freak.
Fred:
If I wanted to get the Position of the Mouse on the Screen, I did something like this: 'X = WindowX() + WindowMouseX()'
Since that isn't going to be possible after your changes, could you do something like
'ScreenMouseX()' and 'ScreenMouseY()' ?
I know, there is always an API Solution, and I have no problem with that, but
it would be more easy for beginners.
Timo
Posted: Wed Jan 29, 2003 4:42 pm
by BackupUser
Restored from previous forum. Originally posted by plouf.
Why change again ? couldn't be somethink like
WindowMousex([#Flag])
#WithWindowBorder ?
Christos
Posted: Wed Jan 29, 2003 5:02 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.
Originally posted by plouf
Why change again ? couldn't be somethink like
WindowMousex([#Flag])
#WithWindowBorder ?
Christos
Christos idea would be the best solution.
Examples:
WindowMouseX() -> as it is now
WindowMouseY() -> as it is now
WindowMouseX(#PB_Window_InnerWidth) -> only the Inner Area
WindowMouseY(#PB_Window_InnerHeight) -> only the Inner Area
or something like that...
Have a nice day...
Franco
Posted: Wed Jan 29, 2003 5:39 pm
by BackupUser
Restored from previous forum. Originally posted by geoff.
The way I get client area mouse positions is to handle mouse
actions in a Callback:
Procedure Window_message_callback(hwnd,message,wparam,lparam)
Then extract the mouse X and Y positions from the callback long parameter.
mousex=lparam & $FFFF
mousey=lparam >> 16
But extra PureBasic functions ClientMouseX(), ClientMouseY() would be better.
My plea to Fred is please don't change existing commands unless they
are wrong. Having to check through all your existing code, modify it
and re-test it is a huge waste of time and is likely to introduce
bugs into previously good code. The stability and reliability of the
language is just as important as the richness of its features.
Posted: Wed Jan 29, 2003 10:40 pm
by BackupUser
Restored from previous forum. Originally posted by freak.
Yes, geoff's Names make most Sense to me:
WindowMouseX() -> gets the Mouse Position relative to Window Placement (like now).
ClientMouseX() -> gets the Mouse Position relative to the Window's client area.
Like this, WindowMouseX() would not be wrong, as it does exactly what the mname says.
And no need to change existing Code.
Timo
Posted: Tue May 20, 2003 2:43 pm
by dmoc
Did anything change as a result of this thread/ Fred? (<<< Ha, Ha, I crack myself up sometimes

)
I would like the choice of mouse coords wrt window or screen (esp screen at the mo), but I'd also like a platform independent PB command. ???