//------------------------------------------------------------------------ public void HandleMouseDown(System.Windows.Forms.MouseEventArgs e) { _canvasViewport.FullMode = false; UIMouseEventArgs mouseEventArgs = GetTranslatedUIMouseEventArgs(e); _topWinEventRoot.RootMouseDown(mouseEventArgs); if (_currentCursorStyle != mouseEventArgs.MouseCursorStyle) { ChangeCursor(_currentCursorStyle = mouseEventArgs.MouseCursorStyle); } ReleaseUIMouseEventArgs(mouseEventArgs); PrepareRenderAndFlushAccumGraphics(); #if DEBUG RootGraphic visualroot = this.dbugTopwin.dbugVRoot; if (visualroot.dbug_RecordHitChain) { dbug_rootDocHitChainMsgs.Clear(); visualroot.dbug_DumpCurrentHitChain(dbug_rootDocHitChainMsgs); dbug_InvokeHitChainMsg(); } #endif }
//------------------------------------------------------------------------ public void HandleMouseDown(MouseEventArgs e) { canvasViewport.FullMode = false; this.topWinEventRoot.RootMouseDown( e.X + this.canvasViewport.ViewportX, e.Y + this.canvasViewport.ViewportY, (int)e.Button); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); #if DEBUG RootGraphic visualroot = this.dbugTopwin.dbugVRoot; if (visualroot.dbug_RecordHitChain) { dbug_rootDocHitChainMsgs.Clear(); visualroot.dbug_DumpCurrentHitChain(dbug_rootDocHitChainMsgs); dbug_InvokeHitChainMsg(); } #endif }
void ITopWindowEventRoot.RootMouseUp(int x, int y, int button) { int xdiff = x - prevLogicalMouseX; int ydiff = y - prevLogicalMouseY; this.prevLogicalMouseX = x; this.prevLogicalMouseY = y; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, 0, button); e.SetDiff(xdiff, ydiff); //---------------------------------- e.IsDragging = isDragging; this.isMouseDown = this.isDragging = false; DateTime snapMouseUpTime = DateTime.Now; TimeSpan timediff = snapMouseUpTime - lastTimeMouseUp; this.lastTimeMouseUp = snapMouseUpTime; if (this.isDragging) { if (draggingElement != null) { //send this to dragging element first int d_GlobalX, d_globalY; draggingElement.GetGlobalLocation(out d_GlobalX, out d_globalY); e.SetLocation(e.GlobalX - d_GlobalX, e.GlobalY - d_globalY); e.CapturedMouseX = this.localMouseDownX; e.CapturedMouseY = this.localMouseDownY; var iportal = draggingElement as IEventPortal; if (iportal != null) { iportal.PortalMouseUp(e); if (!e.IsCanceled) { draggingElement.ListenMouseUp(e); } } else { draggingElement.ListenMouseUp(e); } } } else { e.IsAlsoDoubleClick = timediff.Milliseconds < dblClickSense; iTopBoxEventPortal.PortalMouseUp(e); } this.localMouseDownX = this.localMouseDownY = 0; this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
void ITopWindowEventRoot.RootMouseUp(int x, int y, UIMouseButtons button) { int xdiff = x - _prevLogicalMouseX; int ydiff = y - _prevLogicalMouseY; _prevLogicalMouseX = x; _prevLogicalMouseY = y; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); e.SetDiff(xdiff, ydiff); //---------------------------------- e.IsDragging = _isDragging; _isMouseDown = _isDragging = false; DateTime snapMouseUpTime = DateTime.Now; TimeSpan timediff = snapMouseUpTime - _lastTimeMouseUp; _lastTimeMouseUp = snapMouseUpTime; if (_isDragging) { if (_draggingElement != null) { //send this to dragging element first _draggingElement.GetGlobalLocation(out int d_GlobalX, out int d_globalY); e.SetLocation(e.GlobalX - d_GlobalX, e.GlobalY - d_globalY); e.CapturedMouseX = _localMouseDownX; e.CapturedMouseY = _localMouseDownY; var iportal = _draggingElement as IEventPortal; if (iportal != null) { iportal.PortalMouseUp(e); if (!e.IsCanceled) { _draggingElement.ListenMouseUp(e); } } else { _draggingElement.ListenMouseUp(e); } } } else { e.IsAlsoDoubleClick = timediff.Milliseconds < _dblClickSense; if (e.IsAlsoDoubleClick) { } _iTopBoxEventPortal.PortalMouseUp(e); } _localMouseDownX = _localMouseDownY = 0; _mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
void ITopWindowEventRoot.RootMouseMove(int x, int y, UIMouseButtons button) { int xdiff = x - prevLogicalMouseX; int ydiff = y - prevLogicalMouseY; this.prevLogicalMouseX = x; this.prevLogicalMouseY = y; if (xdiff == 0 && ydiff == 0) { return; } //------------------------------------------------------- //when mousemove -> reset hover! hoverMonitoringTask.Reset(); hoverMonitoringTask.Enabled = true; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); e.SetDiff(xdiff, ydiff); //------------------------------------------------------- e.IsDragging = this.isDragging = this.isMouseDown; if (this.isDragging) { if (draggingElement != null) { //send this to dragging element first int d_GlobalX, d_globalY; draggingElement.GetGlobalLocation(out d_GlobalX, out d_globalY); e.SetLocation(e.GlobalX - d_GlobalX, e.GlobalY - d_globalY); e.CapturedMouseX = this.localMouseDownX; e.CapturedMouseY = this.localMouseDownY; var iportal = draggingElement as IEventPortal; if (iportal != null) { iportal.PortalMouseMove(e); if (!e.IsCanceled) { draggingElement.ListenMouseMove(e); } } else { draggingElement.ListenMouseMove(e); } } } else { iTopBoxEventPortal.PortalMouseMove(e); draggingElement = null; } //------------------------------------------------------- this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
public void HandleMouseWheel(MouseEventArgs e) { canvasViewport.FullMode = true; this.topWinEventRoot.RootMouseWheel(e.Delta); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseWheel(int delta) { _canvasViewport.FullMode = true; _topWinEventRoot.RootMouseWheel(delta); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseWheel(System.Windows.Forms.MouseEventArgs e) { _canvasViewport.FullMode = true; _topWinEventRoot.RootMouseWheel(e.Delta); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
//------------------ public void HandleMouseMove(System.Windows.Forms.MouseEventArgs e) { UIMouseEventArgs mouseEventArgs = GetTranslatedUIMouseEventArgs(e); _topWinEventRoot.RootMouseMove(mouseEventArgs); if (_currentCursorStyle != mouseEventArgs.MouseCursorStyle) { ChangeCursor(_currentCursorStyle = mouseEventArgs.MouseCursorStyle); } ReleaseUIMouseEventArgs(mouseEventArgs); PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseMove(System.Windows.Forms.MouseEventArgs e) { _topWinEventRoot.RootMouseMove( e.X + _canvasViewport.ViewportX, e.Y + _canvasViewport.ViewportY, GetMouseButton(e.Button)); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseMove(MouseEventArgs e) { this.topWinEventRoot.RootMouseMove( e.X + this.canvasViewport.ViewportX, e.Y + this.canvasViewport.ViewportY, GetMouseButton(e.Button)); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseMove(int x, int y, UIMouseButtons b) { _topWinEventRoot.RootMouseMove( x + _canvasViewport.ViewportX, y + _canvasViewport.ViewportY, b); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseUp(System.Windows.Forms.MouseEventArgs e) { canvasViewport.FullMode = false; topWinEventRoot.RootMouseUp( e.X + this.canvasViewport.ViewportX, e.Y + this.canvasViewport.ViewportY, GetMouseButton(e.Button)); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
void ITopWindowEventRoot.RootMouseWheel(int delta) { UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, 0, 0, 0, delta); if (currentMouseActiveElement != null) { currentMouseActiveElement.ListenMouseWheel(e); } iTopBoxEventPortal.PortalMouseWheel(e); this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
//static UIMouseButtons GetMouseButton(System.Windows.Forms.MouseButtons button) //{ // switch (button) // { // case MouseButtons.Left: // return UIMouseButtons.Left; // case MouseButtons.Right: // return UIMouseButtons.Right; // case MouseButtons.Middle: // return UIMouseButtons.Middle; // default: // return UIMouseButtons.Left; // } //} public void HandleMouseUp(int x, int y, UIMouseButtons b) { canvasViewport.FullMode = false; topWinEventRoot.RootMouseUp( x + this.canvasViewport.ViewportX, y + this.canvasViewport.ViewportY, b); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseWheel(System.Windows.Forms.MouseEventArgs e) { _canvasViewport.FullMode = true; UIMouseEventArgs mouseEventArgs = GetTranslatedUIMouseEventArgs(e); _topWinEventRoot.RootMouseWheel(mouseEventArgs); if (_currentCursorStyle != mouseEventArgs.MouseCursorStyle) { ChangeCursor(_currentCursorStyle = mouseEventArgs.MouseCursorStyle); } ReleaseUIMouseEventArgs(mouseEventArgs); PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseMove(int x, int y) { //check is draging or not UIMouseEventArgs mouseEventArgs = GetTranslatedUIMouseEventArgs(MouseButton.LeftButton, x, y); _topWinEventRoot.RootMouseMove(mouseEventArgs); if (_currentCursorStyle != mouseEventArgs.MouseCursorStyle) { ChangeCursor(_currentCursorStyle = mouseEventArgs.MouseCursorStyle); } ReleaseUIMouseEventArgs(mouseEventArgs); PrepareRenderAndFlushAccumGraphics(); }
public void HandleMouseUp(MouseButton b, int x, int y) { _canvasViewport.FullMode = false; UIMouseEventArgs mouseEventArgs = GetTranslatedUIMouseEventArgs(b, x, y); _topWinEventRoot.RootMouseUp(mouseEventArgs); if (_currentCursorStyle != mouseEventArgs.MouseCursorStyle) { ChangeCursor(_currentCursorStyle = mouseEventArgs.MouseCursorStyle); } ReleaseUIMouseEventArgs(mouseEventArgs); PrepareRenderAndFlushAccumGraphics(); }
// void ITopWindowEventRoot.RootMouseDown(int x, int y, UIMouseButtons button) { _prevLogicalMouseX = x; _prevLogicalMouseY = y; _isMouseDown = true; _isDragging = false; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); // e.Shift = _lastKeydownWithShift; e.Alt = _lastKeydownWithAlt; e.Ctrl = _lastKeydownWithControl; // e.PreviousMouseDown = _latestMouseDown; // _iTopBoxEventPortal.PortalMouseDown(e); // _currentMouseActiveElement = _latestMouseDown = e.CurrentContextElement; _localMouseDownX = e.X; _localMouseDownY = e.Y; if (e.DraggingElement != null) { if (e.DraggingElement != e.CurrentContextElement) { //change captured element e.DraggingElement.GetGlobalLocation(out int globalX, out int globalY); //find new capture pos _localMouseDownX = e.GlobalX - globalX; _localMouseDownY = e.GlobalY - globalY; } _draggingElement = e.DraggingElement; } else { if (_currentMouseActiveElement != null && !_currentMouseActiveElement.BypassAllMouseEvents) { _draggingElement = _currentMouseActiveElement; } } _mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
void ITopWindowEventRoot.RootMouseWheel(int delta) { UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, 0, 0, 0, delta); //find element SetUIMouseEventArgsInfo(e, _prevLogicalMouseX, _prevLogicalMouseY, 0, delta); e.Shift = _lastKeydownWithShift; e.Alt = _lastKeydownWithAlt; e.Ctrl = _lastKeydownWithControl; _iTopBoxEventPortal.PortalMouseWheel(e); _mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
void ITopWindowEventRoot.RootMouseDown(int x, int y, UIMouseButtons button) { this.prevLogicalMouseX = x; this.prevLogicalMouseY = y; this.isMouseDown = true; this.isDragging = false; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); // e.Shift = lastKeydownWithShift; e.Alt = lastKeydownWithAlt; e.Ctrl = lastKeydownWithControl; // e.PreviousMouseDown = this.latestMouseDown; // iTopBoxEventPortal.PortalMouseDown(e); // this.currentMouseActiveElement = this.latestMouseDown = e.CurrentContextElement; this.localMouseDownX = e.X; this.localMouseDownY = e.Y; if (e.DraggingElement != null) { if (e.DraggingElement != e.CurrentContextElement) { //change captured element int globalX, globalY; e.DraggingElement.GetGlobalLocation(out globalX, out globalY); //find new capture pos this.localMouseDownX = e.GlobalX - globalX; this.localMouseDownY = e.GlobalY - globalY; } this.draggingElement = e.DraggingElement; } else { this.draggingElement = this.currentMouseActiveElement; } this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
protected override void ChangeCursorStyle(MouseCursorStyle cursorStyle) { switch (cursorStyle) { case MouseCursorStyle.Pointer: { windowControl.Cursor = Cursors.Hand; } break; case MouseCursorStyle.IBeam: { windowControl.Cursor = Cursors.IBeam; } break; default: { windowControl.Cursor = Cursors.Default; } break; } }
protected override void ChangeCursor(MouseCursorStyle cursorStyle) { //switch (cursorStyle) //{ // case MouseCursorStyle.Pointer: // { // _windowControl.Cursor = Cursors.Hand; // } // break; // case MouseCursorStyle.IBeam: // { // _windowControl.Cursor = Cursors.IBeam; // } // break; // default: // { // _windowControl.Cursor = Cursors.Default; // } // break; //} }
protected override void ChangeCursor(MouseCursorStyle cursorStyle) { switch (cursorStyle) { case MouseCursorStyle.Pointer: _windowControl.CurrentCursor = _pointerCur; break; case MouseCursorStyle.IBeam: _windowControl.CurrentCursor = _IBeamCur; break; case MouseCursorStyle.Arrow: _windowControl.CurrentCursor = _arrowCur; break; default: _windowControl.CurrentCursor = _defaultCur; break; } }
void UpdateCursor() { if (_topWinEventRoot.RequestCursor != null) { //specific custom cursor _currentCursorStyle = MouseCursorStyle.CustomStyle; if (_latestCustomCursor != _topWinEventRoot.RequestCursor) { //some change ChangeCursor(_latestCustomCursor = _topWinEventRoot.RequestCursor); } } else { _latestCustomCursor = null; if (_currentCursorStyle != _topWinEventRoot.RequestCursorStyle) { ChangeCursor(_currentCursorStyle = _topWinEventRoot.RequestCursorStyle); } } }
//------------------------------------------------------------------------ public void HandleMouseDown(int x, int y, UIMouseButtons b) { _canvasViewport.FullMode = false; _topWinEventRoot.RootMouseDown( x + _canvasViewport.ViewportX, y + _canvasViewport.ViewportY, b); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); #if DEBUG RootGraphic visualroot = this.dbugTopwin.dbugVRoot; if (visualroot.dbug_RecordHitChain) { dbug_rootDocHitChainMsgs.Clear(); visualroot.dbug_DumpCurrentHitChain(dbug_rootDocHitChainMsgs); dbug_InvokeHitChainMsg(); } #endif }
//------------------------------------------------------------------------ public void HandleMouseDown(System.Windows.Forms.MouseEventArgs e) { _canvasViewport.FullMode = false; _topWinEventRoot.RootMouseDown( e.X + _canvasViewport.ViewportX, e.Y + _canvasViewport.ViewportY, GetMouseButton(e.Button)); if (_currentCursorStyle != _topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(_currentCursorStyle = _topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); #if DEBUG RootGraphic visualroot = this.dbugTopwin.dbugVRoot; if (visualroot.dbug_RecordHitChain) { dbug_rootDocHitChainMsgs.Clear(); visualroot.dbug_DumpCurrentHitChain(dbug_rootDocHitChainMsgs); dbug_InvokeHitChainMsg(); } #endif }
void ITopWindowEventRoot.RootMouseDown(int x, int y, UIMouseButtons button) { this.prevLogicalMouseX = x; this.prevLogicalMouseY = y; this.isMouseDown = true; this.isDragging = false; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); e.PreviousMouseDown = this.latestMouseDown; iTopBoxEventPortal.PortalMouseDown(e); this.currentMouseActiveElement = this.latestMouseDown = e.CurrentContextElement; this.localMouseDownX = e.X; this.localMouseDownY = e.Y; if (e.DraggingElement != null) { if (e.DraggingElement != e.CurrentContextElement) { //change captured element int globalX, globalY; e.DraggingElement.GetGlobalLocation(out globalX, out globalY); //find new capture pos this.localMouseDownX = e.GlobalX - globalX; this.localMouseDownY = e.GlobalY - globalY; } this.draggingElement = e.DraggingElement; } else { this.draggingElement = this.currentMouseActiveElement; } this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
protected override void ChangeCursorStyle(MouseCursorStyle cursorStyle) { }
void ITopWindowEventRoot.RootMouseUp(int x, int y, UIMouseButtons button) { int xdiff = x - prevLogicalMouseX; int ydiff = y - prevLogicalMouseY; this.prevLogicalMouseX = x; this.prevLogicalMouseY = y; UIMouseEventArgs e = GetFreeMouseEvent(); SetUIMouseEventArgsInfo(e, x, y, button, 0); e.SetDiff(xdiff, ydiff); //---------------------------------- e.IsDragging = isDragging; this.isMouseDown = this.isDragging = false; DateTime snapMouseUpTime = DateTime.Now; TimeSpan timediff = snapMouseUpTime - lastTimeMouseUp; if (this.isDragging) { if (draggingElement != null) { //send this to dragging element first int d_GlobalX, d_globalY; draggingElement.GetGlobalLocation(out d_GlobalX, out d_globalY); e.SetLocation(e.GlobalX - d_GlobalX, e.GlobalY - d_globalY); e.CapturedMouseX = this.localMouseDownX; e.CapturedMouseY = this.localMouseDownY; var iportal = draggingElement as IEventPortal; if (iportal != null) { iportal.PortalMouseUp(e); if (!e.IsCanceled) { draggingElement.ListenMouseUp(e); } } else { draggingElement.ListenMouseUp(e); } } } else { e.IsAlsoDoubleClick = timediff.Milliseconds < dblClickSense; iTopBoxEventPortal.PortalMouseUp(e); } this.lastTimeMouseUp = snapMouseUpTime; this.localMouseDownX = this.localMouseDownY = 0; this.mouseCursorStyle = e.MouseCursorStyle; ReleaseMouseEvent(e); }
//------------------------------------------------------------------------ public void HandleMouseDown(MouseEventArgs e) { canvasViewport.FullMode = false; this.topWinEventRoot.RootMouseDown( e.X + this.canvasViewport.ViewportX, e.Y + this.canvasViewport.ViewportY, GetMouseButton(e.Button)); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); #if DEBUG RootGraphic visualroot = this.dbugTopwin.dbugVRoot; if (visualroot.dbug_RecordHitChain) { dbug_rootDocHitChainMsgs.Clear(); visualroot.dbug_DumpCurrentHitChain(dbug_rootDocHitChainMsgs); dbug_InvokeHitChainMsg(); } #endif }
public void HandleMouseUp(MouseEventArgs e) { canvasViewport.FullMode = false; topWinEventRoot.RootMouseUp( e.X + this.canvasViewport.ViewportX, e.Y + this.canvasViewport.ViewportY, GetMouseButton(e.Button)); if (currentCursorStyle != this.topWinEventRoot.MouseCursorStyle) { ChangeCursorStyle(this.currentCursorStyle = this.topWinEventRoot.MouseCursorStyle); } PrepareRenderAndFlushAccumGraphics(); }
// protected abstract void ChangeCursor(MouseCursorStyle cursorStyle);
protected abstract void ChangeCursorStyle(MouseCursorStyle cursorStyle);