CPUWAIT = libvmconf.getconf("cpu", "cpuwait") # stepbystep = int(libvmconf.getconf("cpu", "stepbystep")) # vmexeclogflg = int(libvmconf.getconf("log", "vmexec")) # logromexit = int(libvmconf.getconf("log", "romexit")) # logIOexit = int(libvmconf.getconf("log", "ioexit")) # tromlogging = int(libvmconf.getconf("log", "tromlogging")) disablereadouts = int(libvmconf.getconf("video", "disablereadouts")) # fskip = int(libvmconf.getconf("video", "fskip")) # ttystyle = int(libvmconf.getconf("video", "ttystyle")) # #DEFAULTSTREG=libvmconf.getconf("bootup", "DEFAULTSTREG") mixrate = int(libvmconf.getconf("audio", "mixrate")) # fm0 = vmui.menuitem("Help (F1)", "HELP") fm1 = vmui.menuitem("Save", "SAVE") fm2 = vmui.menuitem("Reset", "RESET") fm3 = vmui.menuitem("Quit", "QUIT") filemenu = [fm0, fm1, fm2, fm3] #CPU SPEED PRESETS #handled as strings here for sake of simplicity. CPUSLOW = "0.001" CPUNORM = "0.0005" CPUFAST = "0.00001" CPUSUPER = "0.000005" cpu0 = vmui.menuitem("Slow", "0.001") cpu1 = vmui.menuitem("Normal", "0.0005") cpu2 = vmui.menuitem("Fast", "0.00001")
#runx=filebg.blit(fvrun, (136, 5)) #viewx=filebg.blit(fvview, (177, 5)) #filebg=(libthemeconf.bgmake(filehud)).convert() filebg = (libthemeconf.bgmake(None)).convert() panemode = 1 listy2 = 0 fillabel = simplefontC.render(("Type Filter: " + filtertext), True, (0, 0, 0)) #set scupdate to one at start, so it will draw the screen on startup #(screen updating is done only when what is shown would actually change) scupdate = 1 #filemenu fmnew = vmui.menuitem("New Window", "NEW") fmhelp = vmui.menuitem("Help (F1)", "HELP") fmabout = vmui.menuitem("About Fileview", "ABOUT") fmbg = vmui.menuitem("Background", "SETBG") fmquit = vmui.menuitem("Quit", "QUIT") filemenu = [fmnew, fmhelp, fmabout, fmbg, fmquit] #create gxmask only once. just reuse it. menuitrun = vmui.menuitem("Run", "RUN") menuitasm = vmui.menuitem("Assemble", "RUN") menuitview = vmui.menuitem("View", "VIEW") menuitinfo = vmui.menuitem("Info", "INFO") menuittrom = vmui.menuitem("Trom file", "TROM", noclick=1, icon=fvtrom) menuitstreg = vmui.menuitem("Streg file", "TROM", noclick=1, icon=fvstreg) menuitimage = vmui.menuitem("Image file", "TROM", noclick=1, icon=fvimg)
democat.extend([moreromst]) gamest = launchtile("Games", genericcaticon, 6, lref="Games", lref2=gamescat) ltoolt = launchtile("Desk Apps", genericcaticon, 6, lref="Desk Applications", lref2=ltoolcat) #note: these should be unique class instances, (create duplicates if needed) deskcat = [DESKFILE, DESKHELP, maincatt, demot, gamest, ltoolt, myvmt] #category definitions tilelist = deskcat catid = 0 catname = "Main" #categoru menu cmitem0 = vmui.menuitem("Main", "MAIN") cmitem1 = vmui.menuitem("Games", "GAMES") cmitem2 = vmui.menuitem("Welcome", "WELCOME") cmitem3 = vmui.menuitem("Demos", "DEMOS") cmitem4 = vmui.menuitem("Mini Tools", "LTOOL") cmitem5 = vmui.menuitem("Plugins", "PLUG") catmenu = [cmitem0, cmitem1, cmitem2, cmitem3, cmitem4, cmitem5] #widitem0=vmui.menuitem("main", #file menu fmhelp = vmui.menuitem("Help", "HELP") fmabout = vmui.menuitem("About Desktop", "ABOUT") fmabout2 = vmui.menuitem("readme", "ABOUT2") fmtask = vmui.menuitem("Task Manager", "TASKMAN") fmcon = vmui.menuitem("Console", "CON")
catfont = pygame.font.SysFont(None, 19) iterate1 = os.path.join("VMSYSTEM", "CFG") iterate2 = os.path.join("VMUSER", "CFG") thememenu = list() curtheme = libthemeconf.getconf("theme", "themefile") curthemename = (libthemeconf.getthemeinfo(curtheme))[0] curbg = int(libthemeconf.getconf("desk", "bgtheme")) curbgname = vmui.getbgname(curbg) for fname in os.listdir(iterate1): fnamelo = fname.lower() if fnamelo.endswith((".thm")): thname = (libthemeconf.getthemeinfo(fname))[0] thitm = vmui.menuitem(thname, fname) thememenu.extend([thitm]) for fname in os.listdir(iterate2): fnamelo = fname.lower() if fnamelo.endswith((".thm")): thname = (libthemeconf.getthemeinfo(fname))[0] thitm = vmui.menuitem(thname, fname) thememenu.extend([thitm]) themenot = """NOTICE: You may need to restart SBTCVM utilities for changes to take effect!""" fm0 = vmui.menuitem("Help (F1)", "HELP") fm1 = vmui.menuitem("Save", "SAVE") fm2 = vmui.menuitem("Reset", "RESET")
screenw = 800 screenh = 600 xpos = (screenw // 2) ypos = (screenh // 2) diagtext = '''This is a test. of vmui.yndiag() a function to create Yes/No dialogs.''' diagout = vmui.yndiag(diagtext, xpos, ypos) print "yes/no dialog has returned:" print diagout diagout = vmui.yndiag("test", xpos, ypos) print "yes/no dialog 2 has returned:" print diagout if cmd == "menu": vmui.toolsscreen(1) mi1 = vmui.menuitem("Testing", "ITEM1", icon=windowicon) mi2 = vmui.menuitem("Testing2", "ITEM2") mi3 = vmui.menuitem("Testing3 (this item is not clickable)", "ITEM3", noclick=1) mi0a = vmui.menuitem( "This menu will ignore clicks outside menu. (reclick=2)", "ITEM4", noclick=1) mi0b = vmui.menuitem( "This menu will just return None for clicks outside menu (reclick=0)", "ITEM4", noclick=1) menulist = [mi0a, mi1, mi2, mi3] menulist2 = [mi0b, mi1, mi2, mi3] menuret = vmui.menuset(menulist, 4, 210, reclick=2)
#iterate through glossary.xml and add special word elements that match. for line in xroot.findall("*"): if line.tag == "word": if any(item in line.text.lower() for item in list(searchstring.lower().split(" "))): droot.append(line) #update window caption. pygame.display.set_caption(("SBTCVM Help - Search: " + searchstring), ("SBTCVM Help - Search: " + searchstring)) return droot pygame.key.set_repeat(250, 50) fmhelp = vmui.menuitem("Help (F1)", "HELP") fmindex = vmui.menuitem("Index", "INDEX") fmquit = vmui.menuitem("Quit", "QUIT") fmabout = vmui.menuitem("About Helpview", "ABOUT") fmabout2 = vmui.menuitem("About SBTCVM", "ABOUT2") filemenu = [fmhelp, fmindex, fmabout, fmabout2, fmquit] engtimer = pygame.time.Clock() while qflg == 0: #handles resize operations when videoresize events are detected. if resizeflg == 1: resizeflg = 2 elif resizeflg == 2: screensurf = pygame.display.set_mode((resw, resh), pygame.RESIZABLE) scupdate = 1 resizeflg = 0
typ_png=filetyp("png", fvimg, "img", 2) typ_jpg=filetyp("jpg", fvimg, "img", 2) typ_jpeg=filetyp("jpeg", fvimg, "img", 2) typ_gif=filetyp("gif", fvimg, "img", 2) typ_streg=filetyp("streg", fvstreg, "streg", 3) typ_trom=filetyp("trom", fvtrom, "trom", 1) typ_tasm=filetyp("tasm", fvtasm, "tasm", 4) typ_txt=filetyp("txt", fvtext, "text", 5) typ_md=filetyp("md", fvtext, "text", 5) typ_log=filetyp("log", fvlog, "log", 6) typ_dmp=filetyp("dmp", fvdmp, "dmp", 7) #also needed by system shell! typelist=[typ_png, typ_jpg, typ_jpeg, typ_gif, typ_streg, typ_trom, typ_tasm, typ_txt, typ_md, typ_log, typ_dmp] iconlist=[fvall, fvtrom, fvimg, fvstreg, fvtasm, fvtext, fvlog, fvdmp] fil0=vmui.menuitem("All", 0) fil1=vmui.menuitem("Trom", 1) fil2=vmui.menuitem("Image", 2) fil3=vmui.menuitem("Streg", 3) fil4=vmui.menuitem("Tasm", 4) fil5=vmui.menuitem("Text", 5) fil6=vmui.menuitem("Log", 6) fil7=vmui.menuitem("Dmp", 7) filtermenu=[fil0, fil1, fil2, fil3, fil4, fil5, fil6, fil7] typ_up=filetyp(None, fvup, "dir", None) typ_dir=filetyp(None, fvdir, "dir", None) class fileclick: def __init__(self, box, filename, ftype, pane=1): self.box=box