public void OnBeginDrag(PointerEventData eventData) { if (!enabled) { return; } if (_canvas.scaleFactor != _scale) { _scale = _canvas.scaleFactor; } lockedaxis = ""; vdistance = 0; hdistance = 0; permanentScrollUntilLimit = 0; GetObjects(); _dragging = true; killTweens(); lastX = eventData.position.x; lastY = eventData.position.y; scrollEvent.Invoke(scrollerName, "begin"); if (parentScroller) { parentScroller.OnBeginDrag(eventData); } }
public void Update(GameTime gameTime) { _previousState = _mouseState; _mouseState = Mouse.GetState(); if (JustPressed) { OnPressedEvent?.Invoke(_mouseState, _previousState); } else if (HeldDown) { OnHeldDownEvent?.Invoke(_mouseState, _previousState); } else if (JustReleased) { OnReleaseEvent?.Invoke(_mouseState, _previousState); } if (_mouseState.ScrollWheelValue != _previousState.ScrollWheelValue) { if (OnScrollEvent != null) { var scrollBy = _mouseState.ScrollWheelValue - _previousState.ScrollWheelValue; OnScrollEvent.Invoke(scrollBy); } } }
public void OnScroll(InputAction.CallbackContext context) { if (context.phase == InputActionPhase.Performed) { ScrollEvent.Invoke(context.ReadValue <float>()); } }
void Set(float input, bool sendCallback) { //If our scrollbar is full size we don't have content to scroll if (size == 1) { return; } float currentValue = m_Value; // Clamp the input m_Value = Mathf.Clamp01(input); // If the stepped value doesn't match the last one, it's time to update if (currentValue == value) { return; } UpdateVisuals(); if (sendCallback) { UISystemProfilerApi.AddMarker("Scrollbar.value", this); m_OnValueChanged.Invoke(value); } }
protected override void WndProc(ref Message m) { if (m.Msg == WmVscroll || m.Msg == WmHscroll || m.Msg == WmKeydown || m.Msg == WmMousewheel) { ScrollEvent?.Invoke(this, null); } base.WndProc(ref m); }
private void Set(float input, bool sendCallback) { float value = m_Value; m_Value = Mathf.Clamp01(input); if (value != this.value) { UpdateVisuals(); if (sendCallback) { m_OnValueChanged.Invoke(this.value); } } }
void Set(float input, bool sendCallback) { float currentValue = m_Value; // Clamp the input m_Value = Mathf.Clamp01(input); // If the stepped value doesn't match the last one, it's time to update if (currentValue == value) { return; } UpdateVisuals(); if (sendCallback) { m_OnValueChanged.Invoke(value); } }
void Set(float input, bool sendCallback = true) { float currentValue = m_Value; // bugfix (case 802330) clamp01 input in callee before calling this function, this allows inertia from dragging content to go past extremities without being clamped m_Value = input; // If the stepped value doesn't match the last one, it's time to update if (currentValue == value) { return; } UpdateVisuals(); if (sendCallback) { UISystemProfilerApi.AddMarker("Scrollbar.value", this); m_OnValueChanged.Invoke(value); } }
private void ProcessEventStuff(ScrollBar scrollBar, ScrollEventArgs e) { if (e.Type == ScrollEventType.ThumbTrack) { ScrollProgressEvent?.Invoke(this, hScrollBar1, _zoomState, new ZoomState(GraphPane, ZoomState.StateType.Scroll)); } else // if ( e.Type == ScrollEventType.ThumbPosition ) { if ((_zoomState != null) && _zoomState.IsChanged(GraphPane)) { //this.GraphPane.ZoomStack.Push( _zoomState ); ZoomStatePush(GraphPane); // Provide Callback to notify the user of pan events ScrollDoneEvent?.Invoke(this, hScrollBar1, _zoomState, new ZoomState(GraphPane, ZoomState.StateType.Scroll)); _zoomState = null; } } ScrollEvent?.Invoke(scrollBar, e); }
public void CallScrollEvent() { ScrollEvent?.Invoke(); }
private void OnScroll() { ScrollEventArgs eventArgs = new ScrollEventArgs(mScrollingChild.CurrentPosition); ScrollEvent?.Invoke(this, eventArgs); }
protected virtual void OnScrollEvent() { ScrollEvent?.Invoke(this, EventArgs.Empty); }