public GridBox(int width, int height) : base(width, height) { //this grid box acts as viewport this.HasSpecificHeight = true; this.HasSpecificWidth = true; this.NeedClipArea = true; //scrollable content box is inside this grid box _scrollableViewPanel = new SimpleBox(this.Width, this.Height); this.AddChild(_scrollableViewPanel); { //vertical scrollbar var vscbar = new LayoutFarm.CustomWidgets.ScrollBar(15, this.Height); vscbar.SetLocation(this.Width - 15, 0); vscbar.MinValue = 0; vscbar.MaxValue = this.Height; vscbar.SmallChange = 20; this.AddChild(vscbar); //add relation between _scrollableViewPanel and scroll bar var scRelation = new LayoutFarm.CustomWidgets.ScrollingRelation(vscbar.SliderBox, _scrollableViewPanel); } //------------------------- { //horizontal scrollbar var hscbar = new LayoutFarm.CustomWidgets.ScrollBar(150, 15); hscbar.ScrollBarType = CustomWidgets.ScrollBarType.Horizontal; hscbar.SetLocation(30, 10); hscbar.MinValue = 0; hscbar.MaxValue = this.Width - 20; hscbar.SmallChange = 20; this.AddChild(hscbar); //add relation between _scrollableViewPanel and scroll bar var scRelation = new LayoutFarm.CustomWidgets.ScrollingRelation(hscbar.SliderBox, _scrollableViewPanel); } _scrollableViewPanel.PerformContentLayout(); }
public override void PerformContentLayout() { panel.PerformContentLayout(); }
protected override void OnContentLayout() { panel.PerformContentLayout(); }