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.FitToChildren; AutoScroll = autoScroll; ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged); verticalScrollBar = new ScrollBar(this); base.AddChild(scrollArea); base.AddChild(verticalScrollBar); verticalScrollBar.HAnchor = UI.HAnchor.ParentRight; }