THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/12/2008 at 01:32, xxxxxxxx wrote:
This seems to work fine for me:
> \> Bool EdgeCutTool::MouseInput(BaseDocument \*doc, BaseContainer &data;, BaseDraw \*bd, EditorWindow \*win, const BaseContainer &msg;) \> { \> if (!doc) return FALSE; \> \> BaseObject \*op = NULL; \> op = doc->GetActiveObject(); \> if(!op) return TRUE; \> \> Real dx, dy, len = data.GetReal(MDATA_EDGECUTSDK_OFFSET, 0.0); \> BaseContainer device; \> Real mousex = msg.GetLong(BFM_INPUT_X); \> Real mousey = msg.GetLong(BFM_INPUT_Y); \> win->MouseDragStart(KEY_MLEFT, mousex, mousey, MOUSEDRAG_NOMOVE); \> \> AutoAlloc<ViewportSelect> vps; \> if(!vps) return FALSE; \> \> LONG left, top, right, bottom, width, height; \> bd->GetFrame(&left;, ⊤, &right;, ⊥); \> width = right - left + 1; \> height = bottom - top + 1; \> \> if(!vps->Init(width, height, bd, op, doc->GetMode(), TRUE, VIEWPORT_IGNORE_HIDDEN_SEL)) return FALSE; \> \> vps->SetBrushRadius(50); \> \> LONG x = mousex; \> LONG y = mousey; \> \> vps->ShowHotspot(win, x, y); \> \> while (win->MouseDrag(&dx;, &dy;, &device;) == MOUSEDRAG_CONTINUE) \> { \> if (dx == 0 && dy == 0) \> continue; \> \> x += dx; \> y += dy; \> \> DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION); \> vps->ShowHotspot(win, x, y); \> } \> \> vps->ShowHotspot(win, x, y); \> \> win->MouseDragEnd(); \> \> return TRUE; \> } \>
I called ShowHotspot() before and after the while loop to draw and clear the circle. In the while loop I called it after the redraw.
cheers,
Matthias