void AddScrollView1(SampleViewport viewport, int x, int y)
{
var panel = new LayoutFarm.CustomWidgets.SimpleBox(200, 175);
panel.SetLocation(x + 30, y + 30);
panel.BackColor = Color.LightGray;
viewport.AddContent(panel);
//-------------------------
{
//vertical scrollbar
var vscbar = new LayoutFarm.CustomWidgets.ScrollBar(15, 200);
vscbar.SetLocation(x + 10, y + 10);
vscbar.MinValue = 0;
vscbar.MaxValue = 170;
vscbar.SmallChange = 20;
viewport.AddContent(vscbar);
//add relation between viewpanel and scroll bar
var scRelation = new LayoutFarm.CustomWidgets.ScrollingRelation(vscbar, panel);
}
//-------------------------
{
//horizontal scrollbar
var hscbar = new LayoutFarm.CustomWidgets.ScrollBar(200, 15);
hscbar.ScrollBarType = CustomWidgets.ScrollBarType.Horizontal;
hscbar.SetLocation(x + 30, y + 10);
hscbar.MinValue = 0;
hscbar.MaxValue = 170;
hscbar.SmallChange = 20;
viewport.AddContent(hscbar);
//add relation between viewpanel and scroll bar
var scRelation = new LayoutFarm.CustomWidgets.ScrollingRelation(hscbar, panel);
}
//add content to panel
for (int i = 0; i < 10; ++i)
{
var box1 = new LayoutFarm.CustomWidgets.SimpleBox(400, 30);
box1.HasSpecificWidth = true;
box1.HasSpecificHeight = true;
box1.BackColor = Color.OrangeRed;
box1.SetLocation(i * 20, i * 40);
panel.AddChild(box1);
}
//--------------------------
panel.PerformContentLayout();
panel.SetViewport(0, 0);
}
void AddScrollView2(SampleViewport viewport, int x, int y)