aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/GUI/Control.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-17 14:34:59 -0400
committerMichael <[email protected]>2017-07-17 14:34:59 -0400
commita0ee79dbcd26a8f07d493a7e993cbaf0d02e44db (patch)
treed974220621e6cfcfe745c2825149ca370e3a7aab /ShiftOS.Frontend/GUI/Control.cs
parente929a9f5105c00b0a3a2b4e75a876bbb95bbfa7b (diff)
downloadshiftos_thereturn-a0ee79dbcd26a8f07d493a7e993cbaf0d02e44db.tar.gz
shiftos_thereturn-a0ee79dbcd26a8f07d493a7e993cbaf0d02e44db.tar.bz2
shiftos_thereturn-a0ee79dbcd26a8f07d493a7e993cbaf0d02e44db.zip
Hacking, barebones fskimmer, double clicking
Diffstat (limited to 'ShiftOS.Frontend/GUI/Control.cs')
-rw-r--r--ShiftOS.Frontend/GUI/Control.cs7
1 files changed, 5 insertions, 2 deletions
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<Point> MouseMove;
public event Action MouseEnter;
public event Action MouseLeave;