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; }
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 }
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; }
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; }