# http://www.ex-parrot.com/~tom/calcs/calcs/encyc/progs/src/menu.ctf # ======================================================================== # Program name: Icon Menu # # Version: 1.0 # Author: Tom Lynn # Date: 1995-7 # Models: 9700 # # # Description: # # Draws an icon-based front-end for loading programs. It takes an awful # lot of memory for what it does, but it's quite fun. It's designed for # you to add your own icons, but this might be tricky if you haven't had # practise at programming the calcs before. # # # # Global subroutines: # # Uses +BOX, +TEXT55 (and their subroutines) and +ALPHASET from my global # subroutine library, tlglobal.ctf. +TEXT55 is too big to justify typing # it in just for this program IMO, so you can either miss out the lines # between the comments and lose the title bar or you can only type in the # code for the letters in "PROGRAM MENU" from +TEXT55 and it should work. @@ Program "~MENU" # Main routine Defm 2 'No. of programs = 6->Z[2] ; Increase this if you add your own icons. Range 1,127,0,1,63,0 5->T 63->U Plot 121,55 Prog "+BOX" Prog "+ALPHASET" # # Miss out these lines if you don't want to bother typing # in +TEXT55. You will lose the words "PROGRAM MENU" along the # top of the screen though. # # { # 1->Z[1] Lbl 0 Z[1]->\th \th=1=>P->\r \th=2=>R->\r \th=3=>O->\r \th=4=>G->\r \th=5=>R->\r \th=6=>A->\r Abs (\th-8=1=>M->\r \th=8=>0->\r \th=10=>E->\r \th=11=>N->\r \th=12=>U->\r 20+6Z[1]->A 57->B Prog "+TEXT55" 1->A 2->B Isz Z[1] Z[1]<=12=>Goto 0 # # } # 1->A 4->B Lbl 1 15A-10->T 15B-9->U Plot 15A+1,15B-20 Prog "+BOX" A+32-8B->E Prog "MEICONDRAW" Isz A A=9=>Dsz B A=9=>1->A E>23=>Goto 2 EGoto 1 Lbl 2 Prog "MECHOOSEPROG" @@ Program "MECHOOSEPROG" # Runs whichever program was chosen Lbl 0 Plot 20,50_ Y>52=>Goto 0 Int ((X-3)/15)+8Int ((52-Y)/15)+1->A A>Z[2]=>Goto 0 A<>1=>Goto 2 Prog "~CHESS" Goto Z Lbl 2 A<>2=>Goto 3 Prog "~ANT" Goto Z Lbl 3 A<>3=>Goto 4 Prog "~HANGMAN" Goto Z Lbl 4 A<>4=>Goto 5 Prog "~BOUNC41" Goto Z Lbl 5 A<>5=>Goto 6 Prog "~COLONY" Goto Z Lbl 6 A<>6=>Goto Z Prog "~YAHTZEE" Goto Z # # Add similar code to call your own icons here. # If you increase Z[2] in line 3 of "~MENU" and add the # correct code here it will draw in blank icons which # will load your programs. You can then add code to # "MEICONDRAW" to draw a sensible icon in these blank # boxes (this is trickier). # Lbl Z @@ Program "MEICONDRAW" # Draws the icons 15A-9->C 15B-10->D '(C,D) is at top-left E=1=>Goto 1 E=2=>Goto 2 E=3=>Goto 3 E=4=>Goto 4 E=5=>Goto 5 E=6=>Goto 6 E=24=>Goto Y ; <-- Don't bother typing this line Goto Z ; unless you plan to use 24 icons Lbl 1 'Chess Plot C+3,D Plot C,D-3 Line Plot C+7,D Plot C,D-7 Line Plot C+2,D-9 Plot C+9,D-2 Line Plot C+6,D-9 Plot C+9,D-6 Line Plot C,D-2 Plot C+7,D-9 Line Plot C,D-6 Plot C+3,D-9 Line Plot C+2,D Plot C+9,D-7 Line Plot C+6,D Plot C+9,D-3 Line Goto Z Lbl 2 'Ant Plot C+7,D Plot C+9,D Line Plot C+7,D-1 Plot C+9,Y Line Plot C+7,D-2 Plot C+9,Y Line Plot C+4,D-6 Plot C+5,Y Plot C+3,D-7 Plot C+5,Y Line Plot C+3,D-8 Plot C+4,Y Goto Z Lbl 3 'Hangman Plot C+1,D-8 Plot C+4,Y Line Plot C+2,Y Plot X,D-1 Line Plot C+8,Y Line Plot C+6,D-3 Line Plot C+8,D-5 Line Plot C+6,D-7 Line Plot C+8,Y Plot C+7,D-5 Plot C+6,Y Plot C+8,D-3 Plot C+3,Y Plot C+4,D-2 Goto Z Lbl 4 'Bouncer Plot C,D-2 Plot C+3,D-3 Line Plot C+6,D-6 Line Plot C+8,D-10 Line Plot X,D-7 Plot C+9,D-6 Line Goto Z Lbl 5 'Colony Plot C+5,D Plot C+9,D-1 Plot C+6,Y Line Plot C+3,Y-3 Line Plot C,Y Line Plot C+3,Y Plot C+6,Y-3 Line Plot C+9,Y Line Plot C+5,Y-1 Plot C+4,Y-1 Goto Z Lbl 6 1->F~L 7->H 4->J~K 7->M~O 0->P Lbl P Plot C+F[P],D-G[P] Plot X+1,Y Plot X,Y-1 Plot X-1,Y 2+P->P P<=8=>Goto P # # I have designed an icon to lead onto the next screen in # case you use more than 24 icons, although I've never used more # than 6 myself. Don't bother typing this in unless you think # you might use that many icons. # # { # Goto Z Lbl Y 'More... Plot C+8,D-8 Plot C+7,Y Plot C+9,D-6 Line Plot X,D-9 Line Plot C,Y Line Plot C,D Line Plot C+9,D Line Plot X,D-4 Line Plot C+7,D-2 Line Plot C+8,Y Plot X,D-1 Plot C+1,Y Line Plot C+3,D-2 Plot C+6,D-5 Line Plot C+3,D-8 Line Plot C+4,Y Plot C+7,D-5 Line Plot C+4,D-2 Line Plot C+1,D-3 Plot X,D-7 Line Plot C+3,D-5 Line Plot C+2,D-4 Plot X,D-5 # # } # Lbl Z Plot 0,0 # ======================================================================== # CTF compliant. See http://www.york.ac.uk/~tw104/casio/ for details. # # More programs and information at: # http://www.ex-parrot.com/~tom/calcs/calcs/encyc/ # # This file last compiled: Friday, 30 April, 1999 # ========================================================================