Search
FlowChart.HitTestSelHandles Event
See Also
 



Raised to allow custom hit testing of selection handles.

 Syntax

VB6  Copy Code

Public Event HitTestSelHandles

 Event Data

Parameter

Type

Description

obj

[input] a diagram item

The item whose selection handles should be hit-tested.

docX

[input] long

The X coordinate of the current mouse document position.

docY

[input] long

The Y coordinate of the current mouse document position.

hitResult

[output] long

Index of a selection handle if one is hit, otherwise -1.

Dispatch ID: 88

 Remarks

The event is raised for boxes whose SelStyle is set to sstCustom. It allows overriding the default FlowChartX selection handle hit-testing, e.g. specifying which part of an object allows resizing, which allows moving, etc. If a handle is hit, the value returned via hitResult should match the handle indices listed in the MnpHandlesMask topic, or it should be set to -1 if there isn't any handle hit.

 Example

The following MFC sample shows how to perform custom hit testing.

C++  Copy Code

void CCustomDrawDlg::onHitTestSelHandles(LPDISPATCH obj, long docX, long docY, long* hitResult)
{
    BoxItem box = obj;
    if (box)
    {
        POINT point = { docX, docY };
        RECT rect = { box.GetLeft(), box.GetTop(), box.GetRight(), box.GetBottom() };

        // if the point is inside the rectangle, allow moving
        if (PtInRect(&rect, point))
            *hitResult = 8;

        box.DetachDispatch();
    }
}

 See Also