Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Mouse events are raised many times per one action.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ahang

8 Posts

Posted - 11 Apr 2009 :  02:56:19  Show Profile  Reply with Quote
Hi~QC

Mouse events are raised many times per one action.

-> [OnDoubleClick]
When datapoint is double-clicked, [OnDoubleClick] event is fired 4 or 5 times...

[OnMouseOver] is same manner ...
Actually, custom tool tip is shown very well with user.
but internally event is fired many times.

Thank u !!

reference as below :

public class ChartMouseListener : DataToolTip
{
....

public override void OnMouseUp(MouseEventArgs mouseevent)
{
base.OnMouseUp(mouseevent);
GetChartObjComponent().UpdateDraw();
}

public override void OnDoubleClick(EventArgs mouseevent)
{
MouseEventArgs mouseevent2 = mouseevent as MouseEventArgs;
Point2D mousepos = new Point2D();
mousepos.SetLocation(mouseevent2.X, mouseevent2.Y);

base.OnDoubleClick(mouseevent);

ChartPlot selectedPlot = (ChartPlot)GetSelectedPlotObj();
if (selectedPlot != null)
{
// Pop up the form
}
}

public override void OnMouseMove(MouseEventArgs mouseevent)
{
Point2D mousepos = new Point2D();
mousepos.SetLocation(mouseevent.X, mouseevent.Y);

base.OnMouseMove(mouseevent);

MouseEventArgs mouseClickEventArgs =
new MouseEventArgs(MouseButtons.Left, 1, mouseevent.X,
mouseevent.Y, mouseevent.Delta);
base.OnMouseDown(mouseClickEventArgs);

ChartPlot selectedPlot = (ChartPlot)GetSelectedPlotObj();
if (selectedPlot != null)
{
// Show the specific tool-tips
}
else
{
GetChartObjComponent().UpdateDraw();
}
}
}


public partial class NtStandardChart : ChartView
{
.......

ChartMouseListener chartDataCursor = new ChartMouseListener(this);
chartDataCursor.SetDataToolTipFormat(ChartObj.DATA_TOOLTIP_CUSTOM);
chartDataCursor.SetEnable(true);

chartVu.SetCurrentMouseListener(chartDataCursor);

.......
}

SMILE

quinncurtis

1164 Posts

Posted - 11 Apr 2009 :  16:37:01  Show Profile  Reply with Quote
The DataTooltip class does not process either the OnDoubleClick, or OnMouseMove events. So any problem with these events must be in your own code.

The .Net OnMouseMove event generates an event with every pixel move of the mouse. If you implement this event, moving the mouse cursor into the affected window will, by design, generate many, many OnMouseMove events. This is the way .Net handles the OnMouseMove event and it has nothing to do with our software.

We implemented a simple test for the OnDoubleClick event, adding the following OnDoubleClick event code to our CustomDataTooltips.OHLCChart example program. We double clicked 10 times, then check the counter and found a count of 10. So we cannot reproduce the problem you describe.

Are you still using the trial version of the software (you are past the 30 day trial window), or are you using a commercial version of the software?

int count = 0;
public override void OnDoubleClick(EventArgs mouseevent)
{
  MouseEventArgs mouseevent2 = mouseevent as MouseEventArgs;
  Point2D mousepos = new Point2D();
  mousepos.SetLocation(mouseevent2.X, mouseevent2.Y);
  base.OnDoubleClick(mouseevent);
  ChartPlot selectedPlot = (ChartPlot)GetSelectedPlotObj();
  if (selectedPlot != null)
  {
      count++;
   }
}


Quinn-Curtis Customer Support

Go to Top of Page

ahang

8 Posts

Posted - 12 Apr 2009 :  20:14:55  Show Profile  Reply with Quote
Now~ I'm using a commercial version of the software. :D
Don't worry about that~

Anyway it's starange~

I don't have code that process with mouse events, only using with DataToolTip ...

If my code has several PhysicalCoordinates, is it possible .. ??

Ps) I already check your sample code, it works good~

SMILE
Go to Top of Page

quinncurtis

1164 Posts

Posted - 12 Apr 2009 :  22:54:40  Show Profile  Reply with Quote
The CustomDataTooltips.OHLCChart has multiple coordinate systems, so that cannot be the problem.

Are you using the same custom tooltip for multiple ChartView objects?

As we said, the OnMouseOver event will produce many events, so that is not a problem.

When you use a counter to count the OnDoubleClick events, how many events do you get for each double click.

You should try and remove complexity from your program and see if the problem goes away. Then describe what additional code causes the problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07