Example #1
0
        public override void MouseMoved(MouseEvent mouseEvent)
        {
            if (mouseEvent.state.Z.rel != 0 && widgets.Count != 0)
            {
                float distance   = scroll.Height - drag.Height - initDragTop;
                var   moveOffset = distance / (float)rows.Count;

                float offset = mouseEvent.state.Z.rel / Mogre.Math.Abs((float)mouseEvent.state.Z.rel);
                if (offset < 0)
                {
                    if (drag.Top + drag.Height + initDragTop <= scroll.Height)
                    {
                        drag.Top += moveOffset;
                        setDisplayWidgets(ScrollOritentation.Down);
                    }
                }
                else
                {
                    if (drag.Top >= initDragTop)
                    {
                        drag.Top -= moveOffset;
                        setDisplayWidgets(ScrollOritentation.Up);
                    }
                }
                Scrolled?.Invoke();
            }
            foreach (var widget in visualWidgets)
            {
                widget.MouseMoved(mouseEvent);
            }
        }
Example #2
0
        /// <summary>
        /// Creates and initializes a new instance of the Panel class.
        /// </summary>
        /// <param name="parent">The EvasObject to which the new panel will be attached as a child.</param>
        /// <since_tizen> preview </since_tizen>
        public Panel(EvasObject parent) : base(parent)
        {
            _toggled  = new SmartEvent(this, this.RealHandle, "toggled");
            _scrolled = new SmartEvent(this, this.RealHandle, "scroll");

            _toggled.On  += (s, e) => Toggled?.Invoke(this, EventArgs.Empty);
            _scrolled.On += (s, e) => Scrolled?.Invoke(this, EventArgs.Empty);
        }
Example #3
0
 internal void OnScrolled(object sender, EventArgs args)
 {
     //Listener.CancelActiveGestures();  // this breaks UWP listview scrolling!!!
     //System.Diagnostics.Debug.WriteLine("!!! STOP !!!");
     IsScrolling = false;
     Scrolled?.Invoke(this, args);
     //System.Diagnostics.Debug.WriteLine("EnhancedListView.OnScrolled: offset=[" + ScrollOffset + "]");
 }
Example #4
0
 /// <summary>
 /// Constructor of ListView native control.
 /// </summary>
 /// <param name="parent">ElmSharp object which is parent of particular list view</param>
 public ListView(EvasObject parent)
     : base(parent)
 {
     _scrollerExtension = new ScrollerExtension(this);
     new SmartEvent(this, RealHandle, "scroll").On += (s, e) =>
     {
         Scrolled?.Invoke(this, null);
     };
 }
        protected override void OnScrollChanged(int l, int t, int oldl, int oldt)
        {
            base.OnScrollChanged(l, t, oldl, oldt);

            Scrolled?.Invoke(this, new ScrolledEventArgs
            {
                X    = l,
                Y    = t,
                OldX = oldl,
                OldY = oldt
            });
        }
Example #6
0
        public void SetScrolledPosition(double x, double y)
        {
            if (ScrollX == x && ScrollY == y)
            {
                return;
            }

            ScrollX = x;
            ScrollY = y;

            Scrolled?.Invoke(this, new ScrolledEventArgs(x, y));
        }
        /// <summary>
        /// Scrolls down when the user presses on the "scroll down" arrow.
        /// </summary>
        private void BtnScrollDown_LeftClick(object sender, EventArgs e)
        {
            int nonDisplayedLines = Length - DisplayedPixelCount;

            if (ViewTop < nonDisplayedLines)
            {
                ViewTop = Math.Min(ViewTop + ScrollStep, nonDisplayedLines);
            }

            RefreshButtonY();

            Scrolled?.Invoke(this, EventArgs.Empty);
        }
        /// <summary>
        /// Scrolls up when the user presses on the "scroll up" arrow.
        /// </summary>
        private void BtnScrollUp_LeftClick(object sender, EventArgs e)
        {
            if (ViewTop > 0)
            {
                ViewTop -= ScrollStep;
                if (ViewTop < 0)
                {
                    ViewTop = 0;
                }
            }

            RefreshButtonY();

            Scrolled?.Invoke(this, EventArgs.Empty);
        }
        private void Scroll()
        {
            var point = GetCursorPoint();

            if (point.Y < btnScrollUp.Height ||
                point.Y > btnScrollDown.Y)
            {
                return;
            }

            if (point.Y <= buttonMinY)
            {
                ViewTop = 0;
                RefreshButtonY();
                Scrolled?.Invoke(this, EventArgs.Empty);
                return;
            }

            if (point.Y >= buttonMaxY)
            {
                ViewTop = Length - DisplayedPixelCount;
                RefreshButtonY();
                Scrolled?.Invoke(this, EventArgs.Empty);
                ScrolledToBottom?.Invoke(this, EventArgs.Empty);
                return;
            }

            double difference = buttonMaxY - buttonMinY;

            double location = point.Y - buttonMinY;

            int nonDisplayedLines = Length - DisplayedPixelCount;

            ViewTop = (int)(location / difference * nonDisplayedLines);
            RefreshButtonY();

            Scrolled?.Invoke(this, EventArgs.Empty);
        }
Example #10
0
        protected override void OnPaint(PaintEventArgs e)  // .Net itself giving us graphic context in "e"
        {
            x++;
            base.OnPaint(e); // used to make previous setting as it is,

            SolidBrush brush = new SolidBrush(this.ForeColor);
            Font       font  = new Font(this.Font.FontFamily, 30);
            SizeF      sizef = e.Graphics.MeasureString(_label, font);

            Point point = new Point
                              (x,
                              (ClientSize.Height - (int)sizef.Height) / 2
                              );

            e.Graphics.DrawString(_label, font, brush, point);

            if (x == ClientSize.Width)
            {
                x          = 0;
                obj.count += 1;
                Scrolled.Invoke(this, obj);
            }
        }
Example #11
0
 protected virtual void OnScrolled(object sender, EventArgs e)
 {
     Scrolled?.Invoke(this, EventArgs.Empty);
 }
Example #12
0
 private void viewScrolled(object obj) =>
 Scrolled?.Invoke(this);
Example #13
0
 /// <summary>
 /// On scrollbar scroll update the scroll offsets and invalidate.
 /// </summary>
 private void OnScrollBarScroll(object sender, ScrollEventArgs e)
 {
     UpdateScrollOffsets();
     Scrolled?.Invoke(sender, e);
 }
 public void SendScrolled(double percent)
 {
     Scrolled?.Invoke(this, new ScrolledEventArgs {
         NewValue = percent
     });
 }
Example #15
0
 public void OnScrolled(Vector2 delta)
 {
     Scrolled?.Invoke(delta);
 }
 public void SendScrolled(ScrollDirection direction)
 {
     Scrolled?.Invoke(this, new ScrolledEventArgs {
         NewValue = Position, Direction = direction
     });
 }
Example #17
0
 public override void OnScrolled(RecyclerView recyclerView, int dx, int dy) =>
 Scrolled?.Invoke(recyclerView, dx, dy);
Example #18
0
        private void visibleRecordIndexChanged(object sender)
        {
            var layoutView = getView(sender);

            Scrolled?.Invoke(layoutView);
        }
Example #19
0
 public void SendScrolled(ScrolledEventArgs args)
 => Scrolled?.Invoke(this, args);
Example #20
0
 public void Scroll(WindowScrollInfo windowScrollEvent)
 {
     Scrolled?.Invoke(windowScrollEvent);
 }
Example #21
0
 /// <summary>
 /// Method to be called after a scroll completes.
 /// </summary>
 /// <param name="args">The scroll event arguments.</param>
 public void OnScrolled(ScrolledEventArgs args)
 {
     Scrolled?.Invoke(this, args);
 }
 /// <summary>
 /// Method to be called after a scroll completes.
 /// </summary>
 /// <param name="args">The scroll event arguments.</param>
 public void RaiseScrollEvent(ScrolledEventArgs args)
 {
     Scrolled?.Invoke(this, args);
 }
Example #23
0
 public void SendScrolled(double percent, ScrollDirection direction)
 {
     Scrolled?.Invoke(this, new ScrolledEventArgs {
         NewValue = percent, Direction = direction
     });
 }
 /// <summary>
 /// Updates the bounds.
 /// </summary>
 /// <param name="bounds">The bounds.</param>
 public void UpdateBounds(Rectangle bounds)
 {
     Position = bounds.Location;
     Scrolled?.Invoke(this, bounds);
 }
 internal void FireScroll(MouseEventArgs e)
 {
     OnMouseScroll(e);
     Scrolled?.Invoke(this, e);
 }
 public void OnScroll(PointerEventData eventData)
 {
     Scrolled?.Invoke(eventData.scrollDelta);
 }