Beispiel #1
0
        public void SetupOverflowAndScroll(OverflowType overflow, Margin margin, ScrollType scroll,
                                           int scrollSpeed, ScrollBarDisplayType scrollBarDisplay)
        {
            _margin = margin;
            if (overflow == OverflowType.Hidden)
            {
                container.clipRect = new Rect(0, 0, _width * GRoot.contentScaleFactor, _height * GRoot.contentScaleFactor);
                if (_scrollPane != null)
                {
                    _scrollPane.Dispose();
                    _scrollPane = null;
                }
                container.x = margin.left * GRoot.contentScaleFactor;
                container.y = margin.top * GRoot.contentScaleFactor;
            }
            else if (overflow == OverflowType.Scroll)
            {
                container.clipRect = null;
                if (_scrollPane == null)
                {
                    _scrollPane = new ScrollPane(this, scroll, margin, scrollSpeed, scrollBarDisplay);
                }
            }
            else
            {
                container.clipRect = null;
                if (_scrollPane != null)
                {
                    _scrollPane.Dispose();
                    _scrollPane = null;
                }
                container.x = margin.left * GRoot.contentScaleFactor;
                container.y = margin.top * GRoot.contentScaleFactor;
            }

            SetBoundsChangedFlag();
        }
Beispiel #2
0
 public void SetScrollPane(ScrollPane target, bool vertical)
 {
     _target   = target;
     _vertical = vertical;
 }