Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic using the MouseHover Event (Read 3930 times)
maxnetpromo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Mar 5th, 2006
using the MouseHover Event
Mar 28th, 2006 at 8:34pm
Print Post  
I wish to use the mouseHover to display information about the selected objects(Boxes or Arrows). is it possible?.

I noticed not many methods are supported by this event.

I guess i need to use the e.GetType() method.
Any tips pls.

also how can i create a context menu for a selected item when pressing the mouse right click button?



thankx

Adrian
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using the MouseHover Event
Reply #1 - Mar 29th, 2006 at 7:32am
Print Post  
MouseHover is declared in the FlowChart's base class - Control. I don't know whether it is raised at all, but if it is, you can use the fc.ClientToDoc method to get the logical coordinates of the mouse pointer location reported by MouseHover. Then use methods such as GetBoxAt and GetArrowAt to find out which object is under the mouse.

You could take a look at the FlowChart.NET sample projects, many of them display context menus. E.g. check the DirTree or the DBDesign samples.

Stoyan
  
Back to top
 
IP Logged
 
maxnetpromo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Mar 5th, 2006
Re: using the MouseHover Event
Reply #2 - Apr 4th, 2006 at 9:03pm
Print Post  
it seem the mouseover event is raised. Can you explain how the fc.ClientToDoc  works pls. it requires a Point or Rectangle objectas input parameters.
From where do i get those pls? I guess that Point would be the mouse X,Y co-ordinates however they are not accessible using the e. notation
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using the MouseHover Event
Reply #3 - Apr 5th, 2006 at 7:24am
Print Post  
If there aren't X and Y parameters passed to the MouseHover handler, try using the static Control.MousePosition property. It gives you the mouse position in screen coordinates, so you must convert first to local client coordinates, then to document logical coordinates, .e.g.

PointF docpt = fc.ClientToDoc(fc.PointToClient(MousePosition));
  
Back to top
 
IP Logged
 
maxnetpromo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Mar 5th, 2006
Re: using the MouseHover Event
Reply #4 - Apr 5th, 2006 at 8:31am
Print Post  
i did it and the method is working perfectly. The box at that locationis being returned.

I wanted to implement this method so i could display my component properties on a panel with labels.

I put an if condition to check whether a box is returned since if the mouse is hovered on an empty area a null is returned. this works fine, however the values are not being displayed in the labels.

It only works when i hover the mouse outside the  flowchart canvas area region and put it back in and point to a component (box). and it only works once. i have to go out again and repaet the process to work for another component.


I am running the method in a single thread. would it help if i run it on a separate thread?





  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using the MouseHover Event
Reply #5 - Apr 5th, 2006 at 8:57am
Print Post  
It seems MouseHover is raised at most once after the mouse enters a control. Try starting a timer from theMouseMove handler, and in the Timer.Tick handler update the labels and stop the timer.
  
Back to top
 
IP Logged
 
maxnetpromo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Mar 5th, 2006
Re: using the MouseHover Event
Reply #6 - Apr 5th, 2006 at 10:54am
Print Post  
it does not seem to be working that way. its still the same problem
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: using the MouseHover Event
Reply #7 - Apr 5th, 2006 at 11:07am
Print Post  
Why wouldn't it work, are not the MouseMove and Timer events raised ?
  
Back to top
 
IP Logged
 
maxnetpromo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Mar 5th, 2006
Re: using the MouseHover Event
Reply #8 - Apr 5th, 2006 at 11:25am
Print Post  
It worked. I used the Windows.Forms mousemove event instead of the Flowchart mousemove event.

thank you very much. its perfect now.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint