-
Notifications
You must be signed in to change notification settings - Fork 1
/
VerticalScrollbar.cs
46 lines (38 loc) · 1.19 KB
/
VerticalScrollbar.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using sapfewse;
namespace RoboSAPiens
{
public class VerticalScrollbar
{
string userAreaId;
public VerticalScrollbar(GuiUserArea guiUserArea)
{
userAreaId = guiUserArea.Id;
}
public bool scroll(GuiSession session, string toPosition)
{
var userArea = (GuiUserArea)session.FindById(userAreaId);
var verticalScrollbar = userArea.VerticalScrollbar;
if (toPosition == "BEGIN")
{
verticalScrollbar.Position = verticalScrollbar.Minimum;
return true;
}
if (toPosition == "END")
{
verticalScrollbar.Position = verticalScrollbar.Maximum;
return true;
}
if (toPosition == "DOWN" && verticalScrollbar.Position < verticalScrollbar.Maximum)
{
verticalScrollbar.Position++;
return true;
}
if (toPosition == "UP" && verticalScrollbar.Position > verticalScrollbar.Minimum)
{
verticalScrollbar.Position--;
return true;
}
return false;
}
}
}