public override void checkHoverWidget(MouseMoveEventArgs e) { base.checkHoverWidget(e); if (child != null) { if (child.MouseIsIn(e.Position)) { child.checkHoverWidget(e); } } }
public override void onMouseLeave(object sender, MouseMoveEventArgs e) { if (!_isPopped || _content == null) { base.onMouseLeave(sender, e); System.Diagnostics.Debug.WriteLine("NotPopped***popper mouse leave:" + this.ToString()); return; } if (!_content.MouseIsIn(e.Position)) { base.onMouseLeave(sender, e); System.Diagnostics.Debug.WriteLine("***popper mouse leave:" + this.ToString()); IsPopped = false; return; } }
//public string update = ""; #endregion #region Mouse Handling void Mouse_Move(object sender, MouseMoveEventArgs e) { if (_activeWidget != null) { //first, ensure object is still in the graphic tree if (_activeWidget.HostContainer == null) { activeWidget = null; } else { //send move evt even if mouse move outside bounds _activeWidget.onMouseMove(_activeWidget, e); return; } } if (_hoverWidget != null) { //first, ensure object is still in the graphic tree if (_hoverWidget.HostContainer == null) { hoverWidget = null; } else { //check topmost graphicobject first GraphicObject tmp = _hoverWidget; GraphicObject topc = null; while (tmp is GraphicObject) { topc = tmp; tmp = tmp.Parent as GraphicObject; } int idxhw = GraphicObjects.IndexOf(topc); if (idxhw != 0) { int i = 0; while (i < idxhw) { if (GraphicObjects [i].MouseIsIn(e.Position)) { _hoverWidget.onMouseLeave(this, e); GraphicObjects [i].checkHoverWidget(e); return; } i++; } } if (_hoverWidget.MouseIsIn(e.Position)) { _hoverWidget.checkHoverWidget(e); return; } else { _hoverWidget.onMouseLeave(this, e); //seek upward from last focused graph obj's while (_hoverWidget.Parent as GraphicObject != null) { _hoverWidget = _hoverWidget.Parent as GraphicObject; if (_hoverWidget.MouseIsIn(e.Position)) { _hoverWidget.checkHoverWidget(e); return; } else { _hoverWidget.onMouseLeave(this, e); } } } } } //top level graphic obj's parsing for (int i = 0; i < GraphicObjects.Count; i++) { GraphicObject g = GraphicObjects[i]; if (g.MouseIsIn(e.Position)) { g.checkHoverWidget(e); PutOnTop(g); return; } } _hoverWidget = null; MouseMove.Raise(this, e); }
//public string update = ""; #endregion #region Mouse Handling void Mouse_Move(object sender, MouseMoveEventArgs e) { if (_activeWidget != null) { //first, ensure object is still in the graphic tree if (_activeWidget.HostContainer == null) { activeWidget = null; } else { //send move evt even if mouse move outside bounds _activeWidget.onMouseMove (_activeWidget, e); return; } } if (_hoverWidget != null) { //first, ensure object is still in the graphic tree if (_hoverWidget.HostContainer == null) { hoverWidget = null; } else { //check topmost graphicobject first GraphicObject tmp = _hoverWidget; GraphicObject topc = null; while (tmp is GraphicObject) { topc = tmp; tmp = tmp.Parent as GraphicObject; } int idxhw = GraphicObjects.IndexOf (topc); if (idxhw != 0) { int i = 0; while (i < idxhw) { if (GraphicObjects [i].MouseIsIn (e.Position)) { _hoverWidget.onMouseLeave (this, e); GraphicObjects [i].checkHoverWidget (e); return; } i++; } } if (_hoverWidget.MouseIsIn (e.Position)) { _hoverWidget.checkHoverWidget (e); return; } else { _hoverWidget.onMouseLeave (this, e); //seek upward from last focused graph obj's while (_hoverWidget.Parent as GraphicObject != null) { _hoverWidget = _hoverWidget.Parent as GraphicObject; if (_hoverWidget.MouseIsIn (e.Position)) { _hoverWidget.checkHoverWidget (e); return; } else _hoverWidget.onMouseLeave (this, e); } } } } //top level graphic obj's parsing for (int i = 0; i < GraphicObjects.Count; i++) { GraphicObject g = GraphicObjects[i]; if (g.MouseIsIn (e.Position)) { g.checkHoverWidget (e); PutOnTop (g); return; } } _hoverWidget = null; MouseMove.Raise (this, e); }