Describe the bug
Not sure exactly what is going on but I am trying to stop clicks going through to SliderView in TGD. This approach seems to work for other views.
I tried looking at gui.cs\UnitTests\Views\SliderTests.cs` for mouse tests but couldn't see any to adapt for repro.
if (subView.GetType().IsGenericType(typeof(Slider<>)))
{
// TODO: Does not seem to work
subView.MouseEvent += (s, e) => SuppressNativeClickEvents(s, e,true);
subView.MouseClick += (s, e) => SuppressNativeClickEvents(s,e, true);
}
...
private void SuppressNativeClickEvents(object? sender, MouseEventEventArgs obj, bool alsoSuppressClick = false)
{
if (alsoSuppressClick)
{
obj.Handled = true;
}
else
{
// Suppress everything except single click (selection)
obj.Handled = obj.MouseEvent.Flags != MouseFlags.Button1Clicked;
}
}