protected override int HandlePreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) { if (ShouldProcessEvents(inEvtDispId, pIEventObj)) { if (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN && !Selected) { Select(); //notify the drag drop controller about the mouse down so that drag can be initiated //on the first click that selects this element. (Fixes bug that required 2 clicks to //initial drag/drop). _dragDropController.PreHandleEvent(inEvtDispId, pIEventObj); //cancel the event so that the editor doesn't try to do anything funny (like placing a caret at the click) return(HRESULT.S_OK); } int controlResult = base.HandlePreHandleEvent(inEvtDispId, pIEventObj); if (_dragDropController.PreHandleEvent(inEvtDispId, pIEventObj) == HRESULT.S_OK) { return(HRESULT.S_OK); } //eat the mouse events so that the editor doesn't try to //do anything funny (like opening a browser URL). switch (inEvtDispId) { case DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN: case DISPID_HTMLELEMENTEVENTS2.ONMOUSEUP: return(HRESULT.S_OK); } } return(HRESULT.S_FALSE); }
protected override int HandlePreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) { if (ShouldProcessEvents(inEvtDispId, pIEventObj)) { if (_dragDropController.PreHandleEvent(inEvtDispId, pIEventObj) == HRESULT.S_OK) { return(HRESULT.S_OK); } if (inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN && (Control.MouseButtons & MouseButtons.Right) > 0) { // Select the disabled image so that the context menu shows up correctly. EditorContext.Selection = DisabledImageSelection.SelectElement(EditorContext, HTMLElement); return(HRESULT.S_OK); } } return(HRESULT.S_FALSE); }