Post by honky on Feb 11, 2024 10:49:28 GMT
Good morning, EMDR final result.
To test: You have to put the code in a folder and add two files: "col.txt", and: "ini.txt"
Example of "col.txt":
0 237 0
244 11 0
Example of "Ini.txt":
50
1
200
700
5
I do not understand why the textboxes and the buttons are superimpted and offbeat
This software is a post-traumatic symptom treatment device.
To test: You have to put the code in a folder and add two files: "col.txt", and: "ini.txt"
Example of "col.txt":
0 237 0
244 11 0
Example of "Ini.txt":
50
1
200
700
5
I do not understand why the textboxes and the buttons are superimpted and offbeat
This software is a post-traumatic symptom treatment device.
[reop]
NOMAINWIN
mapw=1000: maph= 600: size=20
WindowWidth=mapw+15: WindowHeight=maph+40
UpperLeftX = 10: UpperLeftY = 10
textbox #t.size, 10, 10, 40, 20
BUTTON #t.siz, "<-Ok", [oksize], UL, 55, 10, 30, 20
textbox #t.time, 100, 10, 40, 20 '175
BUTTON #t.tim, "<-Ok", [oktime], UL, 145, 10, 30, 20 '225
textbox #t.deb, 190, 10, 40, 20 '265
BUTTON #t.de, "<-Ok", [okdeb], UL, 235, 10, 30, 20 '315
textbox #t.fin, 280, 10, 40, 20 '355
BUTTON #t.fi, "<-Ok", [okfin], UL, 325, 10, 30, 20 '405
textbox #t.step, 375, 10, 40, 20 '355
BUTTON #t.ste, "<-Ok", [okstep], UL, 420, 10, 30, 20 '405
BUTTON #t.go, "Go", [go], UL, 480, 10, 35, 20
BUTTON #t.sto, "Stop", [stop], UL, 540, 10, 35, 20
MENU #t, "Colors", "Backgrd", [colback],"Foregrd",[colfore]
MENU #t, "Template", "Save", [savini]
BUTTON #t.go, "Go", [go], UL, 480, 10, 35, 20
BUTTON #t.sto, "Stop", [stop], UL, 540, 10, 35, 20
GRAPHICBOX #t.g, 5, 5, mapw, maph
OPEN "EMDR" FOR window_nf AS #t
#t, "TRAPCLOSE [quit]"
#t.g, "down"
gosub [opini]
#t.size, str$(scale): #t.time, str$(temp): #t.deb, str$(deb)
#t.fin, str$(fin): #t.step,str$(ste)
gosub [opcol]
gosub [tra]
#t.g, "fill ";colfond$
#t.g, "getbmp bkd ";"5";" ";"5";" ";mapw;" ";maph
bmpsave "bkd","bkd.bmp"
loadbmp "bkd","bkd.bmp"
#t.g, "background bkd"
loadbmp "sprit","sprit.bmp"
#t.g, "addsprite sprit sprit"
#t.g, "spritexy sprit 100 100"
'---------------------------TEXTE------------
#t.g, "color white;backcolor black"
#t.g, "place 5 40": #t.g, "\Size": #t.g, "place 95 40": #t.g, "\Time ms"
#t.g, "place 185 40": #t.g, "\Start x": #t.g, "place 275 40": #t.g, "\End x"
#t.g, "place 370 40": #t.g, "\Step x"
#t.g, "flush"
wait
[go]
[reo]
t=0
[aller]
while t=0
scan
yy=200
xx=xx+ste
if xx > fin then exit while
#t.g, "spritexy sprit ";xx;" ";yy
'so xx 0 -> 100 %, fin -> 100%, fin/2 is 200%
' scale = (1-abs(xx-fin/2)/(fin/2))*100+100
#t.g, "spritescale sprit ";int(scale)
#t.g, "drawsprites"
#t.g, "discard"
gosub [pause]
wend
goto [retour]
[retour]
while t=0
scan
yy=200
xx=xx-ste
if xx < deb then exit while
' scale = 100-(1-abs(xx-fin/2)/(fin/2))*100+100 '*50
#t.g, "spritescale sprit ";int(scale)
#t.g, "spritexy sprit ";xx;" ";yy
#t.g, "drawsprites"
#t.g, "discard"
gosub [pause]
wend
goto [aller]
wait
[oksize]
#t.size, "!contents? scale$": scale=val(scale$)
if scale > 100 then scale=100: if scale < 2 then scale=2
#t.size, str$(scale)
goto [reo]
[oktime] #t.time, "!contents? temp$": temp=val(temp$): goto [reo]
[okdeb]
#t.deb, "!contents? deb$": deb=val(deb$)
if deb <size*2 then deb=size*2: #t.deb, str$(deb)
goto [reo]
[okfin] #t.fin, "!contents? fin$": fin=val(fin$): goto [reo]
[okstep]
#t.step, "!contents? ste$": ste=val(ste$)
if ste <1 then ste=1: #t.step, str$(ste)
goto [reo]
[stop] t=1: timer 0: wait
[colback]
colfo=1: goto [color]
wait
[colfore]
colfo=2: goto [color]
wait
[tra] '----------------------TRAITE---------------------
size=50
WindowWidth=mapw+15: WindowHeight=maph+40
UpperLeftX = 10: UpperLeftY = 10
GRAPHICBOX #s.g, 5, 5, mapw, maph
OPEN "traite" FOR window_nf AS #s
#s, "TRAPCLOSE [quit]"
#s.g, "down"
gosub [opcol]
#s.g "backcolor black"
#s.g "place ";size;" ";size: #s.g, "circlefilled ";size
#s.g "place ";0;" ";2*size: #s.g "boxfilled ";2*size;" ";4*size
#s.g "color red"
#s.g "backcolor ";colfore$: #s.g "place ";size;" ";3*size: #s.g, "circlefilled ";size
#s.g, "getbmp sprit ";0;" ";0;" ";(size*2);" ";(size*4)
bmpsave "sprit","sprit.bmp"
loadbmp "sprit","sprit.bmp"
#s.g, "addsprite sprit sprit"
#s.g, "fill ";colfond$
#s.g, "getbmp bkd ";"5";" ";"5";" ";mapw;" ";maph
bmpsave "bkd","bkd.bmp"
loadbmp "bkd","bkd.bmp"
#s.g, "background bkd"
#s.g, "spritexy sprit 10 10"
#s.g, "drawsprites"
close #s
return
[savini]
gosub [savi]
notice,"Les données sont sauvées"
wait
[savi]
open "ini.txt" for output as #h
' print #h, colfond$
' print #h, colfore$
print #h, scale$
print #h, temp$
print #h, deb$
print #h, fin$
print #h, ste$
close #h
return
[opini]
open "ini.txt" for input as #k
while eof(#k)=0
' line input #k, colfond$
' line input #k, colfore$
line input #k, scale$: scale=val(scale$)
line input #k, temp$: temp=val(temp$)
line input #k, deb$: deb=val(deb$)
line input #k, fin$: fin=val(fin$)
line input #k, ste$: ste=val(ste$)
wend
close #k
return
[pause]
timer temp, [temps]
wait
[temps]
timer 0
return
'----------------------------------COLOR--------------------------
[color]
WindowWidth =500: WindowHeight =180
UpperLeftX = 10: UpperLeftY = 20
GRAPHICBOX #w.r, 20, 20, 255, 20
GRAPHICBOX #w.g, 20, 50, 255, 20
GRAPHICBOX #w.b, 20, 80, 255, 20
GRAPHICBOX #w.m 280, 20, 200, 80
statictext #w.st, " ", 20, 120, 120, 25
statictext #w.p, "Color", 20, 120, 120, 25
BUTTON #w.s, "Save color", [validcol], UL, 330, 110, 120, 25
OPEN "......................Clic in the Bars" FOR window_nf AS #w
#w, "TRAPCLOSE [closebars]"
#w.s, "!font courier 12 bold": #w.s, "!font courier 14 bold"
#w.p, "!font courier 14 bold"
#w.m, "down;fill black": #w.r, "down;fill red"
#w.g, "down;fill green": #w.b, "down;fill blue"
#w.r, "when leftButtonDown [red]": #w.g, "when leftButtonDown [green]"
#w.b, "when leftButtonDown [blue]"
#w.m, "flush": #w.g, "flush": #w.r, "flush": #w.b, "flush"
col$=""
wait
[red]
r=MouseX: #w.r, "fill red"
#w.r, "color black;size 5": #w.r, "set ";r;" ";"8"
col$=str$(r)+" "+str$(g)+" "+str$(b): gosub [disp]
wait
[green]
g=MouseX: #w.g, "fill green"
#w.g, "color black;size 5": #w.g, "set ";g;" ";"8"
col$=str$(r)+" "+str$(g)+" "+str$(b): gosub [disp]
wait
[blue]
b=MouseX: #w.b, "fill blue"
#w.b, "color black;size 5": #w.b, "set ";b;" ";"8"
col$=str$(r)+" "+str$(g)+" "+str$(b): gosub [disp]
wait
[disp]
#w.m, "fill ";" ";col$: #w.m, "flush"
#w.p, col$
wait
[validcol] '----------------------SAVE COULEUR en palette--------------------
if col$="" then wait
if colfo=1 then colfond$=col$
if colfo=2 then colfore$=col$
gosub [savcol]: opbar=0: close #w: close #t: goto [reop]
wait
[savcol]
open "col.txt" for output as #m
print #m, colfond$
print #m, colfore$
close #m
return
[opcol]
open "col.txt" for input as #o
while eof(#o)=0
line input #o, colfond$
line input #o, colfore$
wend
close #o
return
[closebars]
opbar=0: close #w
[quit]
unloadbmp "sprit": unloadbmp "bkd"
kill "sprit.bmp": kill "bkd.bmp"
if opbar=1 then opbar=0: close #w
CLOSE #t
END