ChartDirector 7.1 (C++ Edition)

CChartViewer.setMouseUsage


Usage

void setMouseUsage(int mouseUsage);

Description

Sets the mouse usage mode.

The following table describes the supported mouse usage modes and the mouse behaviour in each mode.

ConstantValueDescription
MouseUsageDefault0This represents the default mouse behaviour, which is to support tool tips and hot spot events as defined by the image map.

See CChartViewer.setImageMap on how to define an image map for a chart.
MouseUsageScroll1The mouse is used for drag scrolling the chart.

When the mouse drags on the plot area, the mouse cursor will change to a scroll cursor, the viewport coordinates will shift to reflect the amount dragged, and CVN_ViewPortChanged messages will be sent to the parent container.

If the mouse is not dragging inside the plot area, its behaviour is the same as the default mouse behaviour.
MouseUsageZoomIn3The mouse is used for zoom in actions.

When the mouse is inside the plot area, the following behaviour will apply:

  • The mouse cursor will change to a zoom in cursor (a magnifying glass cursor with a '+' sign inside).

  • When the mouse drags on the plot area, a selection rectangle will be visible. When the mouse button is subsequently released, the viewport coordinates will be updated to reflect the selection rectangle, and a CVN_ViewPortChanged message will be sent to the parent container.

  • When the mouse clicks on the plot area without dragging, the viewport will be updated to reflect zooming into the clicked point by a ratio specified in CChartViewer.setZoomInRatio, and a CVN_ViewPortChanged message will be sent to the parent container.
If the mouse is not inside the plot area, its behaviour is the same as the default mouse behaviour.
MouseUsageZoomOut4The mouse is used for zoom out actions.

When the mouse is inside the plot area, the following behaviour will apply:

  • The mouse cursor will change to a zoom out cursor (a magnifying glass cursor with a '-' sign inside).

  • When the mouse clicks on the plot area , the viewport will be updated to reflect zooming out from the clicked point by a ratio specified in CChartViewer.setZoomOutRatio, and a CVN_ViewPortChanged message will be sent to the parent container.
If the mouse is not inside the plot area, its behaviour is the same as the default mouse behaviour.

Arguments

ArgumentDefaultDescription
mouseUsage(Mandatory)The mouse usage mode of the control, which must be one of the predefined constants as shown in the table above.

Return Value

None