internal ScrollBar(ScrollableWidget parent, GuiWidget background, GuiWidget thumbView, Orientation orientation = Orientation.Vertical) { ParentScrollWidget = parent; this.background = background; thumb = new ThumDragWidget(orientation); thumb.AddChild(thumbView); AddChild(background); AddChild(thumb); this.Margin = ScrollBar.DefaultMargin; ParentScrollWidget.BoundsChanged += Bounds_Changed; ParentScrollWidget.ScrollArea.BoundsChanged += Bounds_Changed; ParentScrollWidget.ScrollPositionChanged += Bounds_Changed; ParentScrollWidget.ScrollArea.MarginChanged += Bounds_Changed; UpdateScrollBar(); }
internal ScrollBar(ScrollableWidget parent, GuiWidget background, GuiWidget thumbView, Orientation orientation = Orientation.Vertical) { ParentScrollWidget = parent; this.background = background; thumb = new ThumDragWidget(orientation); thumb.AddChild(thumbView); background.BackgroundColor = RGBA_Bytes.LightGray; AddChild(background); AddChild(thumb); BackgroundColor = RGBA_Bytes.Blue; ParentScrollWidget.BoundsChanged += new EventHandler(Parent_BoundsChanged); ParentScrollWidget.ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged); ParentScrollWidget.ScrollPositionChanged += new EventHandler(scrollWidgeContainingThis_ScrollPositionChanged); ParentScrollWidget.ScrollArea.MarginChanged += new EventHandler(ScrollArea_MarginChanged); UpdateScrollBar(); }