Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Mouse over event for Boxes and arrows (Read 4554 times)
isaac.contreras-pu
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Sep 19th, 2005
Mouse over event for Boxes and arrows
Sep 19th, 2005 at 10:16pm
Print Post  
Hello.

My question is:

How can I generate an event when the mouse is over a box or arrow?
I'm almost sure that this is possible, but I havent found the event that could do this.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mouse over event for Boxes and arrows
Reply #1 - Sep 20th, 2005 at 7:14am
Print Post  
Hello,

You can use the MouseMove event to detect that:

private void fc_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{

Point clientPt = new Point(e.X, e.Y);

PointF docPt = fc.ClientToDoc(clientPt);

Box b = fc.GetBoxAt(docPt);
       ....
}

Regards,
  Stoyan
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Mouse over event for Boxes and arrows
Reply #2 - Sep 25th, 2005 at 3:01pm
Print Post  
Any solution to detect Row Index of the table object when mouse down event raised on that table ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mouse over event for Boxes and arrows
Reply #3 - Sep 25th, 2005 at 6:19pm
Print Post  
There is a TableCellClicked event raised when a cell is clicked; use its Row argument to detect clicks on a table row.
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Mouse over event for Boxes and arrows
Reply #4 - Sep 26th, 2005 at 4:16pm
Print Post  
Thanks, but my project needed to detect row index while mouse move over that Table. Is it prosible to do this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mouse over event for Boxes and arrows
Reply #5 - Sep 26th, 2005 at 5:05pm
Print Post  
There is an internal method of the table to return a row index by point coordinates, so we can make this public in next release. Till then you can use this part of the code to find the row index:

float h = Math.Min(rect.Top, rect.Bottom) + captionHeight;
float w = Math.Min(rect.Left, rect.Right);

if (pt.Y < h) return false;

row = 0;
col = columnsCount - 1;

Row r;
int i;
for (i = currScrollRow; i < rowsCount; ++i)
{
r = (Row)rowsList[i];
if (pt.Y >= h && pt.Y < h + r.Height)
{
row = i;
break;
}
h += r.Height;
}
if (i == rowsCount) return false;

The 'rect' above is table's BoundingRect, rowsList is the table's Rows and rowsCount is the tables's Rows.Count.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint