From a0ee79dbcd26a8f07d493a7e993cbaf0d02e44db Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Jul 2017 14:34:59 -0400 Subject: Hacking, barebones fskimmer, double clicking --- ShiftOS.Frontend/GUI/Control.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ShiftOS.Frontend/GUI/Control.cs') diff --git a/ShiftOS.Frontend/GUI/Control.cs b/ShiftOS.Frontend/GUI/Control.cs index f253903..d34a97a 100644 --- a/ShiftOS.Frontend/GUI/Control.cs +++ b/ShiftOS.Frontend/GUI/Control.cs @@ -509,7 +509,7 @@ namespace ShiftOS.Frontend.GUI } } - public virtual bool ProcessMouseState(MouseState state) + public virtual bool ProcessMouseState(MouseState state, double lastLeftClickMS) { //If we aren't rendering the control, we aren't accepting input. if (_visible == false) @@ -548,7 +548,7 @@ namespace ShiftOS.Frontend.GUI var nstate = new MouseState(coords.X, coords.Y, state.ScrollWheelValue, state.LeftButton, state.MiddleButton, state.RightButton, state.XButton1, state.XButton2); //pass that state to the process method, and set the _requiresMoreWork value to the opposite of the return value - _requiresMoreWork = !control.ProcessMouseState(nstate); + _requiresMoreWork = !control.ProcessMouseState(nstate, lastLeftClickMS); //If it's false, break the loop. if (_requiresMoreWork == false) break; @@ -575,6 +575,8 @@ namespace ShiftOS.Frontend.GUI } if (_leftState == false && ld == true) { + if (lastLeftClickMS <= 500 & lastLeftClickMS > 0) + DoubleClick?.Invoke(); var focused = UIManager.FocusedControl; UIManager.FocusedControl = this; focused?.InvalidateTopLevel(); @@ -642,6 +644,7 @@ namespace ShiftOS.Frontend.GUI KeyEvent?.Invoke(e); } + public event Action DoubleClick; public event Action MouseMove; public event Action MouseEnter; public event Action MouseLeave; -- cgit v1.2.3