#!/bin/sh # MetaCard 2.3 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" R Calcolatricewwhite X CalcolatriceU helveticaU helveticaU helveticaUcleanUcleanUfixedUfixed @ X @ X @ X !"+ @ X#$%&'-/09 @ X1235;<=E @ X>?@CFP @ XKLMN sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png PrincipaleHcon dotGest cifra global op, dot, tdot, dispvalue; if op = "=" then put "" into op end if put cifra into tdot if dot = 1 then put "." before tdot put 2 into dot end if if cifra = "." then put dot + 1 into dot put "" into tdot end if if dispvalue = "0" then put "" into dispvalue end if end dotGest 0hi(` sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png Display x on addCifra cifra global dispvalue, tdot; send "dotGest cifra" to this background put tdot after dispvalue set the text of me to dispvalue end addCifra on doClear what global dot, dispvalue, accumulatore, op; put 0 into dispvalue put 0 into dot if what = all then put 0 into accumulatore put "" into op end if set the text of me to dispvalue end doClear on oper what send "operGest what" to field "Scripts" end oper 86$ 01Ep?on mouseUp send "addCifra 1" to field "Display" end mouseUp 8`(( 2Ep?on mouseUp send "addCifra 2" to field "Display" end mouseUp ``(( 3Ep?on mouseUp send "addCifra 3" to field "Display" end mouseUp `(( CEp@on mouseUp send "doClear all" to field "Display" end mouseUp `(( CEEpBon mouseUp send "doClear entry" to field "Display" end mouseUp `(( 4Ep?on mouseUp send "addCifra 4" to field "Display" end mouseUp 8($ 7Ep?on mouseUp send "addCifra 7" to field "Display" end mouseUp 8(( 0Ep?on mouseUp send "addCifra 0" to field "Display" end mouseUp 8(( 5Ep?on mouseUp send "addCifra 5" to field "Display" end mouseUp `($ 6Ep?on mouseUp send "addCifra 6" to field "Display" end mouseUp ($ *Ep;on mouseUp send "oper X" to field "Display" end mouseUp ($ 8Ep?on mouseUp send "addCifra 8" to field "Display" end mouseUp `(( 9Ep?on mouseUp send "addCifra 9" to field "Display" end mouseUp (( /Ep;on mouseUp send "oper /" to field "Display" end mouseUp (( .Ep?on mouseUp send "addCifra ." to field "Display" end mouseUp `((  -Ep;on mouseUp send "oper -" to field "Display" end mouseUp ($  =Ep;on mouseUp send "oper =" to field "Display" end mouseUp P(  +Ep;on mouseUp send "oper +" to field "Display" end mouseUp (P Scripts( on operGest what global dot, dispvalue, accumulatore, op; switch op case "+" put accumulatore + dispvalue into accumulatore break case "-" put accumulatore - dispvalue into accumulatore break case "X" put accumulatore * dispvalue into accumulatore break case "/" put accumulatore / dispvalue into accumulatore break default put dispvalue into accumulatore end switch put what into op put 0 into dispvalue put 0 into dot set text of field "Display" to accumulatore end operGest d      P  E  9  +     R <,  1  2 P 7 E 6 9 5 + 4  3  iP PrincipaleiP New ButtonA.on mouseUp go to previous card end mouseUp $  New ButtonA*on mouseUp go to next card end mouseUp  1 @6/var/web/webspace/universita/3d/esempi/metacard/1.png   $  ;Per prima cosa selezioneremo 'backgrounds' dal menu 'Edit' sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png New ButtonA.on mouseUp go to previous card end mouseUp $  New ButtonA*on mouseUp go to next card end mouseUp  1 @ hf6/var/web/webspace/universita/3d/esempi/metacard/2.png  t$  ZCreeremo un nuovo sfondo, indicandone il nome nell'apposito campo del dialog degli sfondi sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png New ButtonA.on mouseUp go to previous card end mouseUp $  New ButtonA*on mouseUp go to next card end mouseUp  1 @ g7/var/web/webspace/universita/3d/esempi/metacard/3a.png  t$  @Usando lo strumento 'campo', creeremo un campo per il display.  3b.png @ 7/var/web/webspace/universita/3d/esempi/metacard/3b.png ! 0  Selezioneremo il campo, clickando con il tasto destro faremo comparire il menu e selezioneremo 'properties...', nel dialog che comparir indicheremo il nome "Display" e imposteremo le opzioni come indicato sotto, eventualmente cambieremo anche il font"3c.png @ h7/var/web/webspace/universita/3d/esempi/metacard/3c.png# sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png$ New ButtonA.on mouseUp go to previous card end mouseUp $ % New ButtonA*on mouseUp go to next card end mouseUp  &1 @ g7/var/web/webspace/universita/3d/esempi/metacard/4a.png ' t$p + Usando lo strumento 'bottone', creeremo i bottoni delle dieci cifre, del punto, delle quattro operazioni, dell' uguale, di C e di CE. -4b.png @7/var/web/webspace/universita/3d/esempi/metacard/4b.png /  + Selezionare il bottone, aprire il men e aprire il dialog di composizione script. Introdurre lo script che segue per ogni tasto numerico e per il punto04c.png @d7/var/web/webspace/universita/3d/esempi/metacard/4c.png1 sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png2 New ButtonA.on mouseUp go to previous card end mouseUp $ 3 New ButtonA*on mouseUp go to next card end mouseUp  5 <$p 9 Gli operatori avranno il seguente script, dove 'X' la moltiplicazione, '+', '-' e '/' rispettivamente somma, sottrazione e divisione;5a.png @`7/var/web/webspace/universita/3d/esempi/metacard/5a.png <  $p 9 WI bottoni C e CE avrano il seguente script (in C al posto di 'entry' indicheremo 'all'=5b.png @7/var/web/webspace/universita/3d/esempi/metacard/5b.png> sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.png? New ButtonA.on mouseUp go to previous card end mouseUp $ @ New ButtonA*on mouseUp go to next card end mouseUp  C  $T E 7Lo script del 'Display' conterr i seguenti 'handler': F h h on addCifra cifra # global op, dot, tdot, dispvalue;   if op = "=" then  put "" into op end if   put cifra into tdot  if dot = 1 then  put "." before tdot  put 2 into dot end if   if cifra = "." then  put dot + 1 into dot  put "" into tdot end if   if dispvalue = "0" then  put "" into dispvalue end if   put tdot after dispvalue  " set the text of me to dispvalue end addCifra  on doClear what + global dot, dispvalue, accumulatore, op;   put 0 into dispvalue  put 0 into dot  if what = all then  put 0 into accumulatore  put "" into op end if " set the text of me to dispvalue end doClear  on oper what + global dot, dispvalue, accumulatore, op;  switch op case "+" 3 put accumulatore + dispvalue into accumulatore break case "-" 3 put accumulatore - dispvalue into accumulatore break case "X" 3 put accumulatore * dispvalue into accumulatore break case "/" 3 put accumulatore / dispvalue into accumulatore break default $ put dispvalue into accumulatore end switch   put what into op  put 0 into dispvalue  put 0 into dot . set text of field "Display" to accumulatore end operJ `iK sfondo.png @ X;/var/web/webspace/universita/3d/esempi/metacard/sfondo.pngL New ButtonA.on mouseUp go to previous card end mouseUp $ M New ButtonA*on mouseUp go to next card end mouseUp  N  $ P }La calcolatrice qui accanto compare in ogni scheda in quanto inserita nello sfondo (background) e non nella singola scheda