Gintxx/GINTPP.py

77 lines
1.5 KiB
Python

from gint import *
import time as t
import casioplot as c
def dmenu(title,lit,ver):
x = 35
y = 33
col = C_BLACK
select = 0
stop = 0
while stop==0:
dclear(C_WHITE)
c.clear_screen()
dline(1,1,126,1,col)
dline(1,1,1,63,col)
dline(1,63,126,63,col)
dline(126,1,126,63,col)
xt = int(59-len(title)/2*6)
dtext(xt,10,col,title)
dline(xt,7,xt+len(title)*6,7,col)
dline(xt,19,xt+len(title)*6,19,col)
dtext(xt-5,10,col,"|")
dtext(xt+len(title)*6,10,col,"|")
if len(lit) > 5:
for i in range(1,len(lit)+1):
if i <= 5:
continue
lit.pop(i-1)
for i in range(0,len(lit)):
c.draw_string(x,y+6*i,lit[i])
if ver != None:
c.draw_string(100,19,ver)
c.draw_string(x-10,y+6*select,"->")
dupdate()
c.show_screen()
k = getkey().key
if k == KEY_UP and select != 0:
select -= 1
elif k == KEY_DOWN and select != len(lit)-1:
select += 1
elif k == KEY_EXE:
stop = 1
return select+1
def dlimage(x,y,lit,col1):
tx = len(lit[0])
ty = len(lit)
sel = 0
sel2 = 0
for h in range(1,ty+1):
for i in range(1,tx+1):
if lit[sel2][sel]=="#":
dpixel(i+x,h+y,col1)
sel += 1
sel2 += 1
sel = 0
def dbar(x,y,l,p):
drect_border(x,y,x+l,y+2,C_WHITE,1,C_BLACK)
f = int(p/100*l)
dline(x,y+1,x+f,y+1,C_BLACK)
def dlocate(x,y,t):
x=x+1
y=y+1
dtext(int(x*5.8),y*8,C_BLACK,t)
if x<1 or x>21:
x=1
if y<1 or y>7:
y=1