signal?.Connect(wheelEventCallback);
}
wheelEventHandler += value;
-
- if (WindowWheelEventHandler == null)
- {
- NUIApplication.GetDefaultWindow().WheelEvent += OnWindowWheelEvent;
- }
- WindowWheelEventHandler += value;
}
remove
}
}
}
-
- WindowWheelEventHandler -= value;
- if (WindowWheelEventHandler == null)
- {
- NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
- }
}
}
public ControlState CurrentState { get; }
}
- private EventHandlerWithReturnType<object, WheelEventArgs, bool> WindowWheelEventHandler;
- private void OnWindowWheelEvent(object sender, Window.WheelEventArgs e)
- {
- if (e != null)
- {
- if (e.Wheel.Type == Wheel.WheelType.CustomWheel)
- {
- var arg = new WheelEventArgs()
- {
- Wheel = e.Wheel,
- };
- WindowWheelEventHandler?.Invoke(this, arg);
- }
- }
- }
-
/// <summary>
/// The expanded touch area.
/// TouchArea can expand the view's touchable area.<br/>
Window window = NUIApplication.GetDefaultWindow();
root = new View();
+ window.WheelEvent += (s, e) =>
+ {
+ Tizen.Log.Error("NUI", $"window WheelEvent!!!!{e.Wheel.Type}\n");
+ };
- frontView = new View
+ frontView = new View
{
Size = new Size(300, 300),
Position = new Position(150, 170),
BackgroundColor = new Color(1.0f, 0.0f, 0.0f, 1.0f),
+ Focusable = true,
+ FocusableInTouch = true,
};
frontView.TouchEvent += OnFrontTouchEvent;
+ frontView.WheelEvent += (s, e) =>
+ {
+ Tizen.Log.Error("NUI", $"frontView WheelEvent!!!!{e.Wheel.Type}\n");
+ if (e.Wheel.Type == Wheel.WheelType.CustomWheel)
+ {
+ // rotary event
+ }
+ else if (e.Wheel.Type == Wheel.WheelType.MouseWheel)
+ {
+ // mouse wheel event
+ }
+ return false;
+ };
+
+ var middleView = new View
+ {
+ Size = new Size(300, 300),
+ Position = new Position(110, 120),
+ BackgroundColor = new Color(0.0f, 1.0f, 0.0f, 1.0f),
+ Focusable = true,
+ FocusableInTouch = true,
+ };
+
// The default the maximum allowed time is 500ms.
// If you want to change this time, do as below.
Position = new Position(50, 70),
PointSize = 11,
BackgroundColor = new Color(1.0f, 1.0f, 0.0f, 1.0f),
+ Focusable = true,
+ FocusableInTouch = true,
};
backView.TouchEvent += OnBackTouchEvent;
+ backView.WheelEvent += (s, e) =>
+ {
+ Tizen.Log.Error("NUI", $"backView WheelEvent!!!!{e.Wheel.Type}\n");
+ return true;
+ };
// The default the minimum holding time is 500ms.
// If you want to change this time, do as below.
Tizen.Log.Error("NUI", $"OnLongPress\n");
};
+ backView.Add(middleView);
backView.Add(frontView);
root.Add(backView);
window.Add(root);