예제 #1
0
        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));
        }
예제 #2
0
        /*
         * 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);
        }
예제 #3
0
 public ScrollbarDragEvent(ScrollbarOrientation orientation, Vector2 baseOffset, ScrollView scrollView)
 {
     this.orientation = orientation;
     this.baseOffset  = baseOffset;
     this.scrollView  = scrollView;
 }
예제 #4
0
 public static extern int GetScrollPos(IntPtr hwnd, ScrollbarOrientation orientation);