public MarqueeListView() : base() { this.MarqueeSpeed = 20; this.scrollPositionOld = int.MinValue; this.scrollCommand = ScrollCommand.Down; this.timer = new Timer() { Interval = this.MarqueeSpeed }; this.timer.Tick += (sender, e) => { int scrollPosition = MarqueeListView.GetScrollPos((IntPtr)this.Handle, (int)ScrollBarDirection.Vertical); if (scrollPosition == this.scrollPositionOld) { if (this.scrollCommand == ScrollCommand.Down) { this.scrollCommand = ScrollCommand.Up; } else { this.scrollCommand = ScrollCommand.Down; } } this.scrollPositionOld = scrollPosition; MarqueeListView.SendMessage((IntPtr)this.Handle, MarqueeListView.WM_VSCROLL, (IntPtr)this.scrollCommand, IntPtr.Zero); MarqueeListView.SendMessage((IntPtr)this.Handle, MarqueeListView.WM_VSCROLL, (IntPtr)ScrollCommand.EndScroll, IntPtr.Zero); }; this.timer.Start(); }
/// <summary> /// モーションスクロールする位置を設定する /// </summary> /// <param name="pane">スクロールしたいペーン</param> /// <param name="pos">スクロール目的地</param> /// <param name="step">モーションステップ数 20位をセットするとちょうど良い</param> public void SetMotionScrollPosition(IRichPane pane, ScreenPos pos, int step) { lock (_motionScroll) { _motionScroll[pane] = new ScrollCommand(pos, step); } }
public void ScrollLeft() { this.timer = new Timer(); this.MarqueeSpeed = 700; this.scrollPositionOld = int.MinValue; this.scrollCommand = ScrollCommand.Down; // this.timer = new Timer() { Interval = this.MarqueeSpeed }; this.timer.Tick += (sender, e) => { int scrollPosition = ListViewFF.GetScrollPos((IntPtr)this.Handle, (int)ScrollBarDirection.Horizontal); if (scrollPosition == this.scrollPositionOld) { if (this.scrollCommand == ScrollCommand.Down) { this.scrollCommand = ScrollCommand.Up; } else { this.scrollCommand = ScrollCommand.Down; } } this.scrollPositionOld = scrollPosition; ListViewFF.SendMessage((IntPtr)this.Handle, ListViewFF.WM_VSCROLL, (IntPtr)this.scrollCommand, IntPtr.Zero); ListViewFF.SendMessage((IntPtr)this.Handle, ListViewFF.WM_VSCROLL, (IntPtr)ScrollCommand.EndScroll, IntPtr.Zero); }; this.timer.Start(); }
public override void OnScroll(object sender, ScrollEventArgs e) { RequestExpandItems(e.FirstVisibleItem + e.VisibleItemCount); e.IsFirstRow = e.FirstVisibleItem <= 0; e.IsLastRow = e.TotalItemCount * _desiredColumnCount >= StackList?.Count; ScrollListener?.OnScroll(sender, e); ScrollCommand?.Execute(scrollEventArgs); }
/// <summary> /// Scroll the body part down by some number /// </summary> /// <param Name="bc">Should be typeof(ScrollCommand) </param> private void ScrollCommand(BaseCommand bc) { ScrollCommand scroll = bc as ScrollCommand; Scrool += scroll.n; Change?.Invoke(null, EventArgs.Empty); }
private bool CommonScroll(string controlId, int horizontalAmount, int verticalAmount) { var command = new ScrollCommand { AutomationIdentifier = CreateAutomationIdentifier(controlId), HorizontalScroll = horizontalAmount, VerticalScroll = verticalAmount }; var result = SyncExecuteCommand(command); return(result is SuccessResult); }
/// <summary> /// Scroll the body part down by some number /// </summary> /// <param Name="bc">Should be typeof(ScrollCommand) </param> private void ScrollCommand(BaseCommand Bc) { ScrollCommand Scroll = Bc as ScrollCommand; Scrool += Scroll.N; if (VirtualConsoleTop > 0) { Scrool %= VirtualConsoleTop; } if (Scrool < 0) { Scrool = VirtualConsoleTop; } ScreenChange(); }
private void AssociatedObject_MouseWheel(object sender, MouseWheelEventArgs e) { ScrollCommand?.Execute(e.Delta < 0); }