dialog fkeys {
title $lang(fkeys_dialog)
icon $icon(quick)
size -1 -1 230 170
option dbu
check $lang(fkeys_enable), 1, 4 12 222 10
text $lang(fkey_f1), 2, 4 30 30 8
text $lang(fkey_f2), 3, 4 40 30 8
text $lang(fkey_f3), 4, 4 50 30 8
text $lang(fkey_f4), 5, 4 60 30 8
text $lang(fkey_f5), 6, 4 70 30 8
text $lang(fkey_f6), 7, 4 80 30 8
text $lang(fkey_f7), 8, 4 90 30 8
text $lang(fkey_f8), 9, 4 100 30 8
text $lang(fkey_f9), 10, 4 110 30 8
text $lang(fkey_f10), 11, 4 120 30 8
text $lang(fkey_f11), 12, 4 130 30 8
text $lang(fkey_f12), 13, 4 140 30 8
button $lang(ok), 14, 60 153 50 12, ok
button $lang(close), 15, 120 153 50 12, cancel
radio "f1list", 16, 40 30 8 10, group
radio "f2list", 17, 40 40 8 10, group
radio "f3list", 18, 40 50 8 10, group
radio "f4list", 19, 40 60 8 10, group
radio "f5list", 20, 40 70 8 10, group
radio "f6list", 21, 40 80 8 10, group
radio "f7list", 22, 40 90 8 10, group
radio "f8list", 23, 40 100 8 10, group
radio "f9list", 24, 40 110 8 10, group
radio "f10list", 25, 40 120 8 10, group
radio "f11list", 26, 40 130 8 10, group
radio "f12list", 27, 40 140 8 10, group
radio "f1com", 28, 110 30 8 10, group
radio "f2com", 29, 110 40 8 10, group
radio "f3com", 30, 110 50 8 10, group
radio "f4com", 31, 110 60 8 10, group
radio "f5com", 32, 110 70 8 10, group
radio "f6com", 33, 110 80 8 10, group
radio "f7com", 34, 110 90 8 10, group
radio "f8com", 35, 110 100 8 10, group
radio "f9com", 36, 110 110 8 10, group
radio "f10com", 37, 110 120 8 10, group
radio "f11com", 38, 110 130 8 10, group
radio "f12com", 39, 110 140 8 10, group
combo 40, 50 28 50 10, drop
combo 41, 50 38 50 10, drop
combo 42, 50 48 50 10, drop
combo 43, 50 58 50 10, drop
combo 44, 50 68 50 10, drop
combo 45, 50 78 50 10, drop
combo 46, 50 88 50 10, drop
combo 47, 50 98 50 10, drop
combo 48, 50 108 50 10, drop
combo 49, 50 118 50 10, drop
combo 50, 50 128 50 10, drop
combo 51, 50 138 50 10, drop
edit $f_comval(f1), 52, 120 28 106 10, autohs
edit $f_comval(f2), 53, 120 38 106 10, autohs
edit $f_comval(f3), 54, 120 48 106 10, autohs
edit $f_comval(f4), 55, 120 58 106 10, autohs
edit $f_comval(f5), 56, 120 68 106 10, autohs
edit $f_comval(f6), 57, 120 78 106 10, autohs
edit $f_comval(f7), 58, 120 88 106 10, autohs
edit $f_comval(f8), 59, 120 98 106 10, autohs
edit $f_comval(f9), 60, 120 108 106 10, autohs
edit $f_comval(f10), 61, 120 118 106 10, autohs
edit $f_comval(f11), 62, 120 128 106 10, autohs
edit $f_comval(f12), 63, 120 138 106 10, autohs
}
on *:dialog:fkeys:init:0:{
if ($settings(fkeys_state) == 0) {
did -b $dname 2,3,4,5,6,7,8,9,10,11,12,13,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
}
elseif ($settings(fkeys_state) == 1) { did -c $dname 1 }
init_fkeys_dialog $dname
var %x = $ini(data\config\fkeys.dat,labels,0)
var %y = 1
did -r $dname 40,41,42,43,44,45,46,47,48,49,50,51
while (%y <= %x) {
did -a $dname 40,41,42,43,44,45,46,47,48,49,50,51 $readini(data\config\fkeys.dat,labels,%y)
inc %y
}
if ($fmethod(f2) == 0) { did -c $dname 41 $fvalue(f2) }
if ($fmethod(f3) == 0) { did -c $dname 42 $fvalue(f3) }
if ($fmethod(f4) == 0) { did -c $dname 43 $fvalue(f4) }
if ($fmethod(f5) == 0) { did -c $dname 44 $fvalue(f5) }
if ($fmethod(f6) == 0) { did -c $dname 45 $fvalue(f6) }
if ($fmethod(f7) == 0) { did -c $dname 46 $fvalue(f7) }
if ($fmethod(f8) == 0) { did -c $dname 47 $fvalue(f8) }
if ($fmethod(f9) == 0) { did -c $dname 48 $fvalue(f9) }
if ($fmethod(f10) == 0) { did -c $dname 49 $fvalue(f10) }
if ($fmethod(f11) == 0) { did -c $dname 50 $fvalue(f11) }
if ($fmethod(f12) == 0) { did -c $dname 51 $fvalue(f12) }
apply_style fkeys
}
on *:dialog:fkeys:sclick:*:{
if ($did == 1) {
if ($did(1).state == 1) {
did -e $dname 2,3,4,5,6,7,8,9,10,11,12,13,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
init_fkeys_dialog $dname
}
else {
did -b $dname 2,3,4,5,6,7,8,9,10,11,12,13,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
}
}
if ($did == 14) {
if ($did(1).state != $settings(fkeys_state)) { set_setting fkeys_state $did(1).state }
if ($did(1).state == 1) {
set_fmethod f1 1
if ($did(17).state == 1) && ($did(29).state == 0) {
set_fmethod f2 0
set_fvalue f2 $did(41).sel
}
else {
set_fmethod f2 1
set_fvalue f2 $did(53).text
}
if ($did(18).state == 1) && ($did(30).state == 0) {
set_fmethod f3 0
set_fvalue f3 $did(42).sel
}
else {
set_fmethod f3 1
set_fvalue f3 $did(54).text
}
if ($did(19).state == 1) && ($did(31).state == 0) {
set_fmethod f4 0
set_fvalue f4 $did(43).sel
}
else {
set_fmethod f4 1
set_fvalue f4 $did(55).text
}
if ($did(20).state == 1) && ($did(32).state == 0) {
set_fmethod f5 0
set_fvalue f5 $did(44).sel
}
else {
set_fmethod f5 1
set_fvalue f5 $did(56).text
}
if ($did(21).state == 1) && ($did(33).state == 0) {
set_fmethod f6 0
set_fvalue f6 $did(45).sel
}
else {
set_fmethod f6 1
set_fvalue f6 $did(57).text
}
if ($did(22).state == 1) && ($did(34).state == 0) {
set_fmethod f7 0
set_fvalue f7 $did(46).sel
}
else {
set_fmethod f7 1
set_fvalue f7 $did(58).text
}
if ($did(23).state == 1) && ($did(35).state == 0) {
set_fmethod f8 0
set_fvalue f8 $did(47).sel
}
else {
set_fmethod f8 1
set_fvalue f8 $did(59).text
}
if ($did(24).state == 1) && ($did(36).state == 0) {
set_fmethod f9 0
set_fvalue f9 $did(48).sel
}
else {
set_fmethod f9 1
set_fvalue f9 $did(60).text
}
if ($did(25).state == 1) && ($did(37).state == 0) {
set_fmethod f10 0
set_fvalue f10 $did(49).sel
}
else {
set_fmethod f10 1
set_fvalue f10 $did(61).text
}
if ($did(26).state == 1) && ($did(38).state == 0) {
set_fmethod f11 0
set_fvalue f11 $did(50).sel
}
else {
set_fmethod f11 1
set_fvalue f11 $did(62).text
}
if ($did(27).state == 1) && ($did(39).state == 0) {
set_fmethod f12 0
set_fvalue f12 $did(51).sel
}
else {
set_fmethod f12 1
set_fvalue f12 $did(63).text
}
}
}
if ($did == 16) {
if ($did(40).enabled == $false) { did -e $dname 40 }
if ($did(28).state == 1) { did -u $dname 28 }
if ($did(52).enabled == $true) { did -b $dname 52 }
}
if ($did == 17) {
if ($did(41).enabled == $false) { did -e $dname 41 }
if ($did(29).state == 1) { did -u $dname 29 }
if ($did(53).enabled == $true) { did -b $dname 53 }
}
if ($did == 18) {
if ($did(42).enabled == $false) { did -e $dname 42 }
if ($did(30).state == 1) { did -u $dname 30 }
if ($did(54).enabled == $true) { did -b $dname 54 }
}
if ($did == 19) {
if ($did(43).enabled == $false) { did -e $dname 43 }
if ($did(31).state == 1) { did -u $dname 31 }
if ($did(55).enabled == $true) { did -b $dname 55 }
}
if ($did == 20) {
if ($did(44).enabled == $false) { did -e $dname 44 }
if ($did(32).state == 1) { did -u $dname 32 }
if ($did(56).enabled == $true) { did -b $dname 56 }
}
if ($did == 21) {
if ($did(45).enabled == $false) { did -e $dname 45 }
if ($did(33).state == 1) { did -u $dname 33 }
if ($did(57).enabled == $true) { did -b $dname 57 }
}
if ($did == 22) {
if ($did(46).enabled == $false) { did -e $dname 46 }
if ($did(34).state == 1) { did -u $dname 34 }
if ($did(58).enabled == $true) { did -b $dname 58 }
}
if ($did == 23) {
if ($did(47).enabled == $false) { did -e $dname 47 }
if ($did(35).state == 1) { did -u $dname 35 }
if ($did(59).enabled == $true) { did -b $dname 59 }
}
if ($did == 24) {
if ($did(48).enabled == $false) { did -e $dname 48 }
if ($did(36).state == 1) { did -u $dname 36 }
if ($did(60).enabled == $true) { did -b $dname 60 }
}
if ($did == 25) {
if ($did(49).enabled == $false) { did -e $dname 49 }
if ($did(37).state == 1) { did -u $dname 37 }
if ($did(61).enabled == $true) { did -b $dname 61 }
}
if ($did == 26) {
if ($did(50).enabled == $false) { did -e $dname 50 }
if ($did(38).state == 1) { did -u $dname 38 }
if ($did(62).enabled == $true) { did -b $dname 62 }
}
if ($did == 27) {
if ($did(51).enabled == $false) { did -e $dname 51 }
if ($did(39).state == 1) { did -u $dname 39 }
if ($did(63).enabled == $true) { did -b $dname 63 }
}
if ($did == 28) {
if ($did(40).enabled == $true) { did -b $dname 40 }
if ($did(16).state == 1) { did -u $dname 16 }
if ($did(52).enabled == $false) { did -e $dname 52 }
}
if ($did == 29) {
if ($did(41).enabled == $true) { did -b $dname 41 }
if ($did(17).state == 1) { did -u $dname 17 }
if ($did(53).enabled == $false) { did -e $dname 53 }
}
if ($did == 30) {
if ($did(42).enabled == $true) { did -b $dname 42 }
if ($did(18).state == 1) { did -u $dname 18 }
if ($did(54).enabled == $false) { did -e $dname 54 }
}
if ($did == 31) {
if ($did(43).enabled == $true) { did -b $dname 43 }
if ($did(19).state == 1) { did -u $dname 19 }
if ($did(55).enabled == $false) { did -e $dname 55 }
}
if ($did == 32) {
if ($did(44).enabled == $true) { did -b $dname 44 }
if ($did(20).state == 1) { did -u $dname 20 }
if ($did(56).enabled == $false) { did -e $dname 56 }
}
if ($did == 33) {
if ($did(45).enabled == $true) { did -b $dname 45 }
if ($did(21).state == 1) { did -u $dname 21 }
if ($did(57).enabled == $false) { did -e $dname 57 }
}
if ($did == 34) {
if ($did(46).enabled == $true) { did -b $dname 46 }
if ($did(22).state == 1) { did -u $dname 22 }
if ($did(58).enabled == $false) { did -e $dname 58 }
}
if ($did == 35) {
if ($did(47).enabled == $true) { did -b $dname 47 }
if ($did(23).state == 1) { did -u $dname 23 }
if ($did(59).enabled == $false) { did -e $dname 59 }
}
if ($did == 36) {
if ($did(48).enabled == $true) { did -b $dname 48 }
if ($did(24).state == 1) { did -u $dname 24 }
if ($did(60).enabled == $false) { did -e $dname 60 }
}
if ($did == 37) {
if ($did(49).enabled == $true) { did -b $dname 49 }
if ($did(25).state == 1) { did -u $dname 25 }
if ($did(61).enabled == $false) { did -e $dname 61 }
}
if ($did == 38) {
if ($did(50).enabled == $true) { did -b $dname 50 }
if ($did(26).state == 1) { did -u $dname 26 }
if ($did(62).enabled == $false) { did -e $dname 62 }
}
if ($did == 39) {
if ($did(51).enabled == $true) { did -b $dname 51 }
if ($did(27).state == 1) { did -u $dname 27 }
if ($did(63).enabled == $false) { did -e $dname 63 }
}
}
alias fmethod {
if ($1) {
return $readini(data\config\fkeys.dat,method,$1)
}
}
alias fvalue {
if ($1) {
if ($1 == f1) { return help }
else { return $readini(data\config\fkeys.dat,values,$1) }
}
}
alias fcommand {
if ($settings(fkeys_state) == 1) {
if ($1) {
if ($fmethod($1) == 0) {
var %x = $fvalue($1)
return $readini(data\config\fkeys.dat,commands,%x)
}
else { return $fvalue($1) }
}
}
}
alias f1 { help }
alias f2 { $fcommand(f2) }
alias f3 { $fcommand(f3) }
alias f4 { $fcommand(f4) }
alias f5 { $fcommand(f5) }
alias f6 { $fcommand(f6) }
alias f7 { $fcommand(f7) }
alias f8 { $fcommand(f8) }
alias f9 { $fcommand(f9) }
alias f10 { $fcommand(f10) }
alias f11 { $fcommand(f11) }
alias f12 { $fcommand(f12) }
alias init_fkeys_dialog {
if ($1) {
if ($fmethod(f1) == 0) {
did -c $1 16
did -b $1 52
}
else {
did -c $1 28
did -b $1 40
}
if ($fmethod(f2) == 0) {
did -c $1 17
did -b $1 53
}
else {
did -c $1 29
did -b $1 41
}
if ($fmethod(f3) == 0) {
did -c $1 18
did -b $1 54
}
else {
did -c $1 30
did -b $1 42
}
if ($fmethod(f4) == 0) {
did -c $1 19
did -b $1 55
}
else {
did -c $1 31
did -b $1 43
}
if ($fmethod(f5) == 0) {
did -c $1 20
did -b $1 56
}
else {
did -c $1 32
did -b $1 44
}
if ($fmethod(f6) == 0) {
did -c $1 21
did -b $1 57
}
else {
did -c $1 33
did -b $1 45
}
if ($fmethod(f7) == 0) {
did -c $1 22
did -b $1 58
}
else {
did -c $1 34
did -b $1 46
}
if ($fmethod(f8) == 0) {
did -c $1 23
did -b $1 59
}
else {
did -c $1 35
did -b $1 47
}
if ($fmethod(f9) == 0) {
did -c $1 24
did -b $1 60
}
else {
did -c $1 36
did -b $1 48
}
if ($fmethod(f10) == 0) {
did -c $1 25
did -b $1 61
}
else {
did -c $1 37
did -b $1 49
}
if ($fmethod(f11) == 0) {
did -c $1 26
did -b $1 62
}
else {
did -c $1 38
did -b $1 50
}
if ($fmethod(f12) == 0) {
did -c $1 27
did -b $1 63
}
else {
did -c $1 39
did -b $1 51
}
}
}
alias set_fmethod {
if ($0 == 2) {
writeini data\config\fkeys.dat method $1 $2
}
}
alias set_fvalue {
if ($0 >= 2) {
writeini data\config\fkeys.dat values $1 $2-
}
}
alias f_comval {
if ($1) {
if ($fmethod($1) == 1) { return $fvalue($1) }
}
}