Udo
Haudegen
 
Dabei seit: 18.02.2007
Beiträge: 700
 |
|
soo das ist mal ein neuer snipes der ist zum rum probieren
ist gut für grafische ober flächen (delphi ähnlich)
| Zitat: |
REM Project: Developement Zone
REM Created: 02.09.2008 14:58:03
REM
REM ***** Main Source File *****
REM
set window on
set window title "Developement Zone"
set window size 400,300
set display mode 400,300,32
sync on
sync rate 60
title1 as string
title2 as string
title3 as string
dim ed(10)
global position
global cursor
global cursorstr as string
global back
do
cls rgb(210,210,210)
Click(10,10,100,60,"Button",
title1=Edit(10,70,200,90,title1,8,15,1,0)
title2=Edit(10,100,200,120,title2,8,15,0,1)
sync
loop
end
function Click(x1,y1,x2,y2,title$,size)
ink rgb(190,190,190),rgb(220,220,220)
box x1,y1,x2,y2
if mousex()>x1 and mousey()>y1 and mousex()<x2 and mousey()<y2 and mouseclick()
ink rgb(130,130,130),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(160,160,160),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(100,100,100),rgb(220,220,220)
set text size size
center text int(x1+(x2-x1)/2-1),int(y1+(y2-y1)/2-size-1),title$
else
ink rgb(240,240,240),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(100,100,100),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(100,100,100),rgb(220,220,220)
set text size size
center text int(x1+(x2-x1)/2),int(y1+(y2-y1)/2-size),title$
endif
endfunction
function Edit(x1,y1,x2,y2,title$,size,max,style,nr)
ausg as string
ausgtext as string
text2 as string
ink rgb(190,190,190),rgb(220,220,220)
box x1,y1,x2,y2
if mousex()>x1 and mousey()>y1 and mousex()<x2 and mousey()<y2
if mouseclick()
cursorstr = ""
ed(nr)=1
position=len(title$)
clear entry buffer
endif
else
if mouseclick()
ed(nr)=0
cursorstr = ""
endif
endif
if ed(nr)=1
if cursor<timer()
cursor=timer()+400
if cursorstr = " "
cursorstr = "|"
else
cursorstr = " "
endif
endif
cursorstr2$=cursorstr
if keystate(14) or keystate(211)
clear entry buffer
if back+400<timer()
if keystate(14) and position>0
title$=left$(title$,position-1)+right$(title$,len(title$)-position)
dec position
endif
if keystate(211)
title$=left$(title$,position)+right$(title$,len(title$)-position-1)
endif
back=timer()
endif
else
back=0
endif
if len(title$+entry$())<=max and asc(left$(entry$(),1))>=32 and asc(left$(entry$(),1))<=255
title$=left$(title$,position)+ entry$()+right$(title$,len(title$)-position)
inc position,len(entry$())
endif
if leftkey()
if position>0
dec position
repeat
until leftkey()=0
endif
endif
if rightkey()
if position<len(title$)
inc position
repeat
until rightkey()=0
endif
endif
clear entry buffer
else
cursorstr2$=""
endif
ink rgb(100,100,100),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(240,240,240),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(100,100,100),rgb(220,220,220)
set text size size
text2=title$
if style=1
ausgtext=""
if len(text2)>5
repeat
ausgtext=ausgtext+left$(text2,5)+"-"
text2 =right$(text2,len(text2)-5)
until len(text2)<6
endif
ausgtext=ausgtext+text2
ausgtext=left$(ausgtext,int(position+position*0.2))+cursorstr2$+ right$(ausgtext,len(ausgtext)-len(left$(ausgtext,int(position+position*0.2))))
else
ausgtext=title$
ausgtext=left$(ausgtext,position) +cursorstr2$+ right$(ausgtext,len(ausgtext)-len(left$(ausgtext,position)))
endif
center text int(x1+(x2-x1)/2),int(y1+(y2-y1)/2-size),ausgtext
endfunction title$ |
|

|
|
02.09.2008 20:25 |
|
Udo
Haudegen
 
Dabei seit: 18.02.2007
Beiträge: 700
 |
|
so ich hab das ganze mal ein wenig Perfektioniert
mann kann jetzt alles per tapstop durschalten und die ein button klick ist erst einer wenn man den button wieder loslässt wärend man auf dem buton ist und enter geht auch
das ganze funtioniert auch bei den edit feldern aber die sind im open source manager noch nicth eingefügt
| Zitat: |
REM Project: Developement Zone
REM Created: 02.09.2008 14:58:03
REM
REM ***** Main Source File *****
REM
set window on
set window title "Developement Zone"
set window size 300,310
set display mode 300,310,32
sync on
sync rate 60
title1 as string
title2 as string
title3 as string
global ed
global click
global position
global cursor
global cursorstr as string
global back
do
cls rgb(210,210,210)
Click(20, 10,280, 50,"Update Einbinden" ,8,1)
Click(20, 60,280,100,"Developement Aktivation" ,8,2)
Click(20,110,280,150,"Update Erstellen" ,8,3)
Click(20,160,280,200,"Developemer-Account Aktivieren" ,8,4)
Click(20,210,280,250,"Developement-Codes Erstellen" ,8,5)
if Click(20,260,280,300,"Hilfe",8,6)
repeat
cls rgb(210,210,210)
ink rgb(80,80,80),rgb(220,220,220)
Center text 150,10,"Hilfe"
ink rgb(100,100,100),rgb(220,220,220)
text 20,40,"Um einen Developer-Account oder"
text 20,55,"einen Developement-Aktivation-"
text 20,70,"Code zu erhalten Kontaktieren"
text 20,85,"Sie mich bitte."
back=0
back=Click(20,260,145,300,"Back",8,1)
Click(155,260,280,300,"Kontakt",8,2)
Tapstop(2)
sync
until back=1
endif
Tapstop(6)
sync
loop
end
function Tapstop(max)
if keystate(15)
inc ed
if ed>max then ed=1
repeat
until keystate(15)=0
endif
endfunction
function Click(x1,y1,x2,y2,title$,size,nr)
ink rgb(190,190,190),rgb(220,220,220)
box x1,y1,x2,y2
if (mousex()>x1 and mousey()>y1 and mousex()<x2 and mousey()<y2 and mouseclick()) or (returnkey() and ed=nr)
ed=nr
cor=1
click=1
ink rgb(130,130,130),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(160,160,160),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(80,80,80),rgb(220,220,220)
set text size size
center text int(x1+(x2-x1)/2-1),int(y1+(y2-y1)/2-size-1),title$
else
ink rgb(240,240,240),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(100,100,100),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(80,80,80),rgb(220,220,220)
set text size size
center text int(x1+(x2-x1)/2),int(y1+(y2-y1)/2-size),title$
if click=1 and ed=nr
if mousex()>x1 and mousey()>y1 and mousex()<x2 and mousey()<y2
klick=1
endif
if returnkey() =0 and mouseclick()=0
klick=1
endif
click=0
endif
endif
if ed=nr
a1=4
ink rgb(0,0,0),rgb(220,220,220)
repeat
dot x1+a1-cor,y1+4-cor
dot x1+a1-cor,y2-4-cor
inc a1,3
until x1+a1>x2-4
a1=4
repeat
dot x1+4-cor,y1+a1-cor
dot x2-4-cor,y1+a1-cor
inc a1,3
until y1+a1>y2-4
endif
endfunction klick
function Edit(x1,y1,x2,y2,title$,size,max,style,nr)
ausg as string
ausgtext as string
text2 as string
ink rgb(190,190,190),rgb(220,220,220)
box x1,y1,x2,y2
if mousex()>x1 and mousey()>y1 and mousex()<x2 and mousey()<y2
if mouseclick()
cursorstr = ""
ed=nr
position=len(title$)
clear entry buffer
endif
else
if mouseclick()
if ed=nr then ed=0
cursorstr = ""
endif
endif
if ed=nr
if cursor<timer()
cursor=timer()+400
if cursorstr = " "
cursorstr = "|"
else
cursorstr = " "
endif
endif
cursorstr2$=cursorstr
if keystate(14) or keystate(211)
clear entry buffer
if back+400<timer()
if keystate(14) and position>0
title$=left$(title$,position-1)+right$(title$,len(title$)-position)
dec position
endif
if keystate(211)
title$=left$(title$,position)+right$(title$,len(title$)-position-1)
endif
back=timer()
endif
else
back=0
endif
if len(title$+entry$())<=max and asc(left$(entry$(),1))>=32 and asc(left$(entry$(),1))<=255
title$=left$(title$,position)+ entry$()+right$(title$,len(title$)-position)
inc position,len(entry$())
endif
if leftkey()
if position>0
dec position
repeat
until leftkey()=0
endif
endif
if rightkey()
if position<len(title$)
inc position
repeat
until rightkey()=0
endif
endif
clear entry buffer
else
cursorstr2$=""
endif
ink rgb(100,100,100),rgb(220,220,220)
line x1,y1,x1,y2
line x1,y1,x2,y1
ink rgb(240,240,240),rgb(220,220,220)
line x2,y1,x2,y2
line x1,y2,x2,y2
ink rgb(80,80,80),rgb(220,220,220)
set text size size
text2=title$
if style=1
ausgtext=""
if len(text2)>5
repeat
ausgtext=ausgtext+left$(text2,5)+"-"
text2 =right$(text2,len(text2)-5)
until len(text2)<6
endif
ausgtext=ausgtext+text2
ausgtext=left$(ausgtext,int(position+position*0.2))+cursorstr2$+ right$(ausgtext,len(ausgtext)-len(left$(ausgtext,int(position+position*0.2))))
else
ausgtext=title$
ausgtext=left$(ausgtext,position) +cursorstr2$+ right$(ausgtext,len(ausgtext)-len(left$(ausgtext,position)))
endif
center text int(x1+(x2-x1)/2),int(y1+(y2-y1)/2-size),ausgtext
endfunction title$ |
|
|
|
03.09.2008 21:41 |
|
|