ä?ZQŠ ************* ZBasic 4.0 Graphics Editor **************?ZQŠ * Written by: Scott Terry *?ZQŠ * *?ZQŠ * In order to use this program, the mouse hardware *?ZQŠ * and software must be installed. Also, ZBasic *?ZQŠ * must be configured to support the mouse. Use the *?ZQŠ * onfigure option when powering up ZBasic. *?ZQŠ * NOTE: Additional keyboard commands: *? ZQŠ * "Q" - Quit *? ZQŠ * "S" - Save *? ZQŠ * "L" - Load (not yet done) *? ZQŠ * "N" - New *? ZQŠ * Also, clicking the RIGHT mouse button will toggle *?ZQŠ * the menu on and off. *?ZQŠ * (This program is not yet complete.) *?ZQŠ *******************************************************ZQ: ZQ€- 17G`Q€ †(0)=0 Š €1 "Cannot find mouse driver ... program halted.":€#yQColor=1:Background=0:Palette=0@‹Q€ S(18),X(18),Y(18),Z(15,50),T(15), 7 S$(15), 63 Text$(15).(‹Q€ I=0 Š 14 : € X(I),Y(I),ˆ(S(I)) : €b2ÀQ"NEW" € "DRAW MENU" : †(4) : Menu_on=-1 : C=0 : Entry=1 : LEntry=0 : Z(0,Entry)=0 : NText=0düQ"NEXT" CO=CnR€ "WAIT MOUSE"xR€ € „ MENU ›R †(5)” R € C € "N","Y","ERASE","LINE","STRAIGHT LINE","FILL","BOX","RECTANGLE","BOX FILL","F","B","P","TEXT","ARC","PIE","CIRCLE","OVAL","OVAL FILL" ªCR€ €"¯CR€ C<4 Š C>9 Š C<13 Š C=CO´…R€ "NEXT"¾ˆR"N" †(4) : €ÈR"F"ÍRColor=(Color+1) Š 16,Ò R€ = Color : €* € 5,74 Š 110,138:€=3ÜÀR€1@(4,3)"F";æÐR†(4) : €ú×R"B" †(4):ÝRBackground=(Background+1) Š 16 : € ,Background : €,õR"P" †(4),6ûRPalette=PaletteXOR1 : €=,,Palette : € ôS"ERASE"þS€ : € "NEW"çS:èS"LINE" Type=1`S€=Color : € X0,Y0j%S†(4) : €8 †(3)AND1t.S X=†(1):Y=†(2)~@S € € X<>X1 Š Y<>Y1'ˆiS †(5):€ 0 : € X0,Y0 Š X1,Y1’‰S X1=X : Y1=Y-—•S €=Color : € X0,Y0 Š X1,Y1 : †(4) œµS € €¦µS€9°ÂS€ "SAVE ENTRY"ºÅS:ÜÅS"STRAIGHT LINE" Type=1æËS€=Color : € X0,Y0ðÛS†(4) : €8 †(3)AND1úäS X=†(1) : Y=†(2)öS € € X<>X2 Š Y<>Y2T X2=X : Y2=Y)+T € 0 : †(5) : € X0,Y0 Š X1,Y1:"KT € †(X-X0)>†(Y-Y0) Š X1=X:Y1=Y0 :€ X1=X0:Y1=Y-,‹T €=Color : € X0,Y0 Š X1,Y1 : †(4) 6«T € €@«T€9¤¸T€ "SAVE ENTRY"®»T:лT"RECTANGLE" Type=2äÁT"R2" €=Color : € X0,Y0îÑT†(4) : €8 †(3)AND1øÚT X=†(1) : Y=†(2)ìT € € X<>X1 Š Y<>Y1) U †(5) : € 0 : €* X0,Y0 Š X1,Y15U X1=X : Y1=Y- AU €=Color : €* X0,Y0 Š X1,Y1 : †(4) *aU € €4aU€9˜nU€ "SAVE ENTRY"¢qU:üqU"BOX FILL" Type=3  wU€ "R2") zU†(5) : €* € X0,Y0 Š X1,Y1 : †(4)` šU€j ›U:Ä ›U"BOX" Type=2Î ¡UX2=X0:Y2=Y0Ø ­U€=Color : € X0,Y0â ½U†(4) : €8 †(3)AND1ì ÆU X=†(1):Y=†(2)ö ØU € € X<>X2 Š Y<>Y2(û V X2=X : Y2=Y : XD=X-X0 : YD=Y-Y0) !V †(5) : € 0 : €* X0,Y0 Š X1,Y1, AV X1=X : Y1=Y : XA=†(XD) : YA=†(YD)8 eV € XA>YA Š Y1=Y0+†(YD)*XA :€ X1=X0+†(XD)*YA-  V €=Color : €* X0,Y0 Š X1,Y1 : †(4) ( ÀV € €2 ÀV€9Œ ÍV€ "SAVE ENTRY"– ÐV:¸ ÐV"CIRCLE" Type=4½ ÖVX2=X1:Y2=Y1:R=0:€# 0,0 òV†(4) : €8 †(3)AND1Ì ûV X=†(1):Y=†(2)Ñ W € € X<>X1 Š Y<>Y10Ö 6W X1=X : Y1=Y : XD=(X-X0)/2 : YD=(Y-Y0)/24à fW RT=† (XD*XD+YD*YD+0.) : XT=X0+XD : YT=Y0+YD"ê ¼W € 0 : †(5) : €$ X2,Y2,R'ô ×W €=Color : €$ XT,YT,RT : †(4)þ òW X2=XT : Y2=YT : R=RT  X € € X€9€ XAX=0:AY=0:€ "SAVE CIRCLE"Š X:¬ X"OVAL" Type=5¶ &X"OV2" X2=X1:Y2=Y1:R=0À 8X†(4) : €8 †(3)AND1Ê AX X=†(1):Y=†(2)Ô SX € € X<>X1 Š Y<>Y10Þ |X X1=X : Y1=Y : XD=(X-X0)/2 : YD=(Y-Y0)/2*è ¬X XT=X0+XD : YT=Y0+YD : AX=0 : AY=0Žò ÌX € XD=YD Š RT=1.4*†(XD) :€ € †(XD)>†(YD) Š RT=1.4*†(XD):AY=-†(128-†(128*YD\XD)) :€ RT=1.4*†(YD):AX=-†(128-†(128*XD\YD))"ü ÎY € 0 : †(5) : €$ X2,Y2,R2éY €=Color : €# AX,AY : €$ XT,YT,RT : †(4)Z X2=XT : Y2=YT : R=RT  Z € €. Z€9t-Z€ "SAVE CIRCLE"~0Z:Ø0Z"OVAL FILL" Type=6 â6Z€ "OV2"ì9Z€ 0 : †(5) : €$ X2,Y2,R%öTZ€=Color : €$ € X2,Y2,R : †(4)<oZ€FpZ:;–pZ"PIE" Type=7 : Routine = ‚ "PIE ROUTINE" : € "DO IT"›‚Z:. ‚Z"ARC" Type=8 : Routine = ‚ "ARC ROUTINE"ª‘Z"DO IT" X2=X0:Y2=Y0:R=0´£Z†(4) : €8 †(3)AND1¾¬Z X=†(1):Y=†(2)ȾZ € € X<>X1 Š Y<>Y1@ÒçZ X1=X : Y1=Y : XS=X-X0 : YS=Y-Y0 : XD=†(XS) : YD=†(YS)Ü[ € € XD>YD<æ+[ XT=X0 : YT=Y1 : RT=XD : AX=0 : AY=(128*YD\XD)-128 ðq[ €<út[ XT=X1 : YT=Y0 : RT=YD : AX=(128*XD\YD)-128 : AY=0º[ € €5º[ SBT=32-†(XS)*†(YS)*32 : € SBT=32 Š SBT=0ê[ € € YS>=0Bõ[ € YD>=XD Š SBT=SBT+128 :€ € YD=0 Š XS<0 Š SBT=128 9\ €" <\ € XD>YD Š SBT=SBT+128 N\ € €&N\ € 0 : †(5) : €, †(Routine)&"_\ X2=XT : Y2=YT : R=RT : SB=SBT5'w\ €=Color : €# AX,AY : €, †(Routine) : †(4) ,’\ € €@’\€9LEntry Š LEntry=LEntry+1° _Entry=Entry+1â_€ì_:(#_"FILL" Type=9&–#_€=Color : € †(1),†(2) : †(4)ð#3_€ "SAVE ENTRY"ú#6_:T$6_"TEXT" Type=10h$<_€ %(X0,Y0);"";Text$(NText)%r$]_†(4) : € Text$(NText)="" Š €/¸$…_X1=NText : NText=NText+1 : € "SAVE ENTRY"'’_:%'’_Š *****************************%$'’_Š * DRAW SELECTION MENU *%.'’_Š *****************************8'’_"DRAW MENU" B'’_€ 3.L'˜_€ I=0 Š 2 : € 0,I*70 Š 1015,I*70 : €1V'Ì_€ I=0 Š 1024 Š 113 : € I,0 Š I,140 : €.`'õ_€ 335,0 Š 335,140 : € 332,0 Š 332,140j'`€ I=0 Š 8%t'#` € Š I*113+X(I),Y(I),ˆ(S(I))~'Y`€ˆ'e`€ I=9 Š 14,’'k` € Š (I-6)*113+X(I),Y(I)+70,ˆ(S(I))œ'§`€¦'³`€ 957,30 : € 957,100%°'Ç`€=Color : €* € 5,75 Š 110,137º'á`€1@(4,3)"F";Ä'ñ`€1@(12,3)"B";Î'a€1@(20,3)"P";Ø'a€ NaŠ -*NaŠ *************************************-4NaŠ * GET MOUSE DOWN IN MENU *-9NaŠ * ON EXIT: MENU = TRUE IF IN MENU *->NaŠ *************************************HNa"WAIT MOUSE" : € X RNaMENU=0TNa€3 : €4 ˆ =""WN2a"WAITING" €3 : €4 †(3)=08\N=140 Š € C=0 Š "WAITING" :€ €1uNÀa€ „ Menu_on THENIF C=0 Š "WAITING" :€ €5vNßaC=X0/113+Y0/70*9+1 : € C<4 Š C>9 Š C<13 Š €wN@b€8 †(3)AND1zNCb C=X0/113+Y0/70*9+1CNgb € CO<>C Š € "HIDE SELECTION" : CO=C : € "SHOW SELECTION"5„Nb X=†(1):Y=†(2):€ Y<140 Š X>339 Š X0=X:Y0=YŽNÆb€9˜NÓbMENU=-1 : €èNÚb: ðNÚb"KEY"òNÚbI=„(1,"SLNQ",Inkey$)(üNób€ I € "SAVE","LOAD","NEW2","QUIT"Oc€ "WAITING"Oc: °Oc"QUIT"*ºOc†(5) : € LEntry=0 Š € : €- 2 : €R¼O#c€ "SAVE?":€ : € File$="" Š € :€ €1"Graphic Saved in File: ";File$:€1:€:ÄO[c"SAVE?" †(5):€' 0,6:€ ‚:€1"Save graphics ? ";3ÉOtc€3 : File$=ˆ : €4 †(File$) : File$=ˆ(File$)GÎOœc€ File$="N" Š File$="":€ :€ € File$<>"Y" Š ÿÉO :€ € "SAVE"Pãc: Pãc"SAVE"(Pãc†(5) : €' 0,6 : € ‚/2Pöc€ "Enter filename to be saved as: ";File$3 Š C<10 Š C>12 Š € "SHOW SELECTION"0R¼d€5R¿d € LEntry=0 Š ÿgR:RÍd I=0 : I2=0 : €3DRÙd I=I+1NRÝd € NOTI2 Š I2=Z(0,I)XRýd € I2 Š € "DRAW I"bR e €4 I=LEntry gRe€ €ÐRe†(4) : € "WAITING"À]e"Y"Å]e€Ê]e€ I=1 Š LEntryÔ]%e € "DRAW I"Þ](e€ò]5e†(4) : € ¨a=0 Š B$=ˆ(B$,2) 2ih€ ‚=B$PFi!h"INIT" S$(1)=‚ S$(Z(2,1)) : S$(2)=‚ S$(Background) : S$(3)=‚ S$(Palette)CPimhC$="MODE 5 : COLOR "+S$(1)+","+S$(2)+","+S$(3) : € "PRINT C$"Zi²h€xi³h: ‚i³h"SAVE I"$Œi³h€ J=1 Š 10 : T(J)=Z(J,I) : €)Žiãh€ J=1 Š 8 : S$(J)=‚ S$(T(J)) : €E‘ii€ T(2)<>TColor Š TColor=T(2):C$="COLOR = "+S$(2):€ "PRINT C$"“iNi€ € T(1)>3 Š T(1)<9]–i…i € AX<>T(7) Š AY<>T(8) Š AX=T(7):AY=T(8):C$="RATIO "+S$(7)+","+S$(8) : € "PRINT C$" ›i j€ €B i j€ T(1) € "S1","S2","S3","S4","S5","S6","S7","S8","S9","S10"ªi,j"PRINT C$" €1 #1,C$ : € ¾i?j"S1" A$="PLOT " : € "S123"ÈiNj"S2" A$="BOX " : € "S123"Òi]j"S3" A$="BOX FILL "=Üiij"S123" C$=A$+S$(3)+","+S$(4)+" TO "+S$(5)+","+S$(6) : € æiÀj"S4"ðiÀj"S5" A$=""<õiÌj"S45678" C$="CIRCLE "+A$+S$(3)+","+S$(4)+","+S$(5) : €"úik"S6" A$="FILL " : € "S45678"(j$k"S7" € "S4" : A$=" TO " : € "S78"j6k"S8" € "S4" : A$=" PLOT "$jEk"S78" C$=C$+A$+S$(6)+",64" : €)@jlk"S9" C$="FILL "+S$(3)+","+S$(4) : €KJj›k"S10" C$="PRINT%("+S$(3)+","+S$(4)+") "+ˆ(34)+Text$(T(5))+ˆ(34) : €/u÷kŠ ,0u÷k"SHOW SELECTION" : C1=1 : C2=0 : € ÿXu#:ul"HIDE SELECTION" : C1=0 : C2=3#Xul€ CO<4 Š CO>9 Š CO<13 Š €&buOlX=(CO-1) Š 9*113 : Y=(CO-1)/9*700lu{l†(5) : € C1 : €* € X+3,Y+5 Š X+110,Y+67qu©l€ CO>9 Š I=CO-3 :€ I=CO/vuÆl€ C2 : € Š X+X(I-1),Y+Y(I-1),ˆ(S(I-1))4€um€ CO=9 Š € 957,30 :€ € CO=18 Š € 957,100”u3m†(4) : €PÃ:mŠ %ZÃ:mŠ *****************************%dÃ:mŠ * PATTERN DEFINITIONS *%nÃ:mŠ *****************************xÃ:mŠ --- UP ARROW ---.‚Ã:m€ 35,40,RRRRDDDDRRRRUUUURRRRHHHHHHKKKKKKŒÃ:mŠ --- DOWN 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