|
|
|
|
|
|
PointerUpEventListener onPointerUp = null, |
|
|
|
PointerCancelEventListener onPointerCancel = null, |
|
|
|
PointerScrollEventListener onPointerScroll = null, |
|
|
|
HitTestBehavior behavior = HitTestBehavior.deferToChild, |
|
|
|
Widget child = null, |
|
|
|
|
|
|
|
// Drag & Drop
|
|
|
|
PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null |
|
|
|
PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null, |
|
|
|
HitTestBehavior behavior = HitTestBehavior.deferToChild, |
|
|
|
Widget child = null |
|
|
|
) : base(key: key, child: child) { |
|
|
|
this.onPointerDown = onPointerDown; |
|
|
|
this.onPointerMove = onPointerMove; |
|
|
|
|
|
|
this.onPointerEnter = onPointerEnter; |
|
|
|
this.onPointerScroll = onPointerScroll; |
|
|
|
this.behavior = behavior; |
|
|
|
|
|
|
|
// Drag & Drop
|
|
|
|
|
|
|
|
this.onPointerDragFromEditorEnter = onPointerDragFromEditorEnter; |
|
|
|
this.onPointerDragFromEditorHover = onPointerDragFromEditorHover; |
|
|
|
this.onPointerDragFromEditorExit = onPointerDragFromEditorExit; |
|
|
|
|
|
|
public readonly PointerScrollEventListener onPointerScroll; |
|
|
|
|
|
|
|
public readonly HitTestBehavior behavior; |
|
|
|
|
|
|
|
// Drag & Drop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) { |
|
|
|
return new RenderPointerListener( |
|
|
|
onPointerDown: this.onPointerDown, |
|
|
|
|
|
|
onPointerExit: this.onPointerExit, |
|
|
|
onPointerHover: this.onPointerHover, |
|
|
|
onPointerScroll: this.onPointerScroll, |
|
|
|
behavior: this.behavior, |
|
|
|
|
|
|
|
// Drag & Drop
|
|
|
|
onPointerDragFromEditorRelease: this.onPointerDragFromEditorRelease |
|
|
|
onPointerDragFromEditorRelease: this.onPointerDragFromEditorRelease, |
|
|
|
behavior: this.behavior |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
renderObject.behavior = this.behavior; |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
// Drag & Drop
|
|
|
|
renderObject.onPointerDragFromEditorEnter = this.onPointerDragFromEditorEnter; |
|
|
|
renderObject.onPointerDragFromEditorHover = this.onPointerDragFromEditorHover; |
|
|
|
renderObject.onPointerDragFromEditorExit = this.onPointerDragFromEditorExit; |
|
|
|
|
|
|
if (this.onPointerScroll != null) { |
|
|
|
listeners.Add("scroll"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Drag & Drop
|
|
|
|
if (this.onPointerDragFromEditorEnter != null) listeners.Add("dragFromEditorEnter"); |
|
|
|
if (this.onPointerDragFromEditorHover != null) listeners.Add("dragFromEditorHover"); |
|
|
|
if (this.onPointerDragFromEditorExit != null) listeners.Add("dragFromEditorExit"); |
|
|
|
if (this.onPointerDragFromEditorRelease != null) listeners.Add("dragFromEditorRelease"); |
|
|
|
if (this.onPointerDragFromEditorEnter != null) { |
|
|
|
listeners.Add("dragFromEditorEnter"); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.onPointerDragFromEditorHover != null) { |
|
|
|
listeners.Add("dragFromEditorHover"); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.onPointerDragFromEditorExit != null) { |
|
|
|
listeners.Add("dragFromEditorExit"); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.onPointerDragFromEditorRelease != null) { |
|
|
|
listeners.Add("dragFromEditorRelease"); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
properties.add(new EnumerableProperty<string>("listeners", listeners, ifEmpty: "<none>")); |
|
|
|