A little MouseHover Library (last update: August 10, 2016)

Developed or developing a new product in PureBasic? Tell the world about it.
Brice Manuel

Post by Brice Manuel »

Makes a nice Father's Day present :lol: Thank you Netmaestro!
X
Enthusiast
Enthusiast
Posts: 311
Joined: Tue Apr 04, 2006 6:27 am

Post by X »

I am sorry for the delay, but a code is missing in the OP.

Code: Select all

EndHoverEvents(WindowID(0)) 
How do we duplicate that procedure?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: A little MouseHover Library (last update: June 17, 2007)

Post by Kwai chang caine »

Thanks to SROD i use this great mouse hook
But i don't know how can i stop it ??? :roll:

Is it possible to create this function please ?? :oops:

Code: Select all

EndHoverEvents(WindowID(0)) 
ImageThe happiness is a road...
Not a destination
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: A little MouseHover Library (last update: June 17, 2007)

Post by rsts »

netmaestro wrote: Update June 17, 2007: HoverGadgets Library Installer available at http://www.networkmaestro.com/HoverGadg ... taller.exe
Mr Maestro,

Do you remember if the installer included any code changes, and if so, is it available at your new site? Or if you've created something better?

cheers
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: A little MouseHover Library (last update: June 17, 2007)

Post by netmaestro »

There seems to be some problems with this code on Win7 and/or with the latest compiler. In the years since I wrote this I've come up with a couple of ideas to make it a lot cleaner and generally better but I haven't really found the time to get back to it. Such is the case for the next couple of days too but on the weekend I'm going to tackle it and implement some of these ideas. There should be an update by Sunday afternoon at the latest and hopefully we can see some improvements.
BERESHEIT
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: A little MouseHover Library (last update: June 17, 2007)

Post by rsts »

I appreciate it, but don't go out of your way if you've got more pressing items. I'm already more than enough in your debt :)

cheers
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: A little MouseHover Library (last update: January 30, 20

Post by netmaestro »

When I saw that this doesn't work under Win7 I had a good look at the code and I really couldn't believe I wrote it. It really was bad. Anyway, I rewrote the library with a more sensible approach and dropped the idea of automatically covering all gadgets in an application with hover events. Now if you want a gadget to get hover events, you specify it. Some gadgets make sense to receive hover events and some don't. Code is updated in the first post. Old code is replaced, if you liked it and want to keep it, you're welcome to it. Just say you wrote it please.. :wink:
BERESHEIT
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: A little MouseHover Library (last update: January 30, 20

Post by rsts »

netmaestro wrote:Just say you wrote it please.. :wink:
Sorry, but you're already listed as a prime contributor on the program web site. Whenever there's a bug report either you or srod receive credit. :)

Thanks again for another contribution.

cheers
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Re: A little MouseHover Library (last update: January 30, 20

Post by yrreti »

Thanks netmaestro for the update and the demo code.
It looks and works nicely.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: A little MouseHover Library (last update: January 30, 20

Post by Fangbeast »

Thanks for this library Netmaestro, it has helped crystallise a project that I couldn't continue with otherwise.
Amateur Radio, D-STAR/VK3HAF
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: A little MouseHover Library (last update: January 30, 20

Post by IdeasVacuum »

...The title is misleading, this is a Mighty Mouse Hover Library! :mrgreen:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
jassing
Addict
Addict
Posts: 1745
Joined: Wed Feb 17, 2010 12:00 am

Re: A little MouseHover Library (last update: January 30, 20

Post by jassing »

Great bit of code - thank you.
I wanted to use it to change the layout if they moused over my rmchart -- I didn't have the handle of the chart; but I figured doing it for the container would work -- but it didn't. Any way to get the code to work for a container of another object?

ie:

window
container
rmchart

I set the mouseover for the container - but the chart takes up 100% of the space of the container. The hover stuff doesn't fire; until I slide the chart out of the way.... then it works.
Thank you for your code - very helpful.

-j
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: A little MouseHover Library (last update: August 10, 201

Post by netmaestro »

Significant update today on this library. Previously, if you had a button in a container and both gadgets were added to the hover list, you could only have one "hot" gadget at a time. For example, if you took your mousepointer into the container and the container was larger than the button, if you then surfed over the button, the container would fire an exit message and the button would fire entry. Not so anymore. If you have several layers of containers and gadgets and all of them are set to detect hovers, all containing gadgets will show as still "hot" as you drill deeper into the stack. So, let's consider a simple example. Container1 holds container2, which in turn holds button1. Moving from the outside in, the messages will fire as follows:

Entered container1
Entered container2
Entered button1

And then moving back out:

Left button1
Left container2
Left container1

This update makes the library quite a bit more robust as you might want to show visual feedback to users of the nested gadgets the mouse is currently inside.

Changes to hover based on keyboard entry can't break this library as it's based on a hook, not mousemoves. (panel example included, push the button and use the TAB and then right-arrow key to move to the next panel tab and all current hovers are cancelled. If the cursor lands on the button on tab 2, entry is fired. All without touching the mouse.)
BERESHEIT
mestnyi
Addict
Addict
Posts: 995
Joined: Mon Nov 25, 2013 6:41 am

Re: A little MouseHover Library (last update: August 10, 201

Post by mestnyi »

This is why it is so?

Code: Select all

Procedure CallWndProc(nCode, wParam, lParam)
  If nCode < 0
    result = CallNextHookEx_(0, nCode, wParam, lParam)
  EndIf
  
  ;
  ; code
  ;
  
  If ncode<0
    ProcedureReturn result
  Else
    ProcedureReturn CallNextHookEx_(0, nCode, wParam, lParam)
  EndIf
  
EndProcedure
And it was impossible to write like that?

Code: Select all

Procedure CallWndProc(nCode, wParam, lParam)
  
  
  ;
  ; code
  ;
  
  ProcedureReturn CallNextHookEx_(0, nCode, wParam, lParam)
EndProcedure

User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: A little MouseHover Library (last update: August 10, 201

Post by netmaestro »

Actually that should be fine as CallNextHookEx would be called in all cases, including when nCode<0. iirc I took the doc to mean it needed to be called immediately if nCode<0. I'll change it and see if there's any problem but probably not. Thanks mestnyi!
BERESHEIT
Post Reply