-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,scrollbar_vertical].cs2
57 lines (57 loc) · 2.47 KB
/
[proc,scrollbar_vertical].cs2
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
47
48
49
50
51
52
53
54
55
56
57
// 31
[proc,scrollbar_vertical](component $component0, component $component1, graphic $graphic2, graphic $graphic3, graphic $graphic4, graphic $graphic5, graphic $graphic6, graphic $graphic7)
cc_create($component0, ^iftype_graphic, 0);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_centre);
cc_setsize(0, 32, ^setsize_minus, ^setsize_minus);
cc_setgraphic($graphic2);
cc_settiling(false);
cc_setonclick("scrollbar_vertical_jump($component0, $component1, event_mousey)");
cc_setonscrollwheel("scrollbar_vertical_wheel($component0, $component1, event_mousey)");
cc_setnoclickthrough(true);
.cc_create($component0, ^iftype_graphic, 1);
.cc_setposition(0, 16, ^setpos_abs_centre, ^setpos_abs_top);
def_int $height8 = if_getscrollheight($component1);
if ($height8 <= 0) {
$height8 = if_getheight($component1);
}
def_int $height9 = 0;
if ($height8 > 0) {
$height9 = calc((if_getheight($component0) - 32) * if_getheight($component1) / $height8);
} else {
$height9 = calc(if_getheight($component0) - 32);
}
if ($height9 < 10) {
$height9 = 10;
}
.cc_setsize(0, $height9, ^setsize_minus, ^setsize_abs);
.cc_setgraphic($graphic4);
.cc_settiling(false);
.cc_setdraggable($component0, 0);
.cc_setondrag("scrollbar_vertical_drag($component0, $component1, event_mousey, false)");
.cc_setondragcomplete("scrollbar_vertical_drag($component0, $component1, event_mousey, true)");
.cc_setdraggablebehavior(1);
cc_create($component0, ^iftype_graphic, 2);
cc_setposition(0, .cc_gety, ^setpos_abs_centre, ^setpos_abs_top);
cc_setsize(0, 5, ^setsize_minus, ^setsize_abs);
cc_setgraphic($graphic3);
cc_settiling(false);
cc_create($component0, ^iftype_graphic, 3);
cc_setposition(0, calc(.cc_gety + .cc_getheight - 5), ^setpos_abs_centre, ^setpos_abs_top);
cc_setsize(0, 5, ^setsize_minus, ^setsize_abs);
cc_setgraphic($graphic5);
cc_settiling(false);
cc_create($component0, ^iftype_graphic, 4);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_top);
cc_setsize(0, 16, ^setsize_minus, ^setsize_abs);
cc_setgraphic($graphic6);
cc_settiling(false);
cc_setonhold("scrollbar_vertical_up($component0, $component1)");
cc_setnoclickthrough(true);
cc_create($component0, ^iftype_graphic, 5);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_bottom);
cc_setsize(0, 16, ^setsize_minus, ^setsize_abs);
cc_setgraphic($graphic7);
cc_settiling(false);
cc_setonhold("scrollbar_vertical_down($component0, $component1)");
cc_setnoclickthrough(true);
if_setonscrollwheel("scrollbar_vertical_wheel($component0, $component1, event_mousey)", $component1);