//In both cases I use the following to "close" the TCutG object: if (bComplete) { Region[iRegion]->GetPoint(0, dNewX, dNewY); Region[iCanvas-1]->SetPoint(iNewPoint, dNewX, dNewY); } //In both cases I intercept mouse cliks as follows: //////////////////////// MOUSE FUNCTIONS void CChildView::OnMouseMove(UINT nFlags, CPoint point) { char cPrimitive[40]; if (EventCanvasReady()) { if (bLeftDrag && (nFlags & MK_LBUTTON)) { //if left clicking or dragging strncpy(cPrimitive, gPad->GetSelected()->GetName(), sizeof(cPrimitive)); if (strstr(cPrimitive, "CUT")) fCanvas->HandleInput(kButton1Motion, point.x, point.y); //else disable other left button functions } else { if (nFlags & MK_RBUTTON) ; //disable all right button root functions (for now) else if ((nFlags == 0) && (point != lastPoint)) { fCanvas->HandleInput(kMouseMotion, point.x, point.y); lastPoint = point; bLeftDrag = false; } } } CWnd::OnMouseMove(nFlags, point); } // Left Button functions void CChildView::OnLButtonDown(UINT nFlags, CPoint point) { char cSel[40]; if (iView == CYT_MYSCRIPT1) fCanvas2->HandleInput(kButton1Down, point.x, point.y); else if (EventCanvasReady() && !bLeftDrag) { strncpy(cSel, gPad->GetSelected()->GetName(), sizeof(cSel)); if (strstr(cSel, "CUT") != NULL) { fCanvas->HandleInput(kButton1Down, point.x, point.y); bLeftDrag = true; // wait for left button up } } CWnd::OnLButtonDown(nFlags, point); } void CChildView::OnLButtonUp(UINT nFlags, CPoint point) { char cSel[40]; double dX, dY, dYNew, dMax; if (iView == CYT_MYSCRIPT1) fCanvas2->HandleInput(kButton1Up, point.x, point.y); else if (EventCanvasReady() && bLeftDrag) { strncpy(cSel, gPad->GetSelected()->GetName(), sizeof(cSel)); if (strstr(cSel, "CUT")) { fCanvas->HandleInput(kButton1Up, point.x, point.y); bLeftDrag = false; } } CWnd::OnLButtonUp(nFlags, point); }