public ScrollableWidget(double width, double height, bool autoScroll = false)
            : base(width, height)
        {
            scrollArea         = new ScrollingArea(this);
            scrollArea.HAnchor = UI.HAnchor.FitToChildren;
            AutoScroll         = autoScroll;
            verticalScrollBar  = new ScrollBar(this);

            base.AddChild(scrollArea);
            base.AddChild(verticalScrollBar);
            verticalScrollBar.HAnchor = UI.HAnchor.ParentRight;
        }
Example #2
0
        public ScrollableWidget(double width, double height, bool autoScroll = false)
            : base(width, height)
        {
            scrollArea                = new ScrollingArea(this);
            scrollArea.HAnchor        = UI.HAnchor.FitToChildren;
            AutoScroll                = autoScroll;
            ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged);
            verticalScrollBar         = new ScrollBar(this);

#if true
            base.AddChild(scrollArea);
            base.AddChild(verticalScrollBar);
            scrollArea.Padding        = new BorderDouble(0, 0, ScrollBar.ScrollBarWidth, 0);
            verticalScrollBar.HAnchor = UI.HAnchor.ParentRight;
#else
            FlowLayoutWidget scrollAreaAndScrollBarRisizer = new FlowLayoutWidget();
            scrollAreaAndScrollBarRisizer.HAnchor = UI.HAnchor.ParentLeftRight;
            scrollAreaAndScrollBarRisizer.VAnchor = UI.VAnchor.ParentBottomTop;

            scrollAreaAndScrollBarRisizer.AddChild(scrollArea);
            scrollAreaAndScrollBarRisizer.AddChild(verticalScrollBar);
            base.AddChild(scrollAreaAndScrollBarRisizer);
#endif
        }
Example #3
0
        public ScrollableWidget(double width, double height, bool autoScroll = false)
            : base(width, height)
        {
            scrollArea         = new ScrollingArea(this);
            scrollArea.HAnchor = UI.HAnchor.Fit;
            AutoScroll         = autoScroll;
            VerticalScrollBar  = new ScrollBar(this);

            VerticalScrollBar.VisibleChanged += (s, e) =>
            {
                SetScrollAreaMargin();
            };

            VerticalScrollBar.SizeChanged += (s, e) =>
            {
                SetScrollAreaMargin();
            };

            scrollArea.Margin = scrollArea.Margin.Clone(right: VerticalScrollBar.Width);

            base.AddChild(scrollArea);
            base.AddChild(VerticalScrollBar);
            VerticalScrollBar.HAnchor = UI.HAnchor.Right;
        }
Example #4
0
		public ScrollableWidget(double width, double height, bool autoScroll = false)
			: base(width, height)
		{
			scrollArea = new ScrollingArea(this);
			scrollArea.HAnchor = UI.HAnchor.FitToChildren;
			AutoScroll = autoScroll;
			ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged);
			verticalScrollBar = new ScrollBar(this);

#if true
			base.AddChild(scrollArea);
			base.AddChild(verticalScrollBar);
			scrollArea.Padding = new BorderDouble(0, 0, ScrollBar.ScrollBarWidth, 0);
			verticalScrollBar.HAnchor = UI.HAnchor.ParentRight;
#else
            FlowLayoutWidget scrollAreaAndScrollBarRisizer = new FlowLayoutWidget();
            scrollAreaAndScrollBarRisizer.HAnchor = UI.HAnchor.ParentLeftRight;
            scrollAreaAndScrollBarRisizer.VAnchor = UI.VAnchor.ParentBottomTop;

            scrollAreaAndScrollBarRisizer.AddChild(scrollArea);
            scrollAreaAndScrollBarRisizer.AddChild(verticalScrollBar);
            base.AddChild(scrollAreaAndScrollBarRisizer);
#endif
		}
Example #5
0
		public ScrollableWidget(double width, double height, bool autoScroll = false)
			: base(width, height)
		{
			scrollArea = new ScrollingArea(this);
			scrollArea.HAnchor = UI.HAnchor.FitToChildren;
			AutoScroll = autoScroll;
			ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged);
			verticalScrollBar = new ScrollBar(this);

			base.AddChild(scrollArea);
			base.AddChild(verticalScrollBar);
			verticalScrollBar.HAnchor = UI.HAnchor.ParentRight;
		}