forked from akrasuski1/akrOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob_number_dialog.ks
69 lines (59 loc) · 1.57 KB
/
job_number_dialog.ks
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
58
59
60
61
62
63
64
65
66
67
68
69
@lazyglobal off.
function run_number_dialog{
parameter window.
parameter title.
parameter number.
local process is list(
list(false, window, "update_number_dialog",false),
title,number,ag6,ag7,ag8,ag9,ag10," ",1).
draw_number_dialog(process).
return process.
}
function draw_number_dialog{
parameter process.
if not is_process_gui(process){
return 0.
}
local window is get_process_window(process).
print "6/7 - number -/+" at (window[0]+2, window[1]+5).
print "8/9 - increment -/+" at (window[0]+2, window[1]+6).
print "0 - enter" at (window[0]+2, window[1]+7).
}
function update_number_dialog{
parameter process.
local title is process[1].
local window is get_process_window(process).
local number is process[2].
local old_decrease is process[3].
local old_increase is process[4].
local old_div10 is process[5].
local old_mul10 is process[6].
local old_enter is process[7].
local spaces is process[8].
local increment is process[9].
if process_needs_redraw(process){
draw_number_dialog(process).
}
if old_enter<>ag10{
kill_process(process).
return number.
}
print title +" "+ number+spaces at(window[0]+2,window[1]+2).
print "Increment: "+increment+spaces at(window[0]+2,window[1]+3).
if old_decrease <> ag6{
set process[3] to ag6.
set process[2] to number - increment.
}
if old_increase <> ag7{
set process[4] to ag7.
set process[2] to number + increment.
}
if old_div10 <> ag8{
set process[5] to ag8.
set process[9] to increment / 10.
}
if old_mul10 <> ag9{
set process[6] to ag9.
set process[9] to increment * 10.
}
}