Using event handlers - (obsolete version)
**Update (22nd August 2006)**
Inspired by netmaestro's work on his MouseHover library, I gladly accepted his help to upgrade the code behind the events #OnCursorEnter and #OnCursorExit which are fired when the mouse cursor enters or exits a registered control respectively.
Needless to say, they now behave exactly as I'd have liked in the first place! No longer can you 'miss' an event by moving the mouse too fast etc. No longer will overlapping controls or overlapping windows adversely effect the firing of these events. E.g. if the cursor moves over an overlapping window then the partly obscured control will immediately fire the #OnCursorExit event - as it should do! Moving the cursor into a container gadget and then into a child of the container will now fire #OnCursorEnter twice without firing a #OnCursorExit. After all, the cursor is still within both controls. Of course every #OnCursorEnter will always be matched with an eventual #OnCursorExit etc.
Those of you using this library should download the new version (link in the first post). Nothing else has changed so no code is broken etc.
Thanks again to netmaestro.
Inspired by netmaestro's work on his MouseHover library, I gladly accepted his help to upgrade the code behind the events #OnCursorEnter and #OnCursorExit which are fired when the mouse cursor enters or exits a registered control respectively.
Needless to say, they now behave exactly as I'd have liked in the first place! No longer can you 'miss' an event by moving the mouse too fast etc. No longer will overlapping controls or overlapping windows adversely effect the firing of these events. E.g. if the cursor moves over an overlapping window then the partly obscured control will immediately fire the #OnCursorExit event - as it should do! Moving the cursor into a container gadget and then into a child of the container will now fire #OnCursorEnter twice without firing a #OnCursorExit. After all, the cursor is still within both controls. Of course every #OnCursorEnter will always be matched with an eventual #OnCursorExit etc.
Those of you using this library should download the new version (link in the first post). Nothing else has changed so no code is broken etc.
Thanks again to netmaestro.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
I've had a good look through this library and I think srod has done a brilliant job of coding here. This tool effectively simplifies the implementation of several difficult concepts, making the power of sophisticated event management instantly available to PureBasic beginner and expert alike. Hats off, srod, great work!
BERESHEIT
You're welcome.fsw wrote:Very good work SRod![]()
Will make good use of it
Must admit that of all the stuff I've written, this is the one I rely upon the most. Only recently have I turned to writing (or attempting to!) commercial software and I'm relying quite heavily on EasyVENT. It just means that I have one less thing to worry about and can concentrate upon the gui and the main program logic etc.
@netmeastro: thanks for the kind words. (How much do I owe you for that?

I may look like a mule, but I'm not a complete ass.
Because of fsw's bug report above, I've had to rewrite the #OnCursorEnter and #OnCursorExit code.
The problem is thread based and, for the life of me, I can't figure out a) what's causing it exactly (we know which line of code is throwing the error, but it makes no sense!) and b) why it only appears on fsw's machine?
Still, taking no chances I've watered the code down a little and whilst the 2 events in question are now not quite as flexible, things are still better than earlier versions of EasyVENT.
Please accept my apologies and download again (see first post for the link).
@fsw: if your machine complains again, do me a favour - chuck it out the window!
Only kidding, I really appreciate your patience in helping me track down the bug, just a shame I can't fix it!
The problem is thread based and, for the life of me, I can't figure out a) what's causing it exactly (we know which line of code is throwing the error, but it makes no sense!) and b) why it only appears on fsw's machine?

Still, taking no chances I've watered the code down a little and whilst the 2 events in question are now not quite as flexible, things are still better than earlier versions of EasyVENT.
Please accept my apologies and download again (see first post for the link).
@fsw: if your machine complains again, do me a favour - chuck it out the window!

Only kidding, I really appreciate your patience in helping me track down the bug, just a shame I can't fix it!
I may look like a mule, but I'm not a complete ass.
Your PB resident file should have this structure already defined!
Weird!
Try pasting this into the top of the main library file:
**EDIT: I've uploaded a new version which will define this structure if not already present.
Weird!
Try pasting this into the top of the main library file:
Code: Select all
Structure ENLINK
nmhdr.NMHDR
msg.l
wParam.l
lParam.l
chrg.CHARRANGE
EndStructure
I may look like a mule, but I'm not a complete ass.