void Mouse_ButtonDown(object sender, MouseButtonEventArgs e) { if (_hoverWidget == null) { MouseButtonDown.Raise(this, e); return; } GraphicObject g = _hoverWidget; while (!g.Focusable) { g = g.Parent as GraphicObject; if (g == null) { return; } } _activeWidget = g; _activeWidget.onMouseDown(this, e); }
public virtual void onMouseDown(object sender, MouseButtonEventArgs e){ if (CurrentInterface.eligibleForDoubleClick == this && CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick) onMouseDoubleClick (this, e); else currentInterface.clickTimer.Restart(); CurrentInterface.eligibleForDoubleClick = null; if (CurrentInterface.ActiveWidget == null) CurrentInterface.ActiveWidget = this; if (this.Focusable && !Interface.FocusOnHover) { BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg; if (be.Focused == null) { be.Focused = this; CurrentInterface.FocusedWidget = this; } } //bubble event to the top GraphicObject p = Parent as GraphicObject; if (p != null) p.onMouseDown(sender,e); MouseDown.Raise (this, e); }
void Mouse_ButtonDown(object sender, MouseButtonEventArgs e) { if (_hoverWidget == null) { MouseButtonDown.Raise (this, e); return; } GraphicObject g = _hoverWidget; while (!g.Focusable) { g = g.Parent as GraphicObject; if (g == null) { return; } } _activeWidget = g; _activeWidget.onMouseDown (this, e); }