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#)
 Zooming and Tool Tip
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

swalkup

9 Posts

Posted - 16 Jul 2008 :  12:06:31  Show Profile  Reply with Quote
Can I have Zooming and tool tip active at the same time. I would like to have The Middle (under the wheel) mouse button controll the Tool Tip?? Is this possible. And YES I have read & Read!!!

Sam Walkup

Sam Walkup

quinncurtis

1164 Posts

Posted - 16 Jul 2008 :  14:29:10  Show Profile  Reply with Quote
We created a simple utility class, MultiMouseListener, that permits mutliple mouse listeners to be added to the same ChartView.

The MultiMouseListener class allows multiple MouseListener objects to be attached and processed by the chart. It does that by keeping an internal list of all MouseListener objects added to it. The MultiMouseListener is itself a MouseListener and can be attached to a ChartView. Inside it forwards every mouse message that it receives to all MouseListener objects in its list. It is up to the programmer to make sure that the mouse event being trapped do not interfere with one another. An example program that includes the complete c# source of the MultiMouseListener can be downloaded here ->
http://quinn-curtis.com/examplecode/MultiMouseListenerDemo.zip

A VB version can be downloaded here (uses VS 2005 projects).
http://quinn-curtis.com/examplecode/MultiMouseListenerDemoVB.zip

In use it works like:

C#
DataToolTip datatooltip = new DataToolTip(chartVu);
datatooltip.SetDataToolTipFormat(ChartObj.DATA_TOOLTIP_XY_ONELINE);
datatooltip.SetButtonMask(MouseButtons.Left);
datatooltip.SetEnable(true);

ChartZoom zoomObj = new ChartZoom(chartVu, pTransform1, true);
zoomObj.SetButtonMask(MouseButtons.Right);
zoomObj.SetEnable(true);

MultiMouseListener multimouselistener = new MultiMouseListener(datatooltip);
multimouselistener.AddMouseListener(zoomObj);

chartVu.SetCurrentMouseListener(multimouselistener);

************************************

VB - This one hooks the tooltip to the Middle button


Dim zoomObj As New ChartZoom(chartVu, pTransform1, True)
zoomObj.SetButtonMask(System.Windows.Forms.MouseButtons.Left)
zoomObj.SetEnable(True)

Dim datatooltip As DataToolTip = New DataToolTip(chartVu)
datatooltip.SetDataToolTipFormat(ChartObj.DATA_TOOLTIP_XY_ONELINE)
datatooltip.SetButtonMask(MouseButtons.Middle)
datatooltip.SetEnable(True)

Dim multimouselistener As MultiMouseListener = New MultiMouseListener(datatooltip)
multimouselistener.AddMouseListener(zoomObj)

Go to Top of Page

swalkup

9 Posts

Posted - 17 Jul 2008 :  09:02:20  Show Profile  Reply with Quote
Thanks, Works great. Your example needs a little work to allow right click to take the graft back a level.

Thanks


Sam Walkup

Edited by - swalkup on 17 Jul 2008 09:03:13
Go to Top of Page

quinncurtis

1164 Posts

Posted - 17 Jul 2008 :  10:41:45  Show Profile  Reply with Quote
The MultiMouseListener example was designed to be as simple as possible. The ZoomExamples example program that ships with the software demonstrates how to implement a zoom stack.
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