public DragEvent OnMiddleMouseDrag(MouseInputEvent evt) { if (!evt.IsMouseMiddleDown) { return(null); } Vector2 baseOffset = new Vector2(); ScrollbarOrientation orientation = 0; if (horizontalScrollingEnabled) { baseOffset.x = evt.MousePosition.x - horizontalHandle.layoutResult.screenPosition.x; orientation |= ScrollbarOrientation.Horizontal; } if (verticalScrollingEnabled) { baseOffset.y = evt.MousePosition.y - verticalHandle.layoutResult.screenPosition.y; orientation |= ScrollbarOrientation.Vertical; } return(new ScrollbarDragEvent(orientation, baseOffset, this)); }
/* * Constructor */ public ThumbnailViewer() { _thumbnails = new ArrayList(); _selectedIndex = -1; _scrollbarLoc = ScrollbarOrientation.Horizontal; _firstViewable = 0; _rows = _cols = 1; if (_scrollbarLoc == ScrollbarOrientation.Horizontal) { _scrollbar = new HScrollBar(); _scrollbar.Size = new Size(this.Width, SCROLLBAR_WIDTH); _scrollbar.Location = new Point(0, this.Height - SCROLLBAR_WIDTH); } else { _scrollbar = new VScrollBar(); _scrollbar.Size = new Size(SCROLLBAR_WIDTH, this.Height); _scrollbar.Location = new Point(this.Width - SCROLLBAR_WIDTH, 0); } this.Controls.Add(_scrollbar); _scrollbar.ValueChanged += new EventHandler(ScrollBar_ValueChanged); }
public ScrollbarDragEvent(ScrollbarOrientation orientation, Vector2 baseOffset, ScrollView scrollView) { this.orientation = orientation; this.baseOffset = baseOffset; this.scrollView = scrollView; }
public static extern int GetScrollPos(IntPtr hwnd, ScrollbarOrientation orientation);