Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic GetHeaderFromPoint not always working (Read 2561 times)
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
GetHeaderFromPoint not always working
Sep 7th, 2009 at 9:45am
Print Post  
In a Lane diagram I am using the following code to detect a double-click on a row header:

       private void diagramView_MouseDoubleClick(object sender, MouseEventArgs e)
       {
           PointF p = diagramView.ClientToDoc(e.Location);

           if (e.Button == MouseButtons.Left)
           {
               Grid grid = flowChart.LaneGrid;
               RectangleF rect = new RectangleF();

               Header header = grid.GetHeaderFromPoint(p, ref rect);

               if (header != null)
              {
                     ...........

This works fine UNLESS the lane diagram has been scrolled horizontally (the row headers are fixed and don't scroll) - in this case header is returned as null.  Is this a bug?

I am using Version 5.3.1
Thanks for your help
DavidL
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: GetHeaderFromPoint not always working
Reply #1 - Sep 7th, 2009 at 2:34pm
Print Post  
In case of hooked headers, you should use the other GetHeaderFromPoint overload and specify the vertical and horizontal scrolling position of the diagram view. The following code illustrates this:

Code
Select All
Header header = grid.GetHeaderFromPoint(p, ref rect,
      new PointF(diagramView.ScrollX, diagramView.ScrollY)); 


I hope this helps,
Meppy
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
Re: GetHeaderFromPoint not always working
Reply #2 - Sep 8th, 2009 at 10:17am
Print Post  
Many thanks - that works fine.
DavidL
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint