Mouse-HotSpot Splitter As A SplitterGadget

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Originally posted by freak

It doesn't work right here (Win2k Sp3). When moving the horizontal splitter, I can't release it any more. When i click the Mouse Button, only the first Element of the bottom ListView get's activated, but the splitter is not released.

Is there something wrong when calculating the mouse position?

Timo
Timo, sorry to hear that.
I coded under WindowsXP-Home-Sp1 and had no problems.
Can't reproduce your bug.
Tomorrow I will test it @work with Win2K-Sp3.

Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

I have this bug also on XP pro SP1
mouse position is wrong.
Because XP has other borders by default, compared to W2k, it fails.
Also on XP themes with wider borders, it fails.

Use this to get the correct mouseposition.

Code: Select all

TopBorder  = GetSystemMetrics_(#SM_CYCAPTION) + GetSystemMetrics_(#SM_CYSIZEFRAME)
LeftBorder = GetSystemMetrics_(#SM_CYSIZEFRAME)

x = WindowMouseX() - LeftBorder
y = WindowMouseY() - TopBorder
Fred: Maybe add this standard to WindowMouseXY, so mouse and gadgets/drawing commands use the same coordinates?

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Didn't expect, that WindowMouseX() and WindowMouseY() refers to the whole
Window not the Client/Inner Area.

Sorry Fred but this seems not logical to me.
If I place a gadget on x10-y10 and I 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.


OK I updated the code to use InnerWindowMouseX() and InnerWindowMouseY().
Berikco thanks for the hint.
Sorry for the inconvenience, hope all works fine now.

Please use the updated code.


Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Works fine here now :)

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
Post Reply