-not a Macintosh disk-DPi`KJDBH@%S4^;NP"N,L 8!"@$|Gn"`I N.@A,H<( F<B<H111.Bx<kNNF`, 8! "NH@"|J(g g`LNu"_ |a||a0@||9݁g|w|a||NH瀀 |(_@"g2<@gBA?N`Fa`||aPLNu  fBR$N"NBH@&|݁ |B$<0HN~NL@dBgg>N&|)`RNuBBBA*2h/ BBB N _"_$_"H&|݁ |B$<0NNd 0<`L$|J HA H  2I<FFI<<FFfHHFFfHHH?B@L"_2N _0H 2<@I6@o Az:<2`6@oJA~:<26" @n2BDBB(`EB@nAJEkz`z2<HAIL0.NL0.N  / p? O@ 0  0  XO _,_2_!.NBBB/ BBBN08 @ gNu@ f"_E!NH\O/ ?`@&x|N _!@"|xEz En"`CE"|xN"Ҹ< A  33"|@E E4n"`C&E"|@.N _LHNFLN*8&E@<<'CJJKK f`  f `><$CS*<FF4>BRIBC Gff&<CBSC`D GnKG45BQf` f `Ns |0< BXHQ!4 _$_"_!XOHH/8/ $ f0<? QN ! N.x $_$ g ! N.x !C !!LLyp!N\OFN  l0P߀ Aǀ`  6lo6@ 0_an*>]> j 56, l602  ۰Poo A` &ll6p@ 0?۷a?^ ꭕ 5o6, l602 8!ED91kE"0369? CoNGNOS BOOT FAILED TRY A NEWER MACHINE AND BOOT PROM _"_NN/A lNNu _.NHL$ orD?|?@?e\SFk!!QSWk:CL<HL|hH>L|4H>L|H>SWjTO>SGk\!Q`TSFk QSWk8L|H|L|H|4L|H|hL|H|LSGkQLx _O NNVH8=| f=|G* G, &N(N n"n$n 0.  S@ZeJ S@BBDBG S@gg.BC CJDg720faL`fa:` 320f8<S@`JDg  fa$` fa`  U@o$SBjt`(N&N><`JGg (Ev#$#$QNukJDg`g 3$f(N`BnLN^ _NUNPACK H>8$O&j.(j4,*8:*,BB6*2SCCn`8CL0@D@04"F K0HEY@2< Vb,g`aJaBVgbHE6SCCo`p`HE4RBCo8B@ j(0 j$L| _pN am znNu _"_$_$0H2< @`Q`BQBNNV;n *N^.NuEVINIT NVH,. ^J]g n0`4B?N. f n0`/.//. /.N6(n)FLN^ _NEAD_BLONV/ (n Jno./.?././ /.Nj nJPg`RSn`(_N^ _NEAD_SEQHNT"|E.|r |BBByBygRBf~NuLHPPNqNqpS_n.0<QLHPPNqNqpS_n|~By&JM*Np|azJGfb|a|,Mpa`JGfH|a<<AaJGf0Avtp BQvr BQH@02N\LhL"4NtB@6Kd a"JDf`02IP g a JDf`Nub SBg pxNuBDNu><Nu4< vB@bp2IPSCfSBfNuppB@(4<dBC(4< CBC(C"H4<BACSBf(CAg><NuJoNV?-,N.H|)?NN^ _TONRAP NV.HgVS@g`J.f& -`мS//<N/<NB+_`-m` . ѭ` -`o<Np`B . \J.f/-\/<N4/<N+_\-m\ -\l<N,N^ _PONGETSPACNV .мS//<N/<N-_ .=@ N^.NuINDSPARNVH.. Bg/N0Hހ m0.@I/./<N 8//<Np @n ?.Bg?<BgNLN^ _ NETMMU NVH+| d+|l+|(+||+|+|t+|(|;TV(|;T|(|.;Tz&| n!SLN^.NuETVARS NVH/Nt;| .䐼/+@ .м/м+@+|`*<(< E"D +@\&|?-|0-VS?NHnHmJNJngp+@JBBg/-BgNz+_ -Э+@XBB<0<H/BgNPN+_P+mPBG` m @I G~V GTVgd Gl|p@ @8`$ Gf|p@BT`| p@BT H< @"@=A?.??<BgNRG Gox mI|p@BT mIP|p@/-P/<N* 8LN^NuOOTINITNVH(nB BgNBgNHH,BgN0HѬ f,/, N"BgNBgNHH,BgN0HѬ f,/, NBgNrBgNjHH,BgN0HѬ f:Jf< N/, NBgN2BgN*HH,BgNb0HѬ g<NLBN,BN+_ n/BN|  _r Ё0p//-`N/-/-`N&m`:=E E0o<N0<H+@l+| -lЭd n2HҀ -Ё"-Ҁ(Bg Э/N0Hѭ -Є+@B</-BgN+_+mh -dЭh+@p -lЭp, n0HІ+@ -Э+@ -Э+@?<f/-/-?<Nb-m/ /./-N n LN^ _ NUILD_SYNVH(nBGBF. gB `P-n n0. PoB."` n0. A-H&n/+/<N  n0>+<+/, NBgN<BgN4HH-@BgNj0H(٬ JVJ_gB."`4JGW WJGV WgJFf n `H n n/B."n/BgN2  _ BNB-_JGf n Q/ n P/Nr` Q@H/ n P/NZ|B. n=h-nA-H n-P/./.p/N JGgR-mBg n/( n r Ё/ n P/ nP/ | ? Q@?N9_Jlg< N, nQ f|"LN^ _NOADSEG NVHBBg/-tBgN+_x -x"-Ҁ+At(|`p}//<Nn -Пx((|p}//<NN -Пx(?<}/-x/-t?<N&|BSLN^.NuLLOC_SCNVHAC 0BgHnNz_m+m-gBBg/-BgNP+_`+m-gBBg/<BgN, м,BgBgBHnBgHnHnBg/.N g<NACD 0BgHnN  g B-n`.BgBgBHnBgHnHnBg/.Nx g<Nf .@+@ -Э+@` B -@+@ -м@+@?</-/-?<N@ <逐.JfB` .ЇP-@JfB` .ЇP-@-g -Ї/ -Ї//./.N`/-/-BBN(|p((|t(LN^.NuOAD_DEB SYSTEM.DEBUG2 SYSTEM.DEBUGNVH nCJp"S@n2&n (nBBgHnN dgZB /, N NBgN BgN HH(BgN0H* f&.B</BgN&B /, N //NlLN^ _ NOAD_UNPNVBgBgBHn</. /.Bg/.N g<NN^ _ NOAD_LLDNVH(n 0-N|>Jg,, .* Ю(H//<N( Д-@`,.(.H//<N-_?//?<N. .P/NdLN^ _NNSTALL_NVH(n=n ~`/, N BgN p_BgN fHH(BgN 0H-@Jg .Ѭ `<N~ .fBN (BN ( GfAB0pB5pB`ACZ 0z`BgN _ .ARE EoHn?<?<HnNAC 0HnHzNg(AB0pp @AB @AB`2HnHzNPgAB0pB5pB`App| 5pgnBg?/.Hn @AHp @AHp</.NX g<NF?. @A/0 @A"0Ҽ/?<NHRGinoLLN^ _ NOADCODEkrni NVBBg/-BgN+_?<e/-/-?<NN^.NuAKESUPSNVH(m . R A T&@-kLN^ _ NINDMAINNVBg/-NF0HѭB</-BgNx+_?<g/-/-?<N\Bg/-|N 0Hѭ|B</-|BgN>+_?<{/-/-|?<N"N^.NuLLOC_OPNV A0C ArC 0AC 0/NLHnHm/NFBgHn0N g< NHnHn/NBgHnrN g<N^/NZBg/.Hn$/N;_N/./.Hm/N-UgNj/.$?-N/N@/N2 n /B/.$0-NH//NR  _ /NBNj+_N^ _PONOADSYS $ SYSTEM.UNPACK SYSTEM.OS SYSTEM.LLDN :NV,_NUvN ,+|v mv PVD@UNHmHmNHm?- -|Э//-NzNZN N]N NuN^NuOADER NVHAv(HA^&HHn?-.0-0H".Ҁ// / NrJng<NLN^.NuEAD_PAGNV0.HBH"-DҀ-A0.HBH@J@=@/.NvAv0.HЈ-@ N^ _TONIND_SENNVBH nCJp"S@n2 n BBgA/A/Nz-m2Av(H&L U.=m6B|`A^-HHAv(BE`:HnN?-.0-0H".ҀH҅///.HNhؼJnNg<NRE Eom6l^Bn So4 X/ U/0S@?A/?<$Hn/. N n gRn G0.D@@20HҌ-A n-P`/ /?A/?<$Hn/. NRFinBo$ n g< G0.D@@20HҌ-A/.HnP?<NN n/B?.vN4  _ LN^ _ ND_SEARCNVH n-h .S/0-:H/N ;@Z-n p+@V;m:\BF` AvIBBlRF Fo=mHnNBgHn?->N>H/p6/NNZBp6/A/NACp S@n0HnN^J.gHHnHnN .Wgz n/B?.N  _ `SFRGm>fBGBNJFfELN^ _PONOOKUP_ENVH.<A"G";n .;m.,?.?-.N;n0BN&Av(HJg<NH;l~:+lD;lB;l>;l@;l<;T8;l26+l.2 2f<N m8lB?,N&_+SH+kL+kPLN^.NuNITMEDINV m8lBg/.HnN2_`/.HnHnNn .gB/.N-_N^.NuPENINPUNVH(.BGBF Go<NR Av:0JEf<N8 EHl@ AvH"Ұ n n Jf<NHH " n ``RGE`LN^ _ NIND_POSNV-mV/.0-:H/N+_VJV]2-ZHV]g<N0-:H/-V/N2 .;@\ -Vg/-VHnHnN/.N"N^.NuILLBUF NV0-\m:f -VR2-:H//NNT0-\AvpRm\N^NuETBYTE NVHBgNHH<BgNH>JGl H м> G=@LN^NuETWORD NVHBgN0H//<ND,BgN0H.Jl޼ Ї-@LN^NuETLONG NVH,. 0-:m\>HǼl>JGo0-\AvA//.H/NH߮Hǜm\0-:HnJV]2-ZHV]g<N -VR/HnHnNn-nA^(H/0-:H/N*l-EJoZHn?-.0-0H".Ҁ/?././ NjJng<N~0-:H/./N(ٮ .Ѯ .ѭV`:Jo -VR2-:H//NNhJfLN^ _PONOVEMULTNVH(n0,k @nH0;N *6BN\BgHlN_`n/,N`dBgN_`XBgN9_`LBN)_`@/,/,N:`2&l.,/ ?-.0-0H", Ҁ/?,/ /NP`<NhLN^.NuRIVER_C//0/2/ AH@B@2/Ё/@" /WXNuNV// /"/N:/A" N^/WXNuNV// /"/N/@" N^/WXNuH>*jD,jD$HBJBf6B@H@g4HB04"B@H@`$&BBxԂрҁmRQJjDjDL|NuNuNuJoNu$_0 _"_J @o4$ Tg,2ABAgSBgS@2@ISA QS@kQN$_0 _"_J`!QN$_02 _`QNHBB oJ0/2/gk gRBSAn` R gSBRAk?B/oL\NuHBB oJ0/2/gk fRBSAn` R fSBRAk?B/oL\NuHr`HBA oJ"oJB@f`fQ AA/oL\NuH"o J oJv`:H"o J oJBC`&H o J"oJv`H o J"oJBCB@BA@m4`4`fQ@n C`cC"/oL\NuH0/ oC"4JBAR`$aJBBB`QQ oC"0/H#//IL._NuH oJB@BA"o JBBBlBA`$HR` fQ`RS@`?A"/oL\NuH o0/2/SA"o JBBA@m`Q/o L NuB`$_02 _ @o0 Ao*BBAm"6@SCBoSA`@"H`RCoN$_0"_ _J/ S@m*BABB@m6B$I”@`!Q`QNuG5[TK3̆V{t|̆^G :a$9kT8k:)$ "#." #"##%& ! ,? M  S W ]H  (  ,    *     !"$#-$1%5&9'A(0U1Y2]3a4k056789L:;<=>T?@ A B(C%DeEi$F.1 .1m$*Ask.TEXTLLo$*AskDir.TEXTLםL $*Install.TEXTL[4 $IconEdit.OBJVV**$M1BOXER.TEXTtftf#$M2BOXER.TEXTtf؜tf$M3BOXER.TEXTtt tt$M4BOXER.TEXT tctj$M5BOXER.TEXT%t/t6$M6BOXER.TEXT*wH8wH<$M7BOXER.TEXT/|Bp|Bx$M8BOXER.TEXT4}^}e$P1BOXER.TEXTt؝&e$P2BOXER.TEXTtV&v$P3BOXER.TEXTw&}$P4BOXER.TEXT#w&}$P5BOXER.TEXT(Q&}$P6BOXER.TEXT-wx&$P7BOXER.TEXT2|CM'$P8BOXER.TEXT7'$TK/ALERT.OBJ縜HH$TK/COMP.TEXT ,UGy$TK/MAKE.TEXT Ck\4(($TK/MAKE.TEXT Ck\4(($TK/MAKE.TEXT Ck\4(($u4boxer.text!w*2K}$X1BOXER.TEXT3$X2BOXER.TEXTlj$X3BOXER.TEXT&xd{{nFj*NNNNNNNN( *Install.TEXTTEXTxSn`N^ _PONНZ+jL][4NV n  M *Ask.TEXTTEXT. . ̎Z+jLZLoNV n  S *AskDir.TEXTTEXT. . ̎Z+jLםfLNV n  W TK/ALERT.OBJ.OBJxSn`N^ _PONНZ+j縝uNV n $ ]$ TK/COMP.TEXTTEXTxSn`N^ _PONНZ+j,UwGyNV n   TK/MAKE.TEXTTEXTxSn`N^ _PONНZ+jCkz\4GNV n  TK/NullChange.OBJ.OBJ`N^ _PONНZ+jG}G NV n   TK/PABC.TEXTTEXTe.OBJ`N^ _PONНZ+j*e逝HFNV n  TK/UNITCHANGED.TEXTTEXTN^ _PONНZ+jέ邜>NV n  TK/WorkDir.OBJ.OBJ.TEXTN^ _PONНZ+jG郝G NV n   TK/XRead.TEXTTEXTJ.TEXTN^ _PONНZ+j醝GNV n   IconEdit.OBJ.OBJ. . ̎Z+jV錝VNV n   M1BOXER.TEXTTEXT. . ̎Z+jtf鏜tf#NV n   u1boxer.texttextxSn`N^ _PONНZ+jt铝JVMNV n   U1BOXER2.TEXTTEXTxSn`N^ _PONНZ+jt镝JWNV n   P1BOXER.TEXTTEXT. . ̎]t؝陝&eNV n   X1BOXER.TEXTTEXT. . ̎]靝3NV n   M2BOXER.TEXTTEXT. . ̎]tf؝颜tfNV n   u2boxer.texttextxSn`N^ _PONН]tc駝JaNV n   U2BOXER2.TEXTTEXTxSn`N^ _PONН]uН髝JaNV n   P2BOXER.TEXTTEXT. . ̎]tV鰝&vNV n   X2BOXER.TEXTTEXT. . ̎]鵝ljNV n   M3BOXER.TEXTTEXT. . ̎]tt 鹜ttNV n   u3boxer.texttextxSn`N^ _PONН]w읨龝JcNV n   U3BOXER2.TEXTTEXTxSn`N^ _PONН] w JeNV n   P3BOXER.TEXTTEXT. . ̎] wǝ&}NV n  - X3BOXER.TEXTTEXT. . ̎] ̝&xNV n  1 M4BOXER.TEXTTEXT. . ̎] tcќtjNV n  5 u4boxer.texttextxSn`N^ _PONН] w*2֝K}NV n  9 U4BOXER2.TEXTTEXTxSn`N^ _PONН]w,۝۝KNV n  A$TK/NullChange.OBJ GG $TK/PABC.TEXT *eHF,,$TK/UNITCHANGED.TEXT έ> $TK/WorkDir.OBJGG $TK/XRead.TEXTG$u1boxer.texttJVM $U1BOXER2.TEXTtJW$u2boxer.texttcJa $U2BOXER2.TEXTuНJa$u3boxer.textwJc$U3BOXER2.TEXTw Je$$$u4boxer.text!w*2K}$U4BOXER2.TEXT"w,۝K(($u5boxer.text&wWK$U5BOXER2.TEXT'K00$u6boxer.text+|KPC$U6BOXER2.TEXT,PLL$u7boxer.text0P]$U7BOXER2.TEXT1ߝP TT$U8BOXER.TEXT5PL(($U8BOXER2.TEXT6 WQY$X1BOXER.TEXT3$X2BOXER.TEXTlj$X3BOXER.TEXT&x$X4BOXER.TEXT$z$X5BOXER.TEXT)$X6BOXER.TEXT.&$X7BOXER.TEXT3'$X8BOXER.TEXT8sW$UCLOCK.TEXTd~؝HnFFD.TEXTnF@@@@@@@@$($TK/NullChange.OBJ$MRESOURCE.TEXTU$uoldresource.TEXTy${D109T5}$R)${D127T1}K${D164T4}m${F173}$BUILD/MAKE/CTKLIB.TEXTv$libtk/UDRAW.TEXT$ufixutext.OBJ$MWRITERESFILE.OBJ$XWRITERESFILE.text$MACFORTH.TEXT$m8boxer.texty$MSAMRULER.TEXT$PSAMRULER.TEXT$twotext.TEXT>$UCLOCK2.TEXTQ$URULER.TEXT$x6boxer.text $ example/edit.OBJu$ Intrfc/Graf3D.Text$ Obj/QuickDraw.Obj$ Serial/PipeImpl.Text$ callpas.obj$ TKALERT.TEXT$ USCRAPIO.TEXT~$ MD/GE.68K.TEXT$ MD/RULERFONT$TERMBUGA.TEXT$B/KEYS.TEXT$work/Ascii.TEXT1$work/Terminal.TEXT$DEHEXIFY.TEXTS$T/TALLY.TEXT~$Obj/MacPrint.Obj$v.TEXTw$t.TEXTƜ$xref.help.textay|$xref.OBJ`zؚzz.8${T11}buttons#${T11}obj*{(${T11}PHRASEsX)*(jjxP(`8pH X0h@xP(, P4BOXER.TEXTTEXT. . ̎]w&}NV n  U X4BOXER.TEXTTEXT. . ̎]zNV n  Y M5BOXER.TEXTTEXT. . ̎]t/t6NV n  ] u5boxer.texttextxSn`N^ _PONН]wWKNV n  a U5BOXER2.TEXTTEXTxSn`N^ _PONН]ꝨKNV n  k P5BOXER.TEXTTEXT. . ̎]Q&}NV n   X5BOXER.TEXTTEXT. . ̎]NV n   M6BOXER.TEXTTEXT. . ̎]wH8wH<NV n   u6boxer.texttextxSn`N^ _PONН]|KPCNV n   U6BOXER2.TEXTTEXTxSn`N^ _PONН]坨PNV n & & P6BOXER.TEXTTEXT. . ̎]wx&NV n   X6BOXER.TEXTTEXT. . ̎] &NV n   M7BOXER.TEXTTEXT. . ̎]|Bp%|BxNV n   u7boxer.texttextxSn`N^ _PONН]+P]NV n   U7BOXER2.TEXTTEXTxSn`N^ _PONН]ߝ1P NV n * * P7BOXER.TEXTTEXT. . ̎]|CM7'NV n   X7BOXER.TEXTTEXT. . ̎]<'NV n    M8BOXER.TEXTTEXT. . ̎] }^B}eNV n    U8BOXER.TEXTTEXTxSn`N^ _PONН]!HPLNV n   U8BOXER2.TEXTTEXTxSn`N^ _PONН]" WOQYNV n @ %@ P8BOXER.TEXTTEXT. . ̎]#U'NV n  e X8BOXER.TEXTTEXT. . ̎]$[sWNV n  i*install..TEXT..TEXTҹ T\lNV n  m*install..TEXT..TEXT \ecNV n  q3. "6F^9DED!$ǐ^a[4ograms?) ) = 'Y' THEN 3. "6F^$EXEC(dir,sample) $CLEAR SCREEN $ F{} $ $IF <-TK3-*Ask(Do you want to install the exec files?,Y) = 'Y' THEN $ { Put the exec files and programs on the BOOT volume } $B{}-TK3-TK/=,-#BOOT-$ $Y $ENDIF $ $IF <-TK3-*Ask(Do you want to install the Icon Editor?,Y) = 'Y' THEN $ { Put the icon editor on the BOOT volume } $B{}-TK3-IconEdit.OBJ,-#BOOT-$ $ENDIF $ $ { Ask about installing the Tutorial Samples } $IF <-TK3-*Ask(Do you want to install the Toolkit Tutorial sample programs?,Y) = 'Y' THEN $ $$SET dir TO <-TK3-*AskDir(Where do you want to put the sample programs?) $ $ { Install the sample programs } $$RESETCAT '-LOWER-X=.TEXT' $$REPEAT ($SET sample TO UPPERCASE(NEXTFILE) ($IF sample <> '' THEN ,$SET sample TO COPY(sample,2,POS('.',sample)-2) ,B{}-LOWER-M[sample].TEXT,[dir]$ ,B{}-LOWER-U[sample]=.TEXT,[dir]$ ,Y{} ,B{}-LOWER-P[sample].TEXT,[dir]$ ,B{}-LOWER-X[sample].TEXT,[dir]$ ($ENDIF $$UNTIL sample = '' $$ $ENDIF Q{} $ $DOIT $WriteLn 'Installation Completed.' $ENDEXEC 3. "6F^9EXD!$ǐ^lLne default answer. (b+pJ̫̑xv̐pJ@̫̫̐p(bEXEC(prompt,default,ln,temp) ${ Ask the user the yes/no question, prompt, giving default as the default answer. &Returns 'Y' or 'N'. } SET default TO COPY(UPPERCASE(default),1,1) IF (default <> 'Y') AND (default <> 'N') THEN $SET default TO '' ENDIF SET ln TO '' WHILE ln = '' DO $IF default <> '' THEN (SET temp TO CONCAT(' [', default, ']') $ELSE (SET temp TO '' $ENDIF $SET temp TO "[prompt] (Y or N)[temp] " $REQUEST ln WITH temp $SET ln TO TRIMBLANKS(ln) $IF ln = '' THEN (SET ln to default $ENDIF $SET ln TO UPPERCASE(ln) $IF (ln <> 'Y') AND (ln <> 'N') THEN (SET ln TO '' $ENDIF ENDWHILE RETURN ln ENDEXEC 3. "6F^9n)D!$ǐ^  nL-' THEN (SET ln TO "[ln]-" $ELSEIF (ln = '#PREFIX') OR (ln = '-#PREFIX') THEN (SET ln TO '' $ELSEIF(f.}pJ̫̑xv̐pJ@̫̫̐pSE ,S(f.}pJ̑R̢P̑xv̐FFFpp̫.FPFP\̑N̐ÆFFxpJ@̫-̫ĀZ̢PxFPF̑N̫̐FFxFF.@ppJŊ̫-̫EXEC(prompt,ln,temp,default) ({ Given a prompt such as 'Enter directory to which to copy sources', this ,exec file returns a directory as '--' or '' (means the prefix volume); ,the that is entered is used as the default the next time this is run. } ${ Set up the prompt string & default (if any) } RESET COMMBUFR, 'TK Install' READLN (COMMBUFR) default IF (default <> '') AND (default <> 'EOF') THEN $SET temp TO CONCAT('[', default, ']') ELSE $SET temp TO '[prefix volume]' $SET default TO '' ENDIF SET prompt TO "[prompt] [temp] " WHILE TRUE DO $REQUEST ln WITH prompt $SET ln TO UPPERCASE(TRIMBLANKS(ln)) ({ Put the input into the proper form } $IF (ln = '#PREFIX') OR (ln = '-#PREFIX') THEN (SET ln TO '' $ELSEIF COPY(ln,1,1)='-' THEN (SET ln TO "[ln]-" $ELSEIF ln = '' THEN (IF default <> '' THEN ,SET ln TO "-[default]-" (ELSE ,SET ln TO '' (ENDIF $ELSE (SET ln TO "-[ln]-" $ENDIF +{ ln now is of the form '--' or ''} $IF temp = '' THEN (RETURN temp $ENDIF $SET temp TO COPY(ln,1,Length(ln)-1) $IF Exists(temp) THEN (REWRITE COMMBUFR, 'TK Install' (WRITELN (COMMBUFR) COPY(ln,2,Length(ln)-2) (RETURN ln $ENDIF $WRITELN "The directory '[temp]' does not exist." ENDWHILE ENDEXEC  +hPASLIB UNITSTD GRAFUTILUNITHZ STORAGE QUICKDRAHWINT FEDEC FONTMGR EVENTS WINDOWS FOLDERS MENUS FLDUT WMLSTD WMLCRS WMLGROW WMLSB INTERNATALERTMGRUNITFF UNITCS UNITFILEUNITFMT UUNIVERS FMGRUTIL*PMM +PMDECL ,UNITFIGA-SYS1LOCK.UCLASCAL/IOPRIMIT8SHELLCOM9PROGCOMM:DBENV ?FIELDEDIGSCRAP IFILERCOMKPRSTDINFMSTDUNIT XBLKIOINTfBLOCKIO gPASHEAP hBx(ADN8|PASLIB1 LWWORK OTHRWORKACTIVATEOPENSEG1INcold NEVER alert WMcold SMcold SUcold "SCROLL &UT 3SYSINIT APMMSeg CWORKSET DGRAFSEG EFEcutCopFFEcold GSBcold HOPENSEG2IMOVERS KALRTDIALNOPEN1LW OPASIOLIB`SgPASinibSULib cMainProg xADJoNV/=mBG` ZAHpBgRGino.N^NuLOSEFILJoNVHm?-",-@J@o HmHm".gNHmР,"0N^ _TONUITGEN JoNV/- /- HzPBg/- /- Hz&BgX<NjN^ _\ONEAPERRO6type SPACE to exit!The heap is full. User Croak !! JoNV nCJp@"S@n/- J-f/- HzBg/- <?<x/- Jml/- HzlBg/- `:/- HzBg/- 0-H/?<|/- <.?<x/- `/- Hz4Bg/- <?<x/- Jml/- HzBg/- `X/- HzBg/- 0-H/?<|/- HzBg/- 0-@A20SAH/?<|/- /- /- HzRBg/- HnBg/- <.?<x/- /- X<NN^.NuISTAKE Error is...  item At menu At the beginning of the fileFatal error in Menu File.At alert number *Fatal error in Phrase File, Alert Section.JoNV nCJ"2.H@J@WD@ N^.NuTAGELESJoNV nCJp@"S@n/- /- HzBg/- 0-@AHpBg/- /- HzBg/- HmBg/- /- /- HzjBg/- 0. H/?<|/- HnBg/- Hz*?. A/HnNN^ _\ONOERROR 6 OSErrs.ErrError Output file is: Input file is: JoNVJno"Hm?-/. 0.H/Hm<B"Jmo ?-HzNN^ _\ONRITENEX writing the output file!JoNVHBg@g<N~JmlHz.N0-ZAHp/.?<p0-ZAHph0-ZAHpg`Jm^-g4/- HzBg/- /.Bg/- <)?<x/- 0-ZAHpBgSmB` n@J@o np0A A$fT np0A A~f`Jm^-g4/- HzBg/- /.Bg/- <)?<x/- 0-ZAHpBgSmB`Hz/."T<JFf n@R@<B.`BHz/.? n@FR@?Hn"HnHn?<" ACp@ S@n n//.?< U@?Hn" _Cp@ S@n/.Hz?<Hm^-g4/- HzBg/- /.Bg/- <)?<x/- Rm moHzN0-@ nECp@"S@n0-ZAHp/.?<<;_Jmo ?-Hz"/.Hn?<" HnN.@J@ov0-ZAHp/.?<p0-ZAHph0-ZAHpgHzHnHn?<" HnN n/Hn"gB`< np0A A;fB`$ np0A A~f/.?<?<"g~LN^.NuEADNEXT*Include file does not have a marker named  opening include file Include files nested too deep(Begin Include File .text$~(Stop Reading Include File (End Include File *A line with just a zero should precede EOFJoNVHB n@=@~` n0p@ @ f RGino|F LN^.NuLANKLINJoNVRm-@ml;| `0-A0A;AN^NuDVANCE JoNV nCp@"S@nBmNN^.NuTARTPARJoNVpAHmHm-@R@?"`-@J@fP-@mm>HzHm0-R@?-@m?Hn"HnHn?<" HnN~`p-g/- HmBg/- < ?<xB|` H  AHpHm"gR oJfHz0HmHn?<" HnN(GLN^NuARSEKEY&Unknown keyword: Extra characters: JoNVHBFBG m fN` m V m VgH m0\ m9_g  2-@|0>RFNb`J-f HzN~`HzNt`JFfJ-f HznN``HzBNV-g /- H/?<|/- < ?<x=GLN^NuARSENUM!Menuid or command number expectedAlert number expected$Nondigit in menuid or command number*Nondigit in alert number or version numberJoNVHBgN> GlHzNnmoHz~N`=m|` Apf>`RFinoHz*N0 D@"n i1@LN^.NuQUATIONT"Can't equate to an undefined alertCan't equate to a later alertCan't equate to 0JoNV/ n(hBgN&HS@gU@gY@g4S@g"S@g:`F LTPP`@ LTPP`2 LTPP`$ LTPPp` LTPP`HzN8(_N^.NuARSEQUA"!Caution not followed by qualifierJoNV/ n(hBgNrHS@gS@g4S@g"S@g6S@g@S@gJ@ gR`X LTPP@`R LTPPP`D/.N`: LTPP0`, LTPP ` LTPP`l`HzNh(_N^.NuARSESEV&%Alert number not followed by severityJoNVHBBG`g S@@"A=` @IBB,BB|.gBgNdH@ k @nH0;Nh"*2<J`|B`f|`^|`V|`Nx|`DfHznNz`6 gB.`HzPNd` B.z`B.z/.N`HzNB`T  "gHzN( @I n&h0gS@g:S@gbS@g`H KT@HP?P,H KT@H`~H KT@HPρP,H KT@H`RH KT@HPP,H KT@H`&H KT@PP,H KT@RG Go4LN^.NuARSESTA6 missing stagebad word in stageextra ; Bad use of +JoNV/ /. N BgN;_Jmod n0(nBlllll/NBg/.N g$ nJhf/NdBgN gHz(N~-g/- (_N^ _PONARSEHEAtoo many stagesJoNVH(nB- m^fN0-@!g@gpS@glS@ghS@gdS@g`S@g\U@gS@gS@g]@gfY@g6@ g$U@gN@g[@g"@ gU@g:`N `8N`8N`0-|02<@8Nh`|8N^`r m?f8`8NF m V m^VgN``@<-~N mf GlRGN`pG"|7A|8` ;|^N^`f8 m V m V m^VgN6` m fN(` m W-AJA^gHzHm-@R@?"<-@J@W TWD-g0|@kF @n>H0;NzfR>*444vbN" <5-digit counter#9><4-digit counter#9><3-digit counter#9><2-digit counter#9><1-digit counter#9><5-digit counter#8><4-digit counter#8><3-digit counter#8><2-digit counter#8><1-digit counter#8><5-digit counter#7><4-digit counter#7><3-digit counter#7><2-digit counter#7><1-digit counter#7>  JoNVH n CJp@"S@n(n l0R@.A@ AoHzzN l "l0.@=@~` A0p@ l "l"QRGino l.@PR@ l0LN^ _ NPPEND  Text too longJoNV/.NbBgHnNgJ ng?.HzP/N nW nW nWg-@?Hm/N`N^ _ NARSETEXJoNVH0-LS@=@~` R@=mL<`r @A\Jp_"A$BA\60A\p ^$BA\Jp ^g2 @A\-p @"AA\C\# @A\!RFinoRGinop>-L` @A\Jpo;GL` SG GlBmLLN^NuORTTABLJoNVH&n (n6 loh0,S@A0AnfP0,A0A60k|nAZ2IDA0 <f0| 6Hl0,S@??<"UlLN^ _ NXTRACT JoNVH/- HzBg/- ;|;|LHnN Jml/- HzBg/- `hBgHnNd g0-@ABpHnN0-AIBgN8JTg"=|`&0.rS@A4BHAp8)Rn n oHnNh-g/- HnBg/- .@R@9@B/-?,&_ m fHzzN 0,S@=@Bn` 0.A0A S0.Rni 0.noBg/-Hn.  g/- HzDBg/- 0-@A20A)0-@ARpHnNHnN.@=@Jno~0-L@A\Im0-@ApHzHn"T=_JnW2.QAn^2.nWg0-L@A\1`.;nN0-L@/BgN 2 A\10.S@=@0-L@A\JpWrA0B B.WtA0 C C-W‚ nW4-LBA\Jp _g<0-2-AA40RBrSBA6CJ@CA p8)?<\Hn/NF?</Hn/N80.R@A0.T@AB00.V@A0-AI0.lX@9@pA-g/- HnBg/- B/-0.X@?&_ m fHzN0.V@=@Bn` 0.A0A S0.Rni 0.noBg/-Hn.  g/- HzBg/- 0-2-AA40BBA!RmL0-@ARpJnfZB/-?<&_ m fHz(N SB0-2-AA40BBA!0-A20XA0-A10-@A p oHzNl-g/- HzBg/- 0-H/?<|/- HzdBg/- 0-@A20SAH/?<|/- Hz.Bg/- /- HzBg/- 0-A20H/?<|/- HzBg/- Rm-g/- HnNBgHnN g`SmJmo:/- HzBg/- 0-H/?<|/- HzPBg/- `/- Hz&Bg/- SmLLN^NuDMENUS No menus in file. menus read.All bytes longand is  items has Menu Too many menu items in one menuHAllocate failedheap big fuckup 2#heap big fuckup 1No menus read.Reading the menus.JoNV HHnN8HnNLBgND;_-g*/- HzBg/- 0-H/?<|/- HnNHnN m0\ m9_gBgN;_-g*/- HzpBg/- 0-H/?<|/- HnNHnNBgN;_-g*/- HzBg/- 0-H/?<|/- HnNDHnNXz` gHnN(-g>/- H  A`HpBg/- HzzBg/- HnBg/- .@ @oHzhN.@R@>` A RG GoH @CAC R oTBHnN~BgHnN g oHzN`-gj n@/- H  AHpBg/- HzBg/- HnBg/- `$/- Hz~Bg/- HnBg/- .@ @oHz` A RG GoH @CAC H R@BgHnN gH S@@;_Jmo ?-Hz=m~` A20mf;GxRGino  gHzNښ  g0-R@;@;m԰ mаoHzfNr0-CAC 0Jn]D@Bn|.gHnN0;_Jmo ?-HzNܒBgHnNgB.`BgHnN8gh-g/- HnBg/- JnoHzvN.@R@=@.@=@BG`A0p@A"pRGino`HnHn"HnN&`8-g/- .V.V.V.V/BgHnNx @@.gPJnoHzN0-D@=@0.D@=@0.A=pJnmJnW.gHz*N`&JnW.gHzN0-A1B/-?.(_ m fHzN؎0.S@=@ BG` TC"ppRGin og/-0-@A/00-@A!`/- /- HzRBg/- 0-H/?<|/- Hz"Bg/- LN^NuDALERTS alerts read.All HAllocate failedno text for alert'the equated alert doesn't have any text/there should not be text after an equated alert.Only one line of text allowed when no severity reading the input file!More than 2000 alerts!,Alert numbers must appear in ascending order'Require nonblank text for cancel and okButn name too long  = Too many Butns definedSign name too long cacheBytes = cacheSize = Version number = JoNVHmHmBg"HmHmHm?:@"Jmo ?-HzNjN^NuPENPHFI opening the output file!JoNVHA/?<N<~`\H @CA/?<N H @CjA/?<NH $CrA/H @Aj20RAA?NR o-H=@A/?<NؾmB`H @CA/?<N؜Ri.oA/?<N؄A/p?NrLN^NuRALERTSJoNVHAힶ/?<NF=m~` AI,@g0,R@9@|`B. CA/?<N l/ l PHR@?N @A=p|`$ @ t/ @ t PHX@?NתRFino.gA/?<N׌RGinoHAL/?<Nr=mL~` @C\A/?<NRRGinoLN^NuRMENUS JoNV/=m~`$ @C q/ A?0NRGino.N^NuRALERTTJoNV/Hm?-"Jmo ?-HzpNժB.Hm?-A/BHmBgB"HJmo ?-HzNxHm?-A//<Hn<B"H .S=@BG`.HA0pH@ARGino ]JmVg mPV mVg ?-HzrN.Hr2@A/- /- HzDBg/- .HH/?<|/- A/?<Nպ.N^NuRCHECKSr Checksum =  checksumming the output file!' preparing to checksum the output file! truncating the output file!JoNVHm?-"8Jmo ?-HzLNHm?-"4Jmo ?-HzNN^NuLOSEPHR8 closing the output file! compacting the output file!JoNVH/- /- Hz$Bg/- HzBg/- /- BBE=m|`* Fg A80HٮBg??X:RFino/.0-H/" rЁR=@ |R@=@0-"|r@=A0-R@|=@/- Hz,Bg/- 0.H/?<|/- /- HzBg/- p/?<|/- /- HzBg/- 0.H/?<|/- /- HzBg/- 0.H/?<|/- /- HzFBg/- 0.H/?<|/- /- pn2.|x@/Bg?.?<X0"Ar@>|, HdH@J@"@|d>/- HzBg/- /- HzZBg/- H/?<|/- <.?<x/- /- HzBg/- /- HzBg/- /- Jmo ml8/- Hz6Bg/- 0-H/?<|/- HzBg/- mo8/- HzBg/- 0-H/?<|/- HzBg/- m]m^g*/- <?<x/- Hz&Bg/- XLN^NuRMEASUR?You might want to increase the value(s) an re-run this program.) is less than recommended.Your value of cache bytes (Your value of cache size (> arguments to alerts, and extra space for expansion.L (NOTE: the sugested numbers take into account alerts used for printing,)The suggested value for 'cache bytes' is *The suggested value for 'cache size' is 3.Largest alert = Average alert = indexSize = cacheFactor = overhead = 0cacheFactor*cacheSize + indexSize + largestAlert%MINIMUM cacheSize value = overhead + JoNV;|BmBmBmBmLBmB-NDJmf/- HzBg/- `|N&NN@;|Jmo0-A;p mV-IAJAWgHztN m] mVg Hz"N` m"lHzNNJmoL/- HzBg/- N/- HzBg/- A/?<N8A/?<N*/- Hz^Bg/- NNN"NNT`HzNhN^NuAIN 2 There are no alerts in the file.writing alertswriting alert header writing menusAlert #2 must contain text.5You forgot to define alert #2 as the Swan Song alert.:You forgot to define alert #1 as the default non-GetAlert.LNo cache size/cache bytes in input file; assuming old file format (no menus)JoNV/- /- Hz,BgBg-_/- N^NuOOPTION64Do you want to list tokenized input to the console? "NV,_NU^"8;|XAC~ +|ok ;|?xACr 0ACz 0AC` 0ACZ ACV 0ACB AC0 0AC 0+|ask AC 0+|ok $A0C A file} IF Exists("X[ToolName].TEXT") THEN $SET GotXFile TO 'T' $RESET file,"X[ToolName].TEXT" ELSE $SET GotXFile TO 'F' ENDIF {Initialization} IF GotXFile = 'T' THEN $SET Ln TO <-#BOOT-TK/XRead $DEFAULT ToolNumber TO Ln $SET Ln TO <-#BOOT-TK/XRead $DEFAULT ToolVol TO Ln ENDIF SET ToolName TO UpperCase(ToolName) SET ToolNumber TO UpperCase(ToolNumber) IF ToolVol <> '' THEN $SET ToolVol TO "-[ToolVol]-" ELSE $RUN '-#BOOT-TK/WorkDir' $SET ToolVol TO RETSTR $CLEAR SCREEN ENDIF IF Force <> '' THEN $SET Force TO '3' ELSE $SET Force TO '1' ENDIF {Recompile phrase file if needed} IF ToolNumber <> '' THEN $SET temp TO 'T' $IF NOT (Exists("P[ToolName].TEXT") AND Exists("-#BOOT-TK/PABC.TEXT")) THEN (SET temp TO 'F' $ELSEIF Exists("[ToolVol]{T[ToolNumber]}PHRASE") THEN (IF (Newer("[ToolVol]{T[ToolNumber]}PHRASE","P[ToolName].TEXT")) AND +(Newer("[ToolVol]{T[ToolNumber]}PHRASE","-#BOOT-TK/PABC.TEXT")) THEN ,SET temp TO 'F' (ENDIF $ENDIF $IF temp = 'T' THEN (WRITELN "Need to generate [ToolVol]{T[ToolNumber]}PHRASE" ($R{}-#BOOT-TK/Alert ($P[ToolName] ($[ToolVol]~{T[ToolNumber]~} $ENDIF ENDIF {Assemble files as needed} IF GotXFile = 'T' THEN $REPEAT (SET Ln TO <-#BOOT-TK/XRead (IF Ln <> '$' THEN ,SET temp TO <-#BOOT-TK/UnitChanged([Ln],[Force]) ,IF temp <> '0' THEN {file exists -- needs to be linked in} 0WRITELN (CommBufr) Ln ,ENDIF ,IF temp >= '2' THEN 0WRITELN "Need to assemble [Ln].TEXT" 0$A{ssemble}[Ln] 0${No listing} 0$[Ln] ,ENDIF (ENDIF $UNTIL Ln = '$' ENDIF {Compile files as needed} SET LastOBJ TO '' IF GotXFile = 'T' THEN $REPEAT (SET Ln TO <-#BOOT-TK/XRead (IF Ln <> '$' THEN ,SET temp TO <-#BOOT-TK/UnitChanged([Ln],[Force],[LastOBJ]) ,IF temp <> '0' THEN 0WRITELN (CommBufr) Ln 0SET LastOBJ TO Ln ,ENDIF ,IF temp >= '2' THEN 0SET Force TO temp 0SUBMIT -#BOOT-TK/Comp([Ln],[Intrinsic]) ,ELSEIF (Force >= '2') AND (temp <> '0') THEN 0WRITELN "Need to change write date on [Ln].OBJ" 0$R{}-#BOOT-TK/NullChange 0$[Ln].OBJ ,ENDIF (ENDIF $UNTIL Ln = '$' ENDIF {Compile U as needed} SET temp TO <-#BOOT-TK/UnitChanged(U[ToolName],[Force],[LastOBJ]) IF temp <> '0' THEN $WRITELN (CommBufr) "U[ToolName]" $SET LastOBJ TO "U[ToolName]" ENDIF IF temp >= '2' THEN $SET Force TO temp $SUBMIT -#BOOT-TK/Comp(U[ToolName],[Intrinsic]) ELSEIF (Force >= '2') AND (temp <> '0') THEN $WRITELN "Need to change write date on U[ToolName].OBJ" $$R{}-#BOOT-TK/NullChange $$U[ToolName].OBJ ENDIF {Compile M as needed} SET temp TO <-#BOOT-TK/UnitChanged(M[ToolName],[Force],[LastObj]) IF temp <> '0' THEN $WRITELN (CommBufr) "M[ToolName]" $SET LastOBJ TO "M[ToolName]" ENDIF IF temp >= '2' THEN $SET Force TO temp $SUBMIT -#BOOT-TK/Comp(M[ToolName],[Intrinsic]) ELSEIF (Force >= '2') AND (temp <> '0') THEN $WRITELN "Need to change write date on M[ToolName].OBJ" $$R{}-#BOOT-TK/NullChange $$M[ToolName].OBJ ENDIF {Set temp to output file name} IF ToolNumber = '' THEN $SET temp TO "[ToolVol][ToolName].OBJ" ELSE $SET temp TO "[ToolVol]{T[ToolNumber]}OBJ" ENDIF {If output file does not exists or is earlier than last .OBJ file, we need to link} IF Exists("[temp]") THEN $IF Exists("[LastOBJ].OBJ") THEN (IF Newer("[LastOBJ].OBJ","[temp]") THEN ,SET Force TO '2' (ENDIF $ENDIF ENDIF IF NOT (Exists("[temp]")) OR (Force >= '2') THEN $$F{ile-Mgr}D{elete}[temp] $$Y{es}Q{uit} $WRITELN "Need to link [temp]" $$L{ink}? $$+W $$[Intrinsic] ${See if there are any options & get other files to link in} $IF GotXFile = 'T' THEN (REPEAT ,SET Ln TO <-#BOOT-TK/XRead ,IF COPY(Ln,1,1)='+' THEN 0$[Ln] -ELSEIF COPY(Ln,1,1)='=' THEN 0SET Ln TO CONCAT('-', COPY(Ln,2,Length(Ln)-1)) 0$[Ln] -ELSEIF Ln <> '$' THEN 0WRITELN (CommBufr) Ln ,ENDIF (UNTIL Ln = '$' $ENDIF $$ $$[TKLibPrefix]TKLIB $$[TKLibPrefix]TK2LIB $$[SysLibPrefix]SYS1LIB $$[SysLibPrefix]IOSPASLIB $RESET CommBufr,'TK Make' $REPEAT (READLN (CommBufr) Ln (IF Ln <> 'EOF' THEN ,$[Ln] (ENDIF $UNTIL Ln = 'EOF' $${No more files} $${No list file} $$[temp]. ELSE ${Did not link; still need to flush the linker input section} $IF GotXFile = 'T' THEN (REPEAT ,SET Ln TO <-#BOOT-TK/XRead (UNTIL Ln = '$' $ENDIF ENDIF {Install the tool; we always do this} IF Exists("[ToolVol]{!Catalog}") THEN $IF GotXFile = 'T' THEN (SET Ln TO <-#BOOT-TK/XRead (IF (Ln <> '$') AND (ToolNumber <> '') THEN ,WriteLn "Installing [ToolVol]{T[ToolNumber]}OBJ" ,$R{}InstallTool ,$Y{es, automatically overwrite} ,SET temp TO COPY(ToolVol,2,Length(ToolVol)-2) ,$[temp] ,$[ToolNumber] ,WHILE (Ln <> '$') DO 0$[Ln] 0SET Ln TO <-#BOOT-TK/XRead ,ENDWHILE (ENDIF $ENDIF ENDIF IF GotXFile = 'T' THEN $CLOSE file ENDIF CLOSE CommBufr,'TK Make' ENDEXEC DhPASLIB UCLASCAL/BLKIOINTfBLOCKIO gPASHEAP hB(.N<PASLIB1 PASIOLIB`SgPASinibMainProg ."NV,_NU"8A+H/- HzBg/- /- /- HzBg/-Hm?<p/-hHmHz`"gHmHmHm?:D"Jmo^/- pA?<x/- HzBg/- 0-H/?<|/- HzBg/- HmBg/- `Hm?-/-p/HmBgB"HJm^ Vg^/- pA?<x/- Hz^Bg/- 0-H/?<|/- HzZBg/- HmBg/- `Hm?-/-p/HmBgB"Jm^ VgZ/- pA?<x/- HzBg/- 0-H/?<|/- HzBg/- HmBg/- Hm?-"4JmoZ/- pA?<x/- HzdBg/- 0-H/?<|/- Hz8Bg/- HmBg/- "N]" NuN^NuULLCHAN closing NullChange: Error writing reading opening  File name? OThis program changes the time-of-write of a file without changing its contents.&3. "6F^9itD!$ǐ^WBmoaHEmenusen the doc^^lease of ing.^L^L 3. "6F^OK@640,26 ; phCancel = 143 143 Cancel@640,80 ; ALERTS 151-899 RESERVED FOR OTHER BUILDING BLOCKS ; ALERTS 900-999 RESERVED FOR THE ALERT MANAGER ;These alerts are used by the DTAlert routine of the alert manager. 901 ; singular/pl; PABC.TEXT Copyright 1983, 1984 by Apple Computer, Inc. ; ; 17-Apr-84: added phrases 44 & 45 ; 16-Apr-84: added heap scrambling commands ; 13-Apr-84: added phrase 43 ; 11-Apr-84: remove blank line before sign strings; fixup clipboard file/print menu ; 11Apr84: added phrases 132 and 41 & 42 ; ;This is the generic phrase file included by ToolKit application phrase files ;NOTE: The wording of the alerts may not conform to the standards of the ; first release applications ; ? WAIT STOP NOTE CAUTION Cancel OK 1 note alert Alert ^N has no matching entry in the phrase file.^L The last command was ^C. 2 stop alert ^0 is experiencing technical difficulties in accessing the disk that has the ^0 tool.^L^L It would probably be a good idea for you to Put Back your documents one at a time or to push the on-off button to save them all.^L^L If the problem recurs, refer to Appendix 1, Error Messages, in the ^0 manual. ; phWordDelimiters= 9; 9 xAx x9x x$x x%x x.9 x.% 9,9 A'A A-A AA AA A.A ; phTrouble = 10; {The tool is having trouble} 10 stop alert ^0 is experiencing technical difficulties. ; phUnknown = 11; {phrase(error) is undefined for this error} 11 stop alert ^0 has an unknown error. ; phNoText = 21; {font change or style changed command was done with no text selected} 21 stop alert You cannot do that because no text is selected. ; phNoSel = 22; {the application could not do the command & there was no selection} ; PROCEDURE {TSelection.}CantDoIt ; PROCEDURE {TSelection.}DoCutCopy ; PROCEDURE {TSelection.}DoKey ; PROCEDURE {TWindow.}NewStdCommand 22 stop alert You cannot do that because nothing is selected. ; phNoInsPt = 23; 23 stop alert You cannot do that because there is no insertion point. ; PROCEDURE {TDocument.}RevertVersion ; phRevert = 24; 24 caution cancel alert Do you want to revert to the version saved ^1? ; phRevBlank = 25; 25 caution cancel alert Do you want to revert to a blank document? ; phUnkCmd = 26; {the application could not handle a particular menu command} ; PROCEDURE {TSelection.}NewCommand 26 stop alert ^0 cannot do "^1" ; phSelCant = 27; {same as 22, except there was a selection} ; PROCEDURE {TSelection.}CantDoIt 27 stop alert You cannot do that to this kind of selection. ; phUnchanged = 28; {used in both save & continue and revert to previous version} 28 note alert The document has not changed since you last saved it. ; phSaving = 29; 29 wait alert ^0 is saving the new version of your document.^L^L To terminate the operation, hold down the Apple key while you type a period. ; phTerminated = 30; 30 stop alert ^0 terminated the operation because you typed Apple-period. ; phEditClip = 31; ; PROCEDURE {TSelection.}DoKey ; FUNCTION {TPanel.}downAt 31 stop alert You cannot edit on the Clipboard. ; phNoClip = 32; 32 stop alert There is nothing on the Clipboard to Paste. ; phUnkClip = 33; {the application could not understand what was on the clipboard} 33 stop alert ^0 cannot Paste what is on the Clipboard. ; phDialogUp = 34; ; FUNCTION {TPanel.}DownAt 34 stop alert You must dismiss the Dialog Box before you can change the selection. ; phCantUndo = 35; ; PROCEDURE {TWindow.}UndoLast; 35 stop alert ^0 cannot undo "^K" ; phNoCommand = 36; ; PROCEDURE {TWindow.}UndoLast; 36 stop alert ^0 cannot undo the last change because there have been no changes. ; phOlderVersion = 37; ; PROCEDURE {TDocManager.}Assimilate 37 caution ok alert The document you are opening was last worked on using a release of ^0 that lacked some features of the present release.^L^L If you click OK, ^0 will update the document to work with the present release.^L^L If you click Cancel, ^0 will not open the document. ; phNewerVersion = 38; ; PROCEDURE {TDocManager.}Assimilate 38 caution insist alert The document you are opening was last worked on using a release of ^0 that had some features the present release does not have.^L^L If you click OK, ^0 will remove from the document anything that required the extra capabilities; if you open the document later using that other release of ^0, some information will probably be missing.^L^L If you click Cancel, ^0 will not open the document; if you open it later using that other release of ^0, nothing will be missing. ; phConverting = 39; ; PROCEDURE {TDocManager.}Assimilate 39 wait alert ^0 is converting the document to work with the present release of the tool. ; phAborting = 40; 40 wait alert ^0 is terminating the current operation because you typed Apple-period. ; phPage = 41; {the keyword used to insert the page # in a heading} 41 PAGE ; phTitle = 42; {the keyword used to insert the window title in a heading} 42 TITLE ; phCantSave = 43; 43 stop alert ^0 is having technical difficulties saving the document.^L^L Try creating more space on the disk containing the document. ; phCantRevert = 44; 44 stop alert ^0 is having technical difficulties reading the previous version of your document.^L^L The document may be damaged or there might not be enough disk space to open the document. ; phCountry = 45; {the country code of the tool} 45 1 ; ALERTS 101-150 RESERVED FOR DIALOG BUILDING BLOCK ; phTooManyChars = 101 101 stop soft;soft;alert Only ^1 characters can be accepted here. ; phOddEven = 102; 102 Odd/Even@56,6 ; phOddOnly = 103; 103 Odd Pages Only@56,6 ; phEvenOnly = 104; 104 Even Pages Only ; phOddOrEven = 105; 105 Odd or Even ; phMinPage = 106 106 Min Page:@70,32 ; phMaxPage = 107 107 Max Page:@270,32 ; phPageAlignment = 108; NOT CURRENTLY USED--PROBABLY DELETE SOON 108 Page Alignment@56,57 ; phAlignment = 109; 109 Alignment:@56,100 ; phTopLeft = 110; 110 Top Left@56,68 ; phTopCenter = 111; 111 Top Center ; phTopRight = 112; 112 Top Right ; phBotLeft = 113; 113 Bottom Left@56,85 ; phBotCenter = 114; 114 Bottom Center ; phBotRight = 115; 115 Bottom Right ; phLaunchHeading = 116; 116 Launch New Heading@240,40 ; phPageMargins = 117; 117 Page Margins@6,116 ; phUnits = 118; 118 Units@200,122 ; phInches = 119; 119 inches@200,110 ; phCentimeters = 120; 120 centimeters@0,0 ; phLeft = 121; 121 left@20,156 ; phLeftCluster = 122; 122 leftCluster@ 100,146 ; phTop = 123; 123 top@20,174 ; phTopCluster = 124; 124 topCluster@ 100,166 ; phRight = 125; 125 right@20,194 ; phRightCluster = 126; 126 rightCluster@100,186 ; phBottom = 127; 127 bottom@20,214 ; phBottomCluster = 128; 128 bottomCluster@100,206 ; phInstallMargins = 129; 129 Install Margins@560,176 ; phInchTitle = 130; 130 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50@96, 140 ; phCmTitle = 131; 131 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0@96,140 ; phNewHeading = 132; 132 ---New Heading--- ; phOK = 142 142 OK@640,26 ; phCancel = 143 143 Cancel@640,80 ; ALERTS 151-899 RESERVED FOR OTHER BUILDING BLOCKS ; ALERTS 900-999 RESERVED FOR THE ALERT MANAGER ;These alerts are used by the DTAlert routine of the alert manager. 901 ; singular/plural for string before "12 hours ago" / 902 ; singular/plural for seconds second/seconds 903 ; singular/plural for minutes minute/minutes 904 ; singular/plural for hours hour/hours 905 ; singular/plural for days day/days 906 ; singular/plural for weeks week/weeks 907 ; singular/plural for years year/years 908 ; singular/plural for trailing text of "12 hours ago" ago 909 ;whole string in case of error some time ago $~File/Print File/Print Set Aside Everything#101 Set Aside#102 - Save & Put Away#103 Save & Continue#107 Revert to Previous Version#108 - Print As Is#111 Format for Printer ...#104 Print ...#105 Monitor the Printer ...#106 ; $~Edit Edit Undo Last Change#205 - Cut/X#202 Copy/C#201 Paste/V#203 ; $~Page Layout Page Layout Preview Actual Pages#401 Preview Page Breaks#402 Don't Preview Pages#403 - Headings and Margins...#405 - Set Horizontal Page Break#411 Set Vertical Page Break#412 Clear All Manual Breaks#413 - Number Pages Left-To-Right#422 Number Pages Top-To-Bottom#421 - Add page strip to the right#431 Add page strip at the bottom#432 - Show Full Size#406 Reduce to 70%#407 Reduce to Fit#408 ; $~Debug Debug Report Every Event#501 - Check & Count Heaps after Commands#506 Check List Indices#509 - Dump Process Globals#510 Dump Active Document Prelude#511 - Enable Experimental Features#512 - Report Garbage in Document Heap#513 Free Garbage in Document Heap#514 - Scramble Main Heap#515 Scramble Document Heap#516 - Edit Dialog#521 Stop Editing Dialog#522 ; $~Buzzwords Buzzwords Set Aside ^Document^#109 Undo ^Last Change^#206 Redo ^Last Change^#207 Typing#150 Move Box#702 Create New Heading#703 Set Margins#704 Some Command#156 ; $~Clipboard File/Print File/Print Set Aside Everything#101 Set Aside Clipboard#110 - Format for Printer ...#104 Print...#105 Print As Is#111 Monitor the Printer ...#106 ; 3. "6F^9D!$ǐ^lӜ>"pĦ401&]4*42nn*RC>Fn TDAAFnFD<4EXEC(name,prevresult,lastobj,ctr,done) {assumes object file is name.OBJ; Lsource files are name.TEXT, name2.TEXT, ... (lastobj is the name of the previous .OBJ file (prevresult can be the result given by a previous call to UnitChanged (default is '0') (returns '0' if name is null OR name.TEXT does not exist (returns '3' if prevresult is '3' OR object filename doesn't exist OR interface changed OR 8lastobj.OBJ is newer than name.OBJ (returns '2' any implementation file has changed (otherwise '1' } DEFAULT prevresult TO '0' IF name = '' THEN $RETURN '0' ENDIF IF NOT (Exists("[name].TEXT")) THEN $RETURN '0' ENDIF IF prevresult = '3' THEN $RETURN '3' ENDIF IF NOT (Exists("[name].OBJ")) THEN $RETURN '3' ENDIF IF lastobj <> '' THEN $IF Exists("[lastobj].OBJ") THEN (IF Newer("[lastobj].OBJ","[name].OBJ") THEN ,RETURN '3' (ENDIF $ENDIF ENDIF IF Newer("[name].TEXT","[name].OBJ") THEN $RETURN '3' ENDIF SET ctr TO '2' SET done TO 'F' WHILE done = 'F' DO $IF NOT (Exists("[name][ctr].TEXT")) THEN (SET done TO 'T' $ENDIF $IF done = 'F' THEN (IF Newer("[name][ctr].TEXT","[name].OBJ") THEN ,RETURN '2' (ENDIF $ENDIF $SET ctr TO Eval(ctr + 1) ENDWHILE RETURN '1' ENDEXEC t hPASLIB UCLASCAL/IOPRIMIT8SHELLCOM9PROGCOMM:STDUNIT XBLKIOINTfBLOCKIO gPASHEAP hB(JxNNPASLIB1 PASIOLIB`SgPASinibSULib cMainProg x"NV,_NU"8@HmHm"Jmn(HmHz"NPASLIB1 LWWORK OTHRWORKACTIVATEOPENSEG1INcold NEVER alert WMcold SMcold SUcold "SCROLL &UT 3SYSINIT APMMSeg CWORKSET DGRAFSEG EFEcutCopFFEcold GSBcold HOPENSEG2IMOVERS KALRTDIALNOPEN1LW OPASIOLIB`SgPASinibMainProg X"JoNV n CJ"" nCJp@"S@nHzHnHzHn?<" ACp@ S@n?<?<HnHnBgBgBgA?<"/0.n2.@TA?(Hn?.0.Z@?Hn mHh?.0.nR@?A?<"/PBgN^ _PONRAWLABE JoNV nCJ""Ar/Hn?NHmHz@NHmHz,NHmHzNLN^.NuNITSHOWGhostHiliteRegJoNV;|;|,p0@|;@;|LA/0-m?0-m?H?-?-BgBgN^.NuNITFONTJoNV;| B-HmBgBg?<0?< (Ar/ mHh䠊0 m hHh/NV/N/N/NR/N(Ar/|{A6/HztAV/Hz$Hmv?<?< N^NuNITIALI@00F000F801F801F003F003E007E007C00FC00F801F801F001E00000000000000@00F0008801080190027002200420044008400880108011001E001C0018001000JoNVJnm$ nn?.HnNXHn?<?<PN^ _TONIGHLIGHJoNV/=| -{H>`6?HnNBg/.Hn\g=G ?N~~`RG G}o`RG Go.N^.NuENUITEMJoNV?<?<4 mHh00.A|AHp mHh젊0N^ _TONLEARLARJoNVHn0.A|CA/?< (Hm?<(JnfH=| 0.|T@=@=|0.V@|T@=@Hn?.?< ?<Bg/.N^ _TONLEARSMAJoNV/~`?NRG GoBG`?N2RG Go.N^NuRAWWINDJoNVH(mHnAr/=| 0.|=@=| 0.|=@HmHmHnHnBgBHmHlHmHlHmHlHmHl䠊HmHl䠊HmHl䠊BG`HmtHmtHmO tAHp?<BHmtHmtHmO tAHp?<BHmtHmtHmO tAHp?<BHmtHmtHmO tAHp?<BRG GoXHmtHmtHmHmBgBHl䠊0?<(HmHl젊0HmtHmtHmHm?<Bp =@pn=@p=@pn=@Gz0+D@?0D@??<?<4HlԠ0?< (Hnꠊ?.p ?p?BgHl젊0BgBg/.LN^NuPDATE JoNVH(mHnBG`BF`O M"AAHvBgBg?<?<(O M"AAHv?.?. O tM"|AC&A/JGf"O M"AAHvHl` O M"AAHvHl䠊RF FoBRG Go2BG`HmO tA(HpO HvO Hv?<BHmO tA(HpO HvO Hv?<BHmO tAHpO HvO Hv?<BHmO tAHpO HvO Hv?<BRG GoHmHm HnHnBgBA/Hl䠊0?<(HnؠHl젊0HmHmHnHn?<B/.LN^ _PONOGGLESHJoNVH>. HnO |CA/O |2. ApH=AO |2.ApH=ABg?.?. Gf* n \ n$] n \ n]D?-(?.?.?.?. GWg*A/?-(?.?.?.?.?<(/.Hn栊?<?<4?-( GW" g@BA/Bg?.?.g mgz/.g mHhԠ0O |2.AAp?O |2.AAp?O |2.AAp?O |2.AAp?Hn栊/./N m fg;| `;|<NLN^ _\ONOGGLEBIJoNVBgBg. HnT_.g~ n0.HH@J@ @\D.@rC@W .Wg=|`*.@rC@W .Wg=|`Bn/.?.?. `/.N:Bn nBN^ _ NETNEXTEJoNV/- Hz*Bg/- "0N^ _\ONEAPFULL64 The heap is full. The program must now terminate! JoNVH0.S@=@BG`x n O0pH2AC n/X _/.,<JFgJGfPBgN2HnxA/?<N>HnxA/?<N,HnxA/?< NHnxA/?< N`(<N~`0S@A @ABpRG GoHnpBgBg0-m?0-m?(0.vH=@nA-Hj?</Nh?</N^N.N^.NuONTRESTJo\NV\H nCJp@"S@nHnHn?<@<JFf^=|0=| p@nAPPBn=|Bn0.D@=@=n=n0-mH=@0.| =@BnBnBG`* O"AA~1O @At1RG Go=||Hn^BgBg0-m?0-m?(0.dH=@jAlC^ A-HfHmHnfHn^Hn^BgBHnA/?<N`HnA/?<NNHnA~/?< NJGnHnLHmHzHnH?<" HnH?<@Hn gDHnX _H2ACHnH0@AHnLX _HnL,`HnL?<HnBg` Gfz/- HmBg/- HzBg/-HnH?<p/-hHnHHz"g4pAH0A AnWrAH0B BNWg"0`./- Hz:Bg/- H/?<|/- "0LN^NuETTOOLNError opening input file = A does not exist. Do you want to create a new file? (Y or N) [Y] .BACKUPICON}{T Enter tool number or file name: JoNVBg/. /.hg|`@0.H2. H@W2. H4.H…AWg|`B.N^ _PONIMILARPJoNVHmtHmtHmHmBgBHmtHmtHmHmBgBNV<N,N^NuOPYDATA"NV,_NU"8Hm2Hm2"Hm2Hm"HzHmHm?<" ACp S@n0Hm2Hm"A/A/A/NhHm2Hm2"NNNtA?<"/NA?<"/NHmHzHmHzHm?<" A?<"/NHm?[aBar,aScroll,aSplit], [aBar,aScroll,aSplit]); A{initialize the boxView} 'boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); 'boxView.InitBoxList(SELF.Heap); '{$IFC fTrace} EP; {$ENDC} $END; END; 3. "6F^9exD!$ǐ^&vg0Hl?,</,Hk" Jf9|:` +`JloBg?,/.N`gB. ` l:fJ/,A/BgHzv/,HzHnHz~Hn?<" Hn?,N@ n/(N`2BgHz:/,RBddRRSTXTX1-CI"jLxx1-CISTAR:ÆdSTART.TEXTHzTRàØZN:øOpOpXX0T; PBOXER.TEXT for Boxer ;Phrase file for Boxer class example 1 3 2500 $-#boot-tk/PABC ; Apple building block phrase files can be included here 1000 Boxer ; Other application alerts can be included here, numbered between 1001 and 32000 0 1 File/Print Set Aside Everything#101 Set Aside#102 - Save & Put Away#103 Save & Continue#107 Revert to Previous Version#108 - Format for Printer ...#104 Print ...#105 Monitor the Printer ...#106 100 Buzzwords Set Aside ^Document^#109 0 3. "6F^9D!$ǐ^  li3. "6F^9erD!$ǐ^42 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum2 G5[TK3̆V{t|̆^G :a$kTk:)$ "#." #"##%& ! 3. "6F^5D!$ǐ^  ttPROGRAM M3Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U3Boxer } U3Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9D!$ǐ^Yl:l:Jc3. "6F^9exD!$ǐ^UNIT U3Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; $boxSelectionKind = 1; TYPE $TColor = colorWhite..colorBlack; {color of a box} "{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; (PROCEDURE TBox.PaintHandles; &{Display} (PROCEDURE TBox.Draw; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; (FUNCTION {TBoxView.}BoxWith(LPt: LPoint): TBox; (PROCEDURE TBoxView. Draw; OVERRIDE; (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView. NoSelection: TSelection; OVERRIDE; (PROCEDURE TBoxView.MousePress(mouseLPt: LPoint);OVERRIDE; (END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsKind: INTEGER; GitsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection. Highlight(highTransit: THighTransit); OVERRIDE; %END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION {TBoxProcess.}CREATE: TBoxProcess; (FUNCTION TBoxProcess. NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) M: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager. NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE TBoxWindow. BlankStationery; OVERRIDE; (END; IMPLEMENTATION "{$I U3Boxer2.text} END. 3. "6F^9; D!$ǐ^cceJe; Split], [aScroll, aSplit]); lighting} } 3. "6F^(panel: TPanel; (boxView: TBoxView; (aSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLR{U3BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; {This draws a particular box} $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; ${This calls the DoToHandle Procedure once for each handle LRect; user of this method must &set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SetLRect(hLRect, -3, -2, 3, 2); (shapeLRect := SELF.shapeLRect; (WITH shapeLRect DO ,BEGIN ,dh := right - left; ,dv := bottom - top; ,MoveHandleAndPaint(left, top); {draw top left handle} ,END; (MoveHandleAndPaint(dh, 0); {then top right} (MoveHandleAndPaint(0, dv); {then bottom right} (MoveHandleAndPaint(-dh, 0); {finally bottom left} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; {This returns the box containing a certain point} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0boxWith := box; ({$IFC fTrace}EP;{$ENDC} $END; {This draws the list of boxes} $PROCEDURE TBoxView.Draw; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,box.Draw; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR box: TBox; )boxList: TList; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; A{create and append the first box} (box := TBox.CREATE(NIL, itsHeap); "{$H-} SetLRect(box.shapeLRect, 20,20, 100, 100); {$H+} (SELF.boxList.InsLast(box); A{create and append the second box} (box := TBox.CREATE(NIL, itsHeap); "{$H-} SetLRect(box.shapeLRect, 200, 100, 300, 130); {$H+} (SELF.boxList.InsLast(box); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; #{This PROCEDURE makes a new selection, when the user presses the mouse button} #{This procedure illustrates the "standard" way of creating a new selection} $PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); $VAR newSelection: TSelection; (panel: TPanel; (box: TBox; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (panel := SELF.panel; (panel.Highlight(self.panel.selection, hOntoOff); {Turn off the old highlighting} (newSelection := self.panel.selection.FreedAndReplacedBy(TBoxSelection.CREATE(NIL,SELF.heap, SELF, vboxSelectionKind, vmouseLPt)); (self.panel.selection := newSelection; (newSelection.currLPt := mouseLPt; (box := self.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,newSelection.kind := nothingKind (ELSE ,newSelection.kind := boxSelectionKind; (TBoxSelection(newSelection).box := box; (panel.Highlight(newSelection, hOffToOn); {Turn on the highlighting for the newly selected box} (self.panel.selection.MarkChanged; {Allow the document to be saved so that any changes made} L{can become permanent} '{$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsKind: INTEGER; DitsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := NIL; ({$IFC fTrace}EP;{$ENDC} $END; #{This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,box := SELF.box; ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9D!$ǐ^&}3. "6F^5D!$ǐ^; PBOXER.TEXT for Boxer ;Phrase file for Boxer class example 1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 Boxer ; Other application alerts can be included here, numbered between 1001 and 32000 0 1 $-#BOOT-TK/PABC~File/Print 2 Page Layout Preview Actual Pages#401 Preview Page Breaks#402 Don't Preview Pages#403 100 Buzzwords Set Aside ^Document^#109 0 3. "6F^9NuD!$ǐ^&x3. "6F^43 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum3 3. "6F^5D!$ǐ^  tcPROGRAM M4Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U4Boxer } U4Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9; D!$ǐ^VjjeK}; Split], [aScroll, aSplit]); }; }; } )_BHz,)_Bg l/9_)D9|P9|B,B,B,B,|||B,B,B, m(A-H'n/+Bg(nBV$FUNCTION {TBoxDocManager.}CREATE{(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager}; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDUNIT U4Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; $boxSelectionKind = 1; TYPE $TColor = colorWhite..colorBlack; {color of a box} "{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; (PROCEDURE TBox.PaintHandles; (PROCEDURE TBox.Draw; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; 'FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; (PROCEDURE TBoxView.Draw; OVERRIDE; (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView.NoSelection: TSelection; OVERRIDE; 'END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsKind: INTEGER; GitsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); OVERRIDE; &{Selection - per pad} (PROCEDURE TBoxSelection.MousePress(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; $END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Variables} &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE TBoxWindow.BlankStationery; OVERRIDE; (END; IMPLEMENTATION "{$I U4Boxer2.text} END. 3. "6F^9; D!$ǐ^+c+ceK; Split], [aScroll, aSplit]); ; ate } 3. "6F^$FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocMa{U4BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{This draws a particular box} $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; ${This calls the DoToHandle Procedure once for each handle LRect; user of this method must %set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SetLRect(hLRect, -3, -2, 3, 2); (shapeLRect := SELF.shapeLRect; (WITH shapeLRect DO ,BEGIN ,dh := right - left; ,dv := bottom - top; ,MoveHandleAndPaint(left, top); {draw top left handle} ,END; (MoveHandleAndPaint(dh, 0); {then top right} (MoveHandleAndPaint(0, dv); {then bottom right} (MoveHandleAndPaint(-dh, 0); {finally bottom left} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; #{This returns the box containing a certain point} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0boxWith := box; ({$IFC fTrace}EP;{$ENDC} $END; "{This draws the list of boxes} $PROCEDURE TBoxView.Draw; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,box.Draw; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR box: TBox; )boxList: TList; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; A{create and append the first box} (box := TBox.CREATE(NIL, itsHeap); "{$H-} SetLRect(box.shapeLRect, 20,20, 100, 100); {$H+} (SELF.boxList.InsLast(box); A{create and append the second box} (box := TBox.CREATE(NIL, itsHeap); "{$H-} SetLRect(box.shapeLRect, 200, 100, 300, 130); {$H+} (SELF.boxList.InsLast(box); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsKind: INTEGER; DitsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := NIL; ({$IFC fTrace}EP;{$ENDC} $END; ${This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,SELF.box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{This is another way to make a new selection, when the user presses the mouse button} #{Just keep the old selection object and replace its data fields with new values. This isn't the} #{standard paradigm for creating new selection objects, but it certainly works (at least in this case).} $PROCEDURE TBoxSelection.MousePress(mouseLPt: LPoint); $VAR boxView: TBoxView; (aSelection: TSelection; (panel: TPanel; (box: TBox; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (WITH SELF DO ,BEGIN ,anchorLPt := mouseLPt; ,currLPt := mouseLPt; ,END; (boxView := TBoxView(SELF.view); (panel := SELF.panel; (panel.Highlight(SELF, hOntoOff); {Turn off the old highlighting} (box := boxView.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,SELF.kind := nothingKind (ELSE ,SELF.kind := boxSelectionKind; (SELF.box := box; (panel.Highlight(SELF, hOffToOn); {Turn on the highlighting for the newly selected box} (self.MarkChanged; {Allow the document to be saved so that any changes made can become permanent} '{$IFC fTrace}EP;{$ENDC} $END; #{This is called when the user moves the mouse after pressing the button} $PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); $VAR diffLPt: LPoint; (shapeLRect: LRect; (PROCEDURE InvalTheBox(invalRect: LRect); (BEGIN ({$IFC fTrace}BP(11);{$ENDC} ,InsetLRect(invalRect, -3,-2); {need to expand the invalidation rectangle to invalidate } ,SELF.panel.InvalLRect(invalRect); {highlighting as well as box} ({$IFC fTrace}EP;{$ENDC} (END; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN 4{How far did mouse move?} ,LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); 4{Move it if delta is nonzero} ,IF NOT EqualLPt(diffLPt, zeroLPt) THEN 0BEGIN 0SELF.currLPt := mouseLPt; 0shapeLRect := SELF.box.shapeLRect; 4{Compute old and new positions of box} 0InvalTheBox(shapeLRect); 0OffsetLRect(shapeLRect, diffLPt.h, diffLPt.v); 0InvalTheBox(shapeLRect); 0SELF.box.shapeLRect := shapeLRect; 0END -END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9 AD!$ǐ^t&}01 and 32000 3. "6F^; PBOXER.TEXT for Boxer ;Phrase file for Boxer class example 1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 Boxer ; Other application alerts can be included here, numbered between 1001 and 32000 0 1 $-#BOOT-TK/PABC~File/Print 2 Page Layout Preview Actual Pages#401 Preview Page Breaks#402 Don't Preview Pages#403 100 Buzzwords Set Aside ^Document^#109 0 3. "6F^9NuD!$ǐ^tz01 and 32000 ocument. release of ing.^L^L ert routine of the alert manager. 901 ; singular/plural for string before "12 hours ago" / 902 ; singular/plural for seconds second/seconds 90323 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum4 3. "6F^5D!$ǐ^  t0PROGRAM M5Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U5Boxer } U5Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9; D!$ǐ^h~Q~XeK; aSplit], [aScroll, aSplit]); tion g} $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.viewUNIT U5Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; $boxSelectionKind = 1; $createBoxSelectionKind = 2; TYPE $TColor = colorWhite..colorBlack; {color of a box} "{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; &{ Highlighting support } (PROCEDURE TBox.PaintHandles; &{ Framing while creating } (PROCEDURE TBox.DrawFrame; &{Display} (PROCEDURE TBox.Draw; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; (FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; (PROCEDURE TBoxView.InvalBox(invalLRect: LRect); (PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); OVERRIDE; &{Display} (PROCEDURE TBoxView.Draw; OVERRIDE; (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView.NoSelection: TSelection; OVERRIDE; 'END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; GitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); OVERRIDE; &{Selection - per pad} (PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; $END; $TCreateBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; OitsAnchorLPt: LPoint): TCreateBoxSelection; &{Selection - per pad} (PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TCreateBoxSelection.MouseRelease; OVERRIDE; $END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE TBoxWindow.BlankStationery; OVERRIDE; (END; IMPLEMENTATION "{$I U5Boxer2.text} END. 3. "6F^9; D!$ǐ^lcceK; aSplit], [aScroll, aSplit]); tion g} $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view{U5BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{ Draw this box } $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{ Frame a particular box} $PROCEDURE TBox.DrawFrame; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; 3{frame with reversible ink} (PenMode(PatXOr); (FrameLRect(SELF.shapeLRect); ({$IFC fTrace}EP;{$ENDC} $END; ${This procedure paints the handle rectangles for highlighting; user of this method must %set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SetLRect(hLRect, -3, -2, 3, 2); (shapeLRect := SELF.shapeLRect; (WITH shapeLRect DO ,BEGIN ,dh := right - left; ,dv := bottom - top; ,MoveHandleAndPaint(left, top); {draw top left handle} ,END; (MoveHandleAndPaint(dh, 0); {then top right} (MoveHandleAndPaint(0, dv); {then bottom right} (MoveHandleAndPaint(-dh, 0); {finally bottom left} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); )SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; #{This returns the box containing a certain point or NIL if point is not within a box} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0boxWith := box; ({$IFC fTrace}EP;{$ENDC} $END; {This draws the list of boxes} $PROCEDURE TBoxView.Draw; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,box.Draw; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InvalBox(invalLRect: LRect); $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (InsetLRect(invalLRect, -3, -2); (SELF.panel.InvalLRect(invalLRect); ({$IFC fTrace}EP;{$ENDC} $END; &{This determines which type of selection to create} %PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); %VAR aSelection: TSelection; )panel: TPanel; )box: TBox; %BEGIN ({$IFC fTrace}BP(11);{$ENDC} (panel := SELF.panel; (panel.Highlight(panel.selection, hOntoOff); {Turn off the old highlighting} (box := SELF.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,{Create an instance of TCreateBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( PTCreateBoxSelection.CREATE(NIL, SELF.heap, SELF, mouseLPt)) (ELSE ,{Create an instance of TBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( >TBoxSelection.CREATE(NIL, SELF.heap, SELF, box, boxSelectionKind, mouseLPt)); (panel.Highlight(panel.selection, hOffToOn); {Turn on the highlighting for the newly selected box} (self.panel.selection.MarkChanged; {Allow the document to be saved so that any changes made} L{can become permanent} ({$IFC fTrace}EP;{$ENDC} %END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR boxList: TList; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, NIL, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; DitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; #{This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,SELF.box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{This is called when the user moves the mouse after pressing the button} $PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); $VAR diffLPt: LPoint; (boxView: TBoxView; (shapeLRect: LRect; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); +{How far did mouse move?} (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); +{Move it if delta is nonzero} (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,shapeLRect := SELF.box.shapeLRect; 1{Compute old and new positions of box} ,boxView.InvalBox(shapeLRect); {invalidate old box (causes it to be erased)} ,OffsetLRect(shapeLRect, diffLPt.h, diffLPt.v); ,boxView.InvalBox(shapeLRect); {invalidate new box (causes it to be drawn)} ,SELF.box.shapeLRect := shapeLRect; ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TCreateBoxSelection; $FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; LitsAnchorLPt: LPoint): TCreateBoxSelection; $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TCreateBoxSelection(TSelection.CREATE(object, itsHeap, itsView, createBoxSelectionKind, SitsAnchorLPt)); (box := TBox.CREATE(NIL, SELF.heap); (SELF.box := box; ({$IFC fTrace}EP;{$ENDC} $END; #{This is called when the user moves the mouse after pressing the button} $PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (box := SELF.box; ({ In Boxer it is possible to draw a box greater than allowed by a 16 bit rectangle. These three *lines force the rectangle to within 16 bits. } "{$H-} WITH SELF.anchorLPt DO ,SetLRect(maxBoxLRect, h+10-MAXINT, v+10-MAXINT, h+MAXINT-10, v+MAXINT-10); "{$H+} LRectHaveLPt(maxBoxLRect, mouseLPt); (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,WITH box DO 0BEGIN 0shapeLRect.topLeft := SELF.anchorLPt; 0shapeLRect.botRight := mouseLPt; 0END; ${$H-} RectifyLRect(box.shapeLRect); {$H+} ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateBoxSelection.MouseRelease; $VAR thisBox: TBox; (boxView: TBoxView; (drawnLRect: LRect; (aSelection: TSelection; (panel: TPanel; (PROCEDURE DrawTheFrame; (BEGIN ,thisBox.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (panel := boxView.panel; (thisBox := SELF.box; (panel.OnAllPadsDo(DrawTheFrame); (drawnLRect := thisBox.shapeLRect; ({ Independant of whether we threw the box away or not we must create an instance of TBoxSelection *to replace the now useless instance of TCreateBoxSelection using the kind set above. } (aSelection := SELF.FreedAndReplaceby( 8TBoxSelection.CREATE(NIL, SELF.heap, boxView, thisBox, boxSelectionKind, MdrawnLRect.topleft)); (boxView.InvalBox(drawnLRect); ({If the box is not big enough then throw it away, otherwise put it in the list} (IF (drawnLRect.right - drawnLRect.left <=4) OR (drawnLRect.bottom - drawnLRect.top <=4) THEN ,BEGIN ,aSelection.kind := nothingKind; ,thisBox.Free; ,END (ELSE ,boxView.boxList.InsLast(thisBox); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} )panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9 AD!$ǐ^t&}01 and 32000 3. "6F^; PBOXER.TEXT for Boxer ;Phrase file for Boxer class example 1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 5Boxer ; Other application alerts can be included here, numbered between 1001 and 32000 0 1 $-#BOOT-TK/PABC~File/Print 2 Page Layout Preview Actual Pages#401 Preview Page Breaks#402 Don't Preview Pages#403 100 Buzzwords Set Aside ^Document^#109 0 3. "6F^9exD!$ǐ^  pp"S@n2HnHzb"gACH 0HzHnHzHnHz6HnHz Hn?<" HnBgHnNvACp@ S@nHnHz"gpA0AmTf`R`pA0A A PJdd P P:XC"jLxxC zBÆdzz 0A:CTRàØZNBøOpOpXX0T24 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum5 3. "6F^5$D!$ǐ^ wH8PROGRAM M6Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U6Boxer } U6Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9: D!$ǐ^:PB): TRecolorCmd; (PROCEDURE {TRecolorCmd.} Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; '{ This command duplicates the selected box and is undoable } $TDuplicateCmd = SUBCLASS OF TCommand (oldBox, newBox: TBox; &{Creation} (FUNCTION {TDuplicateCmd.}CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; JitsView: TboxView; itsBox: TBox): TDuplicateCmd; &{Command Execution} (PROCEDURE {TDuplicateCmd.{$P} ${This segment of Boxer implements commands with undo} ${Copyright 1983, Apple Computer Inc.} UNIT U6Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; #{ selection kinds } $boxSelectionKind = 1; $createBoxSelectionKind = 2; #{ Menus } $uWhite = 1006; $uLtGray = 1007; $uGray = 1008; $uDkGray = 1009; $uBlack = 1010; $uDuplicate = 1011; $uClearAll = 1012; #{ Phrases } $cantUndo = 1001; TYPE $TColor = colorWhite..colorBlack; {color of a box} "{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; &{ Highlighting support } (PROCEDURE TBox.PaintHandles; &{ Framing while creating } (PROCEDURE TBox.DrawFrame; &{Display} (PROCEDURE TBox.Draw; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; (FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; &{Invalidation} (PROCEDURE TBoxView.InvalBox(invalLRect: LRect); (PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); OVERRIDE; &{Display} (PROCEDURE TBoxView.Draw; OVERRIDE; &{Initialization} (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView.NoSelection: TSelection; OVERRIDE; 'END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; GitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); OVERRIDE; &{Selection - per pad} (PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TBoxSelection.MouseRelease; OVERRIDE; &{Command Dispatch} (FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxSelection.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN) O: BOOLEAN; OVERRIDE; $END; $TCreateBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; OitsAnchorLPt: LPoint): TCreateBoxSelection; &{Selection - per pad} (PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TCreateBoxSelection.MouseRelease; OVERRIDE; $END; '{ This command recolors the selected box and is not undoable} $TRecolorCmd = SUBCLASS OF TCommand (Box: TBox; (color: TColor; &{Creation} (FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; (PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; '{ This command duplicates the selected box and is undoable } $TDuplicateCmd = SUBCLASS OF TCommand (oldBox, newBox: TBox; &{Creation} (FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; JitsView: TboxView; itsBox: TBox): TDuplicateCmd; &{Command Execution} (PROCEDURE TDuplicateCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE {TBoxWindow.} BlankStationery; OVERRIDE; &{Commands} (PROCEDURE TBoxWindow.ClearAll; (FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; OVERRIDE; (END; IMPLEMENTATION "{$I U6Boxer2.text} END. 3. "6F^9; D!$ǐ^\\mPeckIt); OLEAN): TCommand; view, ---} on rform(cmdPhase: TCmdPhase); OVERRIDE; (END; '{ This command duplicates the selected box and is undoable } $TDuplicateCmd = SUBCLASS OF TComma({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.{U6BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{$IFC fDebugMethods} $PROCEDURE TBox.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (Field('shapeLRect: LRect'); (Field('color: INTEGER'); (Field(''); $END; ${$ENDC} %{This draws a particular box} $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; %{ Frame a particular box} $PROCEDURE TBox.DrawFrame; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (PenMode(PatXOr); (FrameLRect(SELF.shapeLRect); ({$IFC fTrace}EP;{$ENDC} $END; &{This calls the DoToHandle Procedure once for each handle LRect; user of this method must 'set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SetLRect(hLRect, -3, -2, 3, 2); (shapeLRect := SELF.shapeLRect; (WITH shapeLRect DO ,BEGIN ,dh := right - left; ,dv := bottom - top; ,MoveHandleAndPaint(left, top); {draw top left handle} ,END; (MoveHandleAndPaint(dh, 0); {then top right} (MoveHandleAndPaint(0, dv); {then bottom right} (MoveHandleAndPaint(-dh, 0); {finally bottom left} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); )SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxView.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TView.Fields(Field); (Field('boxList: TList'); $END; {$ENDC} ${This returns the box containing a certain point} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0boxWith := box; ({$IFC fTrace}EP;{$ENDC} $END; ${This draws the list of boxes} $PROCEDURE TBoxView.Draw; $VAR box: TBox; (s: TListScanner; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (s := SELF.boxList.Scanner; (WHILE s.Scan(box) DO ,box.Draw; ({$IFC fTrace}EP;{$ENDC} $END; &{This determines which type of selection to create} %PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); %VAR aSelection: TSelection; )panel: TPanel; )box: TBox; %BEGIN ({$IFC fTrace}BP(11);{$ENDC} (panel := SELF.panel; (panel.Highlight(panel.selection, hOntoOff); {Turn off the old highlighting} (box := SELF.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,{Create an instance of TCreateBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( PTCreateBoxSelection.CREATE(NIL, SELF.heap, SELF, mouseLPt)) (ELSE ,{Create an instance of TBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( >TBoxSelection.CREATE(NIL, SELF.heap, SELF, box, boxSelectionKind, mouseLPt)); (panel.Highlight(panel.selection, hOffToOn); {Turn on the highlighting for the newly selected box} (self.panel.selection.MarkChanged; {Allow the document to be saved so that any changes made} L{can become permanent} ({$IFC fTrace}EP;{$ENDC} %END; $PROCEDURE TBoxView.InvalBox(invalLRect: LRect); $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (InsetLRect(invalLRect, -3, -2); (SELF.panel.InvalLRect(invalLRect); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR boxList: TList; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, NIL, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; DitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TSelection.Fields(Field); (Field('box: TBox'); $END; {$ENDC} '{This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,SELF.box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; ${This is called when the user moves the mouse after pressing the button} $PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); $VAR diffLPt: LPoint; (boxView: TBoxView; (shapeLRect: LRect; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); +{How far did mouse move?} (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); +{Move it if delta is nonzero} (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,shapeLRect := SELF.box.shapeLRect; 1{Compute old and new positions of box} ,boxView.InvalBox(shapeLRect); ,OffsetLRect(shapeLRect, diffLPt.h, diffLPt.v); ,boxView.InvalBox(shapeLRect); ,SELF.box.shapeLRect := shapeLRect; ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxSelection.MouseRelease; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} *{ If the mouse moved then commit any outstanding command } (IF NOT EqualLPt(SELF.currLPt, SELF.anchorLPt) THEN ,SELF.window.CommitLast; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; $VAR boxView: TBoxView; (heap: THeap; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (heap := SELF.Heap; (CASE cmdNumber OF ,uWhite, uLtGray, uGray, uDkGray, uBlack: 0NewCommand := TRecolorCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box, hcmdNumber - uWhite + colorWhite); ,uDuplicate: 0NewCommand := TDuplicateCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box); ,OTHERWISE 0NewCommand := SUPERSELF.NewCommand(cmdNumber); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxSelection.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uWhite, uLtGray, uGray, uDkGray, uBlack, 4uDuplicate: >CanDoCommand := SELF.kind <> nothingKind; ,OTHERWISE >CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TCreateBoxSelection; $FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; LitsAnchorLPt: LPoint): TCreateBoxSelection; $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TCreateBoxSelection(TSelection.CREATE(object, itsHeap, itsView, createBoxSelectionKind, SitsAnchorLPt)); (box := TBox.CREATE(NIL, SELF.heap); (SELF.box := box; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TCreateBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TSelection.Fields(Field); (Field('box: TBox'); $END; {$ENDC} ${This is called when the user moves the mouse after pressing the button} $PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (box := SELF.box; ({ In Boxer it is possible to draw a box greater than allowed by a 16 bit rectangle. These three *lines force the rectangle to within 16 bits. } "{$H-} WITH SELF.anchorLPt DO ,SetLRect(maxBoxLRect, h+10-MAXINT, v+10-MAXINT, h+MAXINT-10, v+MAXINT-10); "{$H+} LRectHaveLPt(maxBoxLRect, mouseLPt); (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,boxView.panel.OnAllPadsDo(DrawTheFrame); {erase old frame} ,WITH box DO 0BEGIN 0shapeLRect.topLeft := SELF.anchorLPt; 0shapeLRect.botRight := mouseLPt; 0END; ${$H-} RectifyLRect(box.shapeLRect); {$H+} ,boxView.panel.OnAllPadsDo(DrawTheFrame); {draw new frame} ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateBoxSelection.MouseRelease; $VAR thisBox: TBox; (boxView: TBoxView; (drawnLRect: LRect; (aSelection: TSelection; (panel: TPanel; (PROCEDURE DrawTheFrame; (BEGIN ,thisBox.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (panel := boxView.panel; (thisBox := SELF.box; (panel.OnAllPadsDo(DrawTheFrame); (drawnLRect := thisBox.shapeLRect; ({ Independant of whether we threw the boxed away or not we must create an instance of TBoxSelection *to replace the now useless instance of TCreateBoxSelection using the kind set above. } (aSelection := SELF.FreedAndReplaceby( 8TBoxSelection.CREATE(NIL, SELF.heap, boxView, thisBox, boxSelectionKind, MdrawnLRect.topleft)); (boxView.InvalBox(drawnLRect); ({If the box is not big enough then throw it away, otherwise put it in the list} (IF (drawnLRect.right - drawnLRect.left <=4) OR (drawnLRect.bottom - drawnLRect.top <=4) THEN ,BEGIN ,aSelection.kind := nothingKind; ,thisBox.Free; ,END (ELSE BEGIN ,{ Commit any outstanding command } ,SELF.window.CommitLast; ,boxView.boxList.InsLast(thisBox); (END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TRecolorCmd; $FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; DitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TRecolorCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.color := itsColor; (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TRecolorCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('Color: INTEGER'); (Field('box: TBox'); $END; {$ENDC} $PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (tempColor: TColor; (box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (box := SELF.box; (CASE cmdPhase OF ,undoPhase, redoPhase, doPhase: 1BEGIN 1tempColor := SELF.color; 1SELF.color := box.color; 1box.color := tempColor; 1boxView.InvalBox(box.shapeLRect); 1END )END {CASE}; )self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TDuplicateCmd; $FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; EitsView: TBoxView; itsBox: TBox): TDuplicateCmd; $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TDuplicateCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.oldBox := itsBox; (box := TBox(itsBox.Clone(SELF.heap)); "{$H-} OffSetLRect(box.shapeLRect, 20, 20); {$H+} (SELF.newBox := box; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TDuplicateCmd.Free; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF NOT SELF.doing THEN +Free(SELF.newBox); (SELF.FreeObject; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TDuplicateCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('oldBox: TBox'); (Field('newBox: TBox'); $END; {$ENDC} $PROCEDURE TDuplicateCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (box: TBox; (thisSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (thisSelection := TBoxSelection(boxView.panel.selection); +{------------------------------------------------------------------------------------------- ,The current selection is unhighlighted before performing the command as the result ,of the following command fields set by TCommand.CREATE: GunHiliteBefore[doPhase..redoPhase] <- TRUE ,The resulting selection is highlighted after performing the command as the result of the ,following command fields set by TCommand.CREATE: GhiLiteAfter [doPhase..redoPhase] <- TRUE ,-------------------------------------------------------------------------------------------} (CASE cmdPhase OF ,doPhase, redoPhase: 0BEGIN 0thisSelection.box := SELF.newBox; 0boxView.boxList.InsLast(SELF.newBox); 0END; ,undoPhase: 0BEGIN 0boxView.boxList.DelLast(FALSE); 0WITH thisSelection DO 3box := SELF.oldBox; 0END; (END {CASE}; (boxView.InvalBox(SELF.newBox.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} )panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.ClearAll; $VAR boxView: TBoxView; (panel: Tpanel; (box: TBox; (s: TListScanner; (aSelection: TSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (panel := SELF.selectPanel; (boxView := TBoxView(panel.view); (s := boxView.boxList.scanner; (WHILE s.Scan(box) DO ,s.Delete(TRUE); (aSelection := panel.selection.FreedAndReplaceby(boxView.NoSelection); (panel.Invalidate; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 0{ put up an alert saying that this will not be undoable } 0IF process.caution(cantUndo) THEN 4BEGIN 4NewCommand := TCommand.CREATE(NIL, SELF.heap, cmdNumber, SELF.selectPanel.view, RFALSE, revealNone); 4SELF.ClearAll; 4END; ,OTHERWISE 0NewCommand := SUPERSELF.NewCommand(cmdNumber); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 4BEGIN 4CanDoCommand := TRUE; 4END; ,OTHERWISE 0CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9e D!$ǐ^&3. "6F^1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 6Boxer ; PROCEDURE {TBoxWindow.}NewCommand ; cantUndo = 1001; 1001 caution cancel alert You will not be able to undo ClearAll. 0 1 $-#BOOT-TK/PABC~File/Print 2 Edit Undo Last Change#205 - Duplicate/D#1011 - Clear All/Z#1012 - 3 Shades White#1006 Light Gray#1007 Gray#1008 Dark Gray#1009 Black#1010 5 $-#BOOT-TK/PABC~Page Layout 99 $-#BOOT-TK/PABC~Debug 100 $-#BOOT-TK/PABC~Buzzwords Create Box#2000 Move Selection#2001 0 3. "6F^9NuD!$ǐ^m&eckIt); : BOOLEAN): TCommand}; }; on 3. "6F^26 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum6 3. "6F^5D!$ǐ^ |BpPROGRAM M7Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U7Boxer } U7Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9exD!$ǐ^PP\N-}{FJoNV/ (nJloFBg<?. ?, l P/(N6 nB l l n,HN$(_N^ _\ONJoNVHB"H-_ nCJ"" gJfLHz n B^dd B BT^Xܠ""jLxxܠ"T2 lVÆd l lT2 JA^TRàØZNVøO`O`XX0T${ This segment of the LisaBoxer sample program implements Filtered Undo} ${ Copyright 1983, Apple Computer Inc.} {$E ERRORS.TEXT} UNIT U7Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; #{ selection kinds } $boxSelectionKind = 1; $createBoxSelectionKind = 2; #{ Menus } $uWhite = 1006; $uLtGray = 1007; $uGray = 1008; $uDkGray = 1009; $uBlack = 1010; $uDuplicate = 1011; $uClearAll = 1012; TYPE $TColor = colorWhite..colorBlack; {color of a box} +{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; &{ Highlighting support } (PROCEDURE TBox.PaintHandles; &{ Framing while creating } (PROCEDURE TBox.DrawFrame; &{Display} (PROCEDURE TBox.Draw; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; (FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; &{Invalidation} (PROCEDURE TBoxView.InvalBox(invalLRect: LRect); (PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); OVERRIDE; &{Display} (PROCEDURE TBoxView.Draw; OVERRIDE; &{Filtering} 'PROCEDURE TBoxView.EachActualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; &{Initialization} (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView.NoSelection: TSelection; OVERRIDE; 'END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; IitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); OVERRIDE; &{Selection - per pad} (PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TBoxSelection.MouseRelease; OVERRIDE; &{Command Dispatch} (FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxSelection.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN) O: BOOLEAN; OVERRIDE; $END; $TCreateBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; OitsAnchorLPt: LPoint): TCreateBoxSelection; &{Selection - per pad} (PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TCreateBoxSelection.MouseRelease; OVERRIDE; $END; .{ This command recolors the selected box and is undoable} $TRecolorCmd = SUBCLASS OF TCommand (Box: TBox; (color: TColor; &{Creation} (FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; &{Command Execution} (PROCEDURE TRecolorCmd.Commit; OVERRIDE; (PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TRecolorCmd.FilterAndDo(actualObj: TObject; MPROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; 0{ This command duplicates the selected box and is undoable } $TDuplicateCmd = SUBCLASS OF TCommand (oldBox, newBox: TBox; &{Creation} (FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; JitsView: TboxView; itsBox: TBox): TDuplicateCmd; &{Command Execution} (PROCEDURE TDuplicateCmd.Commit; OVERRIDE; (PROCEDURE TDuplicateCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TDuplicateCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; 0{ This command clears the view and is undoable } $TClearAllCmd = SUBCLASS OF TCommand &{Variables} (kind: INTEGER; &{Creation} (FUNCTION TClearAllCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; HitsView: TboxView): TClearAllCmd; &{Command Execution} (PROCEDURE TClearAllCmd.Commit; OVERRIDE; (PROCEDURE TClearAllCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TClearAllCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE TBoxWindow.BlankStationery; OVERRIDE; &{Commands} (FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; OVERRIDE; (END; IMPLEMENTATION "{$I U7Boxer2.text} END. 3. "6F^9. D!$ǐ^Zi3i3bP checkIt: BOOLEAN): BOOLEAN; OVERRIDE; BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 4CanDoCommand := TRUE; ,OTHERWISE 0CanDoCommand := SUPERSELF.CanDoCommand((color: TColor; &{Creation} (FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; &{Command Execution} (PROCEDURE TRecolorCmd.{U7BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{$IFC fDebugMethods} $PROCEDURE TBox.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (Field('shapeLRect: LRect'); (Field('color: INTEGER'); (Field(''); $END; ${$ENDC} %{This draws a particular box} $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; %{ Frame a particular box} $PROCEDURE TBox.DrawFrame; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (PenMode(PatXOr); (FrameLRect(SELF.shapeLRect); ({$IFC fTrace}EP;{$ENDC} $END; &{This calls the DoToHandle Procedure once for each handle LRect; user of this method must 'set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SetLRect(hLRect, -3, -2, 3, 2); (shapeLRect := SELF.shapeLRect; (WITH shapeLRect DO ,BEGIN ,dh := right - left; ,dv := bottom - top; ,MoveHandleAndPaint(left, top); {draw top left handle} ,END; (MoveHandleAndPaint(dh, 0); {then top right} (MoveHandleAndPaint(0, dv); {then bottom right} (MoveHandleAndPaint(-dh, 0); {finally bottom left} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); )SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxView.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TView.Fields(Field); (Field('boxList: TList'); $END; {$ENDC} *{This returns the box containing a certain point} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; (PROCEDURE FindBox(obj: TObject); (VAR box: TBox; (BEGIN ,box := TBox(obj); ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0BoxWith := box; {last one found (front one) is returned} (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (SELF.EachVirtualPart(FindBox); ({$IFC fTrace}EP;{$ENDC} $END; ({This draws the list of boxes} $PROCEDURE TBoxView.Draw; (PROCEDURE DrawBox(obj: TObject); (VAR box: TBox; (BEGIN ,box := TBox(obj); ,box.Draw; (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SELF.EachVirtualPart(DrawBox); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.EachActualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF.boxList.Each(DoToObject); ({$IFC fTrace}EP;{$ENDC} $END; ){This determines which type of selection to create} %PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); %VAR aSelection: TSelection; )panel: TPanel; )box: TBox; %BEGIN ({$IFC fTrace}BP(11);{$ENDC} (panel := SELF.panel; (panel.Highlight(panel.selection, hOntoOff); {Turn off the old highlighting} (box := SELF.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,{Create an instance of TCreateBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( PTCreateBoxSelection.CREATE(NIL, SELF.heap, SELF, mouseLPt)) (ELSE ,{Create an instance of TBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( >TBoxSelection.CREATE(NIL, SELF.heap, SELF, box, boxSelectionKind, mouseLPt)); (panel.Highlight(panel.selection, hOffToOn); {Turn on the highlighting for the newly selected box} (self.panel.selection.MarkChanged; {Allow the document to be saved so that any changes made} L{can become permanent} ({$IFC fTrace}EP;{$ENDC} %END; $PROCEDURE TBoxView.InvalBox(invalLRect: LRect); $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (InsetLRect(invalLRect, -3, -2); (SELF.panel.InvalLRect(invalLRect); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR boxList: TList; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, NIL, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; DitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TSelection.Fields(Field); (Field('box: TBox'); $END; {$ENDC} '{This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,SELF.box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; ${This is called when the user moves the mouse after pressing the button} $PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); $VAR diffLPt: LPoint; (boxView: TBoxView; (shapeLRect: LRect; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); +{How far did mouse move?} (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); +{Move it if delta is nonzero} (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,shapeLRect := SELF.box.shapeLRect; 1{Compute old and new positions of box} ,boxView.InvalBox(shapeLRect); ,OffsetLRect(shapeLRect, diffLPt.h, diffLPt.v); ,boxView.InvalBox(shapeLRect); ,SELF.box.shapeLRect := shapeLRect; ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxSelection.MouseRelease; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} *{ If the mouse moved then commit any outstanding command } (IF NOT EqualLPt(SELF.currLPt, SELF.anchorLPt) THEN ,SELF.window.CommitLast; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; $VAR boxView: TBoxView; (heap: THeap; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (heap := SELF.Heap; (CASE cmdNumber OF ,uWhite, uLtGray, uGray, uDkGray, uBlack: 0NewCommand := TRecolorCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box, hcmdNumber - uWhite + colorWhite); ,uDuplicate: 0NewCommand := TDuplicateCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box); ,OTHERWISE 0NewCommand := SUPERSELF.NewCommand(cmdNumber); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxSelection.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uWhite, uLtGray, uGray, uDkGray, uBlack, 4uDuplicate: >CanDoCommand := SELF.kind <> nothingKind; ,OTHERWISE >CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TCreateBoxSelection; $FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; LitsAnchorLPt: LPoint): TCreateBoxSelection; $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TCreateBoxSelection(TSelection.CREATE(object, itsHeap, itsView, createBoxSelectionKind, SitsAnchorLPt)); (box := TBox.CREATE(NIL, SELF.heap); (SELF.box := box; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TCreateBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TSelection.Fields(Field); (Field('box: TBox'); $END; {$ENDC} ${This is called when the user moves the mouse after pressing the button} $PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (box := SELF.box; ({ In Boxer it is possible to draw a box greater than allowed by a 16 bit rectangle. These three *lines force the rectangle to within 16 bits. } "{$H-} WITH SELF.anchorLPt DO ,SetLRect(maxBoxLRect, h+10-MAXINT, v+10-MAXINT, h+MAXINT-10, v+MAXINT-10); "{$H+} LRectHaveLPt(maxBoxLRect, mouseLPt); (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,WITH box DO 0BEGIN 0shapeLRect.topLeft := SELF.anchorLPt; 0shapeLRect.botRight := mouseLPt; 0END; ${$H-} RectifyLRect(box.shapeLRect); {$H+} ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateBoxSelection.MouseRelease; $VAR thisBox: TBox; (boxView: TBoxView; (drawnLRect: LRect; (aSelection: TSelection; (panel: TPanel; (PROCEDURE DrawTheFrame; (BEGIN ,thisBox.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (panel := boxView.panel; (thisBox := SELF.box; (panel.OnAllPadsDo(DrawTheFrame); (drawnLRect := thisBox.shapeLRect; ({ Independant of whether we threw the boxed away or not we must create an instance of TBoxSelection *to replace the now useless instance of TCreateBoxSelection using the kind set above. } (aSelection := SELF.FreedAndReplaceby( 8TBoxSelection.CREATE(NIL, SELF.heap, boxView, thisBox, boxSelectionKind, MdrawnLRect.topleft)); (boxView.InvalBox(drawnLRect); ({If the box is not big enough then throw it away, otherwise put it in the list} (IF (drawnLRect.right - drawnLRect.left <=4) OR (drawnLRect.bottom - drawnLRect.top <=4) THEN ,BEGIN ,aSelection.kind := nothingKind; ,thisBox.Free; ,END (ELSE BEGIN ,{ Commit any outstanding command } ,SELF.window.CommitLast; ,boxView.boxList.InsLast(thisBox); (END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TRecolorCmd; $FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; DitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TRecolorCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.color := itsColor; (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TRecolorCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('Color: INTEGER'); (Field('box: TBox'); $END; {$ENDC} $PROCEDURE TRecolorCmd.Commit; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (SELF.box.color := SELF.color; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (tempColor: TColor; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (boxView.InvalBox(SELF.box.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TRecolorCmd.FilterAndDo(actualObj: TObject; PROCEDURE DoToObject(filteredObj: TObject)); (VAR saveColor: TColor; ,box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (box := TBox(actualObj); (IF box = SELF.box THEN ,BEGIN ,saveColor := box.color; ,box.color := SELF.Color; ,DoToObject(box); ,box.color := saveColor; ,END (ELSE ,DoToObject(box); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TDuplicateCmd; $FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; FitsView: TBoxView; itsBox: TBox): TDuplicateCmd; (PROCEDURE CloneBox(filteredObj: TObject); (VAR box: TBox; (BEGIN ,box := TBox(filteredObj.Clone(itsHeap)); ,SELF.newBox := box; (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TDuplicateCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (TBoxView(SELF.image).FilterAndDo(itsbox, CloneBox); (SELF.oldBox := itsBox; "{$H-} OffSetLRect(SELF.newBox.shapeLRect, 20, 20); {$H+} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TDuplicateCmd.Free; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (Free(SELF.newBox); (SELF.FreeObject; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TDuplicateCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('oldBox: TBox'); (Field('newBox: TBox'); $END; {$ENDC} $PROCEDURE TDuplicateCmd.Commit; $VAR boxView: TBoxView; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (boxView.boxList.InsLast(SELF.newBox); (SELF.newBox := NIL; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TDuplicateCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (box: TBox; (thisSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (thisSelection := TBoxSelection(boxView.panel.selection); +{------------------------------------------------------------------------------------------- ,The current selection is unhighlighted before performing the command as the result ,of the following command fields set by TCommand.CREATE: GunHiliteBefore[doPhase..redoPhase] <- TRUE ,The resulting selection is highlighted after performing the command as the result of the ,following command fields set by TCommand.CREATE: GhiLiteAfter [doPhase..redoPhase] <- TRUE ,-------------------------------------------------------------------------------------------} (WITH thisSelection DO +CASE cmdPhase OF /doPhase, redoPhase: 5box := SELF.newBox; /undoPhase: 5box := SELF.oldBox; +END {CASE}; (boxView.InvalBox(SELF.newBox.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TDuplicateCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).EachActualPart(DoToObject); (DoToObject(SELF.newBox); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TClearAllCmd; $FUNCTION TClearAllCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; EitsView: TBoxView): TClearAllCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TClearAllCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealNone)); (SELF.kind := SELF.image.view.panel.selection.kind; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TClearAllCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('kind: INTEGER'); $END; "{$ENDC} $PROCEDURE TClearAllCmd.Commit; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).boxList.DelAll(TRUE); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TClearAllCmd.Perform(cmdPhase: TCmdPhase); $VAR thisSelection: TSelection; (boxView: TBoxView; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (thisSelection := boxView.panel.selection; (WITH thisSelection DO +CASE cmdPhase OF /doPhase, redoPhase: 6kind := nothingKind; /undoPhase: 6kind := SELF.kind; +END; 0{ Invalidate the whole panel } (boxView.panel.Invalidate; (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TClearAllCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} )panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 0NewCommand := TClearAllCmd.CREATE(NIL, SELF.heap, cmdNumber, RTBoxView(SELF.selectPanel.view)); ,OTHERWISE 0NewCommand := SUPERSELF.NewCommand(cmdNumber); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 4CanDoCommand := TRUE; ,OTHERWISE 0CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9e D!$ǐ^'9Z\(–]\zK\z\(\z̡z.3–L:9Z\(]\zK\z\(6J\z̡̡ḞJ̇ .1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 LisaBoxer ; PROCEDURE {TBoxWindow.}NewCommand ; cantUndo = 1001; 1001 caution cancel alert You will not be able to undo ClearAll. 0 1 $-#BOOT-TK/PABC~File/Print 2 Edit Undo Last Change#205 - Duplicate/D#1011 - Clear All/Z#1012 - 3 Shades White#1006 Light Gray#1007 Gray#1008 Dark Gray#1009 Black#1010 5 $-#BOOT-TK/PABC~Page Layout 99 $-#BOOT-TK/PABC~Debug 100 $-#BOOT-TK/PABC~Buzzwords Create Box#2000 Move Selection#2001 0 3. "6F^9NuD!$ǐ^'9Z\(–]\zK\z\(\z̡z.3–L:9Z\(]\zK\z\(6J\z̡̡ḞJ̇ .27 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum7 3. "6F^5D!$ǐ^  }^PROGRAM M8Boxer; USES ${$U UObject } UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw } QuickDraw, ${$U UDraw } UDraw, ${$U UABC } UABC, ${$U U8Boxer } U8Boxer; CONST $phraseVersion = 1; BEGIN $process := TBoxProcess.CREATE; $process.Commence(phraseVersion); $process.Run; $process.Complete(TRUE); END. 3. "6F^9oxD!$ǐ^$$PPKcmdPhase: TCmdPhase); OVERRIDE; (END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION {TBoxProcess.}CREATE: TBoxProcess; (FUNCTION {TBoxProcess.} NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION {TBoxDocManager.}CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFil${This LisaBoxer sample implements cut and paste, move and create undo, Tab and clear keys with undo} ${Copyright 1983, Apple Computer Inc.} UNIT U8Boxer; INTERFACE USES ${$U UObject} UObject, "{$IFC libraryVersion <= 20} ${$U UFont} UFont, "{$ENDC} ${$U QuickDraw} QuickDraw, ${$U UDraw} UDraw, ${$U UABC} UABC; CONST $colorWhite = 1; $colorLtGray = 2; $colorGray = 3; $colorDkGray = 4; $colorBlack = 5; #{ selection kinds } $boxSelectionKind = 1; $createBoxSelectionKind = 2; #{ Menus } $uWhite = 1006; $uLtGray = 1007; $uGray = 1008; $uDkGray = 1009; $uBlack = 1010; $uDuplicate = 1011; $uClearAll = 1012; #{ Implied commands } $uCreateBox = 2000; $uMoveBox = 2001; TYPE $TColor = colorWhite..colorBlack; {color of a box} "{New Classes for this Application} $TBox = SUBCLASS OF TObject ({Variables} (shapeLRect: LRect; (color: TColor; &{Creation/Destruction} (FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; &{ Display } (PROCEDURE TBox.Draw; (PROCEDURE TBox.DrawFrame; &{ Editing and Display } (PROCEDURE TBox.MoveBox(boxView: TBoxView; deltaLPt: LPoint); &{ Highlighting support } (PROCEDURE TBox.PaintHandles; (END; $TBoxView = SUBCLASS OF TView &{Variables} (boxList: TList; &{Creation/Destruction} (FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) C: TBoxView; (FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; &{Invalidation} (PROCEDURE TBoxView.InvalBox(invalLRect: LRect); (PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); OVERRIDE; &{Display} (PROCEDURE TBoxView.Draw; OVERRIDE; &{Filtering} 'PROCEDURE TBoxView.EachActualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; &{Initialization} (PROCEDURE TBoxView.InitBoxList(itsHeap: THeap); (FUNCTION TBoxView.NoSelection: TSelection; OVERRIDE; 'END; $TBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; IitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; &{Drawing - per pad} (PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); OVERRIDE; &{Selection - per pad} (PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TBoxSelection.MouseRelease; OVERRIDE; &{Command Dispatch} (FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxSelection.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN) O: BOOLEAN; OVERRIDE; $END; $TCreateBoxSelection = SUBCLASS OF TSelection &{Variables} (box: TBox; &{Creation/Destruction} (FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; OitsAnchorLPt: LPoint): TCreateBoxSelection; &{Selection - per pad} (PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); OVERRIDE; (PROCEDURE TCreateBoxSelection.MouseRelease; OVERRIDE; $END; .{ This command recolors the selected box and is not undoable 0should it instead return an instance of TCommand } $TRecolorCmd = SUBCLASS OF TCommand (Box: TBox; (color: TColor; &{Creation} (FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; (PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TRecolorCmd.FilterAndDo(actualObj: TObject; MPROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; $TCreateCmd = SUBCLASS OF TCommand &{Variables} (newBox: TBox; &{Creation and Destruction} (FUNCTION TCreateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; FitsView: TBoxView; itsBox: TBox): TCreateCmd; (PROCEDURE TCreateCmd.Commit; OVERRIDE; (PROCEDURE TCreateCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TCreateCmd.UpdateSelection(thisSelection: TBoxSelection; cmdPhase: TCmdPhase); (PROCEDURE TCreateCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; 0{ This command duplicates the selected box and is undoable } $TDuplicateCmd = SUBCLASS OF TCreateCmd &{Variables} (oldBox: TBox; &{Creation} (FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; JitsView: TboxView; itsBox: TBox): TDuplicateCmd; &{Command Execution} (PROCEDURE TDuplicateCmd.UpdateSelection(thisSelection: TBoxSelection; cmdPhase: TCmdPhase); ROVERRIDE; (END; $TBoxCutCopyCmd = SUBCLASS OF TCutCopyCommand &{Variables} (selTopLeft: LPoint; (box: TBox; &{Creation} (FUNCTION TBoxCutCopyCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; JitsView: TView; isCutCmd: BOOLEAN; itsBox: TBox): TBoxCutCopyCmd; &{Command Execution} (PROCEDURE TBoxCutCopyCmd.Commit; OVERRIDE; (PROCEDURE TBoxCutCopyCmd.DoCutCopy(clipSelection: TSelection; deleteOriginal: BOOLEAN; NcmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TBoxCutCopyCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; $TBoxPasteCmd = SUBCLASS OF TPasteCommand &{Variables} (pasteH: LONGINT; (pasteV: LONGINT; (pasteBox: TBox; &{Creation and Destruction} (FUNCTION TBoxPasteCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; HitsView: TBoxView; itsH, itsV: LONGINT): TBoxPasteCmd; (PROCEDURE TBoxPasteCmd.Free; OVERRIDE; &{Command Execution} (PROCEDURE TBoxPasteCmd.Commit; OVERRIDE; (PROCEDURE TBoxPasteCmd.DoPaste(clipSelection: TSelection; pic: PicHandle; cmdPhase: TCmdPhase); IOVERRIDE; (PROCEDURE TBoxPasteCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; 0{ This command duplicates the selected box and is undoable } $TClearAllCmd = SUBCLASS OF TCommand &{Variables} (kind: INTEGER; &{Creation} (FUNCTION TClearAllCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; HitsView: TboxView): TClearAllCmd; &{Command Execution} (PROCEDURE TClearAllCmd.Commit; OVERRIDE; (PROCEDURE TClearAllCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (PROCEDURE TClearAllCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); OVERRIDE; (END; $TClearCmd = SUBCLASS OF TBoxCutCopyCmd &{Creation} (FUNCTION TClearCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; EitsView: TBoxView; itsBox: TBox): TClearCmd; &{Command Execution} (PROCEDURE TClearCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; $TMoveBoxCmd = SUBCLASS OF TCommand &{Variables} (hOffset: LONGINT; (vOffset: LONGINT; (movedBox: TBox; &{Creation} (FUNCTION TMoveBoxCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TBoxView; itsBox: TBox; itsHOffset, itsVOffset: LONGINT) F: TMoveBoxCmd; &{Command Execution} (PROCEDURE TMoveBoxCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN) N: TDocManager; OVERRIDE; (END; $TBoxDocManager = SUBCLASS OF TDocManager &{Creation/Destruction} (FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) I: TBoxDocManager; (FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID): TWindow; OVERRIDE; (END; $TBoxWindow = SUBCLASS OF TWindow &{Creation/Destruction} (FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; &{Document Creation} (PROCEDURE {TBoxWindow.} BlankStationery; OVERRIDE; &{Commands} (FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; OVERRIDE; (FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; OVERRIDE; (END; IMPLEMENTATION "{$I U8Boxer2.text} END. 3. "6F^9. D!$ǐ^R``bQU checkIt: BOOLEAN): BOOLEAN; OVERRIDE; eld); (Field('hOffset: LONGINT'); (Field('vOffset: LONGINT'); (Field('movedBox: TBox'); $END; ${$ENDC} $PROCEDURE TMoveCmd.Perform(cmdPhase(PROCEDURE TMoveBoxCmd.Perform(cmdPhase: TCmdPhase); OVERRIDE; (END; $TBoxProcess = SUBCLASS OF TProcess &{Creation/Destruction} (FUNCTION TBoxProcess.CREATE: TBoxProcess; (FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFi{U8BOXER2} METHODS OF TBox; $FUNCTION TBox.CREATE(object: TObject; itsHeap: THeap): TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := NewObject(itsHeap, THISCLASS); (WITH SELF DO ,BEGIN ,shapeLRect := zeroLRect; ,color := colorGray; ,END; ({$IFC fTrace}EP;{$ENDC} $END; #{$IFC fDebugMethods} $PROCEDURE TBox.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (Field('shapeLRect: LRect'); (Field('color: INTEGER'); (Field(''); $END; ${$ENDC} %{This draws a particular box} $PROCEDURE TBox.Draw; $VAR lPat: LPattern; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (IF LRectIsVisible(SELF.shapeLRect) THEN {this box needs to be drawn} ,BEGIN *{Get a Quickdraw pattern to represent the box's color} ,CASE SELF.color OF 0colorWhite: lPat := lPatWhite; 0colorLtGray: lPat := lPatLtGray; 0colorGray: lPat := lPatGray; 0colorDkGray: lPat := lPatDkGray; 0colorBlack: lPat := lPatBlack; 0OTHERWISE lPat := lPatWhite; {this case should not happen} 0END; +{Fill the box with the pattern, and draw a frame around it} ,FillLRect(SELF.shapeLRect, lPat); ,FrameLRect(SELF.shapeLRect); ,END; ({$IFC fTrace}EP;{$ENDC} $END; %{ Frame a particular box} $PROCEDURE TBox.DrawFrame; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (PenNormal; (PenMode(PatXOr); (FrameLRect(SELF.shapeLRect); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBox.MoveBox(boxView: TBoxView; deltaLPt: LPoint); $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (WITH SELF DO %{$H-} BEGIN ,boxView.InvalBox(shapeLRect); ,OffsetLRect(shapeLRect, deltaLPt.h, deltaLPt.v); ,boxView.InvalBox(shapeLRect); %{$H+} END; ({$IFC fTrace}EP;{$ENDC} $END; &{This calls the DoToHandle Procedure once for each handle LRect; user of this method must 'set up the pen pattern and mode before calling} $PROCEDURE TBox.PaintHandles; $VAR hLRect, (shapeLRect: LRect; (dh, dv: LONGINT; (PROCEDURE MoveHandleAndPaint(hOffset, vOffset: LONGINT); (BEGIN ,OffsetLRect(hLRect, hOffset, vOffset); ,PaintLRect(hLRect); (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF NOT EmptyLRect(SELF.shapeLRect) THEN +BEGIN +SetLRect(hLRect, -3, -2, 3, 2); +shapeLRect := SELF.shapeLRect; +WITH shapeLRect DO /BEGIN /dh := right - left; /dv := bottom - top; /MoveHandleAndPaint(left, top); {draw top left handle} /END; +MoveHandleAndPaint(dh, 0); {then top right} +MoveHandleAndPaint(0, dv); {then bottom right} +MoveHandleAndPaint(-dh, 0); {finally bottom left} +END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxView; $FUNCTION TBoxView.CREATE(object: TObject; itsHeap: THeap; itsPanel: TPanel; itsExtent: LRect) ?: TBoxView; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); )SELF := TBoxView(itsPanel.NewView(object, itsExtent, TPrintManager.CREATE(NIL, itsHeap), JstdMargins, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxView.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('boxList: TList'); $END; {$ENDC} *{This returns the box containing a certain point} $FUNCTION TBoxView.BoxWith(LPt: LPoint): TBox; (PROCEDURE FindBox(obj: TObject); (VAR box: TBox; (BEGIN ,box := TBox(obj); ,IF LPtInLRect(LPt, box.shapeLRect) THEN 0BoxWith := box; {last one found (front one) is returned} (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxWith := NIL; (SELF.EachVirtualPart(FindBox); ({$IFC fTrace}EP;{$ENDC} $END; ({This draws the list of boxes} $PROCEDURE TBoxView.Draw; (PROCEDURE DrawBox(obj: TObject); (VAR box: TBox; (BEGIN ,box := TBox(obj); ,box.Draw; (END; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (SELF.EachVirtualPart(DrawBox); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.EachActualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF.boxList.Each(DoToObject); ({$IFC fTrace}EP;{$ENDC} $END; ){This determines which type of selection to create} %PROCEDURE TBoxView.MousePress(mouseLPt: LPoint); %VAR aSelection: TSelection; )panel: TPanel; )box: TBox; %BEGIN ({$IFC fTrace}BP(11);{$ENDC} (panel := SELF.panel; (panel.Highlight(panel.selection, hOntoOff); {Turn off the old highlighting} (box := SELF.BoxWith(mouseLPt); {Find the box the user clicked on} (IF box = NIL THEN ,{Create an instance of TCreateBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( PTCreateBoxSelection.CREATE(NIL, SELF.heap, SELF, mouseLPt)) (ELSE ,{Create an instance of TBoxSelection} ,aSelection := panel.selection.FreedAndReplacedBy( >TBoxSelection.CREATE(NIL, SELF.heap, SELF, box, boxSelectionKind, mouseLPt)); (panel.Highlight(panel.selection, hOffToOn); {Turn on the highlighting for the newly selected box} ({$IFC fTrace}EP;{$ENDC} %END; $PROCEDURE TBoxView.InvalBox(invalLRect: LRect); $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (InsetLRect(invalLRect, -3, -2); (SELF.panel.InvalLRect(invalLRect); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxView.InitBoxList (itsHeap: THeap); $VAR boxList: TList; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (boxList := TList.CREATE(NIL, itsHeap, 0); (SELF.boxList := boxList; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxView.NoSelection: TSelection; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} (NoSelection := TBoxSelection.CREATE(NIL, SELF.Heap, SELF, NIL, nothingKind, zeroLPt); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxSelection; $FUNCTION TBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; itsBox: TBox; DitsKind: INTEGER; itsAnchorLPt: LPoint): TBoxSelection; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxSelection(TSelection.CREATE(object, itsHeap, itsView, itsKind, itsAnchorLPt)); (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('box: TBox'); $END; {$ENDC} '{This draws the handles on the selected box} $PROCEDURE TBoxSelection.Highlight(highTransit: THighTransit); $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF SELF.kind <> nothingKind THEN ,BEGIN ,thePad.SetPenToHighlight(highTransit); {set the drawing mode according to desired highlighting} ,SELF.box.PaintHandles; {draw the handles on the box} ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxSelection.KeyClear; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (SELF.window.PerformCommand(TClearCmd.CREATE(NIL, SELF.Heap, uClear, TBoxView(SELF.view), SELF.box)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxSelection.KeyTab; $VAR thisPanel: TPanel; (nextBox: TBox; (boxView: TBoxView; (GetTheNextBox: BOOLEAN; (PROCEDURE DoToObject(filteredObj: TObject); (VAR box: TBox; (BEGIN +box := TBox(filteredObj); +IF GetTheNextBox = TRUE THEN /BEGIN /nextBox := box; /GetTheNextBox := FALSE; /END; +IF box = SELF.box THEN /GetTheNextBox := TRUE; (END; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (thisPanel := SELF.panel; (boxView := TBoxView(SELF.view); (IF SELF.kind = nothingKind THEN ,SELF.cantDoIt (ELSE ,BEGIN ,GetTheNextBox := FALSE; ,nextBox := NIL; ,boxView.EachVirtualPart(DoToObject); ,IF nextBox = NIL THEN 0BEGIN 0GetTheNextBox := TRUE; 0boxView.EachVirtualPart(DoToObject); 0END; ,END; (thisPanel.Highlight(SELF, hOnToOff); (SELF.box := nextBox; (thisPanel.Highlight(SELF, hOffToOn); ({$IFC fTrace}EP;{$ENDC} $END; ){This is called when the user moves the mouse after pressing the button} $PROCEDURE TBoxSelection.MouseMove(mouseLPt: LPoint); $VAR diffLPt: LPoint; $BEGIN '{$IFC fTrace}BP(11);{$ENDC} ,{How far did mouse move?} (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); '{Move it if delta is nonzero} (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,SELF.box.MoveBox(TBoxView(SELF.view), diffLPt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxSelection.MouseRelease; $VAR deltaLPt: LPoint; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} +{ If the mouse moved then commit any outstanding command } (IF NOT EqualLPt(SELF.currLPt, SELF.anchorLPt) THEN ,BEGIN ,LPtMinusLPt(SELF.currLPt, SELF.anchorLPt, deltaLPt); ,SELF.window.PerformCommand(TMoveBoxCmd.CREATE(NIL, SELF.Heap, uMoveBox, TBoxView(SELF.view), ZSELF.box, deltaLPt.h, deltaLPt.v)); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxSelection.NewCommand(cmdNumber: TCmdNumber): TCommand; $VAR boxView: TBoxView; (heap: THeap; (pasteH, pasteV: LONGINT; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (heap := SELF.Heap; (CASE cmdNumber OF ,uWhite, uLtGray, uGray, uDkGray, uBlack: 0NewCommand := TRecolorCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box, QcmdNumber - uWhite + colorWhite); ,uClear: 0NewCommand := TClearCmd.CREATE(NIL, heap, cmdNumber, boxView, SELF.box); ,uCut, uCopy: 0NewCommand := TBoxCutCopyCmd.CREATE(NIL, heap, cmdNumber, boxView, cmdNumber = uCut, TSELF.box); ,uPaste: 0BEGIN 0clipboard.Inspect; 0IF clipboard.hasView THEN 4BEGIN 4WITH SELF DO 8IF kind = nothingKind THEN  nothingKind; ,uPaste: 0BEGIN 0clipboard.Inspect; 0CanDoCommand := clipboard.hasView; 0END; ,OTHERWISE 0CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TCreateBoxSelection; $FUNCTION TCreateBoxSelection.CREATE(object: TObject; itsHeap: THeap; itsView: TView; LitsAnchorLPt: LPoint): TCreateBoxSelection; $VAR box: TBox; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TCreateBoxSelection(TSelection.CREATE(object, itsHeap, itsView, createBoxSelectionKind, SitsAnchorLPt)); (box := TBox.CREATE(NIL, SELF.heap); (SELF.box := box; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TCreateBoxSelection.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('box: TBox'); $END; {$ENDC} ${This is called when the user moves the mouse after pressing the button} $PROCEDURE TCreateBoxSelection.MouseMove(mouseLPt: LPoint); $VAR maxBoxLRect: LRect; (diffLPt: LPoint; (boxView: TBoxView; (box: TBox; (PROCEDURE DrawTheFrame; (BEGIN ,box.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (box := SELF.box; ({ In Boxer it is possible to draw a box greater than allowed by a 16 bit rectangle. These three *lines force the rectangle to within 16 bits. } "{$H-} WITH SELF.anchorLPt DO ,SetLRect(maxBoxLRect, h+10-MAXINT, v+10-MAXINT, h+MAXINT-10, v+MAXINT-10); "{$H+} LRectHaveLPt(maxBoxLRect, mouseLPt); (LPtMinusLPt(mouseLPt, SELF.currLPt, diffLPt); (IF NOT EqualLPt(diffLPt, zeroLPt) THEN ,BEGIN ,SELF.currLPt := mouseLPt; ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,WITH box DO 0BEGIN 0shapeLRect.topLeft := SELF.anchorLPt; 0shapeLRect.botRight := mouseLPt; 0END; ${$H-} RectifyLRect(box.shapeLRect); {$H+} ,boxView.panel.OnAllPadsDo(DrawTheFrame); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateBoxSelection.MouseRelease; $VAR thisBox: TBox; (boxView: TBoxView; (drawnLRect: LRect; (aSelection: TSelection; (panel: TPanel; (PROCEDURE DrawTheFrame; (BEGIN ,thisBox.DrawFrame; (END; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (boxView := TBoxView(SELF.view); (panel := boxView.panel; (thisBox := SELF.box; (panel.OnAllPadsDo(DrawTheFrame); (drawnLRect := thisBox.shapeLRect; ({ Independant of whether we threw the boxed away or not we must create an instance of TBoxSelection *to replace the now useless instance of TCreateBoxSelection using the kind set above. } (aSelection := SELF.FreedAndReplaceby( 8TBoxSelection.CREATE(NIL, SELF.heap, boxView, thisBox, boxSelectionKind, MdrawnLRect.topleft)); (boxView.InvalBox(drawnLRect); ({If the box is not big enough then throw it away, otherwise put it in the list} (IF (drawnLRect.right - drawnLRect.left <=4) OR (drawnLRect.bottom - drawnLRect.top <=4) THEN ,BEGIN ,aSelection.kind := nothingKind; ,thisBox.Free; ,END (ELSE ,panel.window.PerformCommand(TCreateCmd.CREATE(NIL, SELF.Heap, uCreateBox, boxView, thisBox)); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TRecolorCmd; $FUNCTION TRecolorCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; DitsView: TBoxView; itsBox: TBox; itsColor: TColor): TRecolorCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TRecolorCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.color := itsColor; (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TRecolorCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('Color: INTEGER'); (Field('box: TBox'); $END; {$ENDC} $PROCEDURE TRecolorCmd.Commit; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (SELF.box.color := SELF.color; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TRecolorCmd.Perform(cmdPhase: TCmdPhase); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).InvalBox(SELF.box.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TRecolorCmd.FilterAndDo(actualObj: TObject; PROCEDURE DoToObject(filteredObj: TObject)); (VAR saveColor: TColor; ,box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (box := TBox(actualObj); (IF box = SELF.box THEN ,BEGIN ,saveColor := box.color; ,box.color := SELF.Color; ,DoToObject(box); ,box.color := saveColor; ,END (ELSE ,DoToObject(box); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TCreateCmd; $FUNCTION TCreateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; BitsView: TBoxView; itsBox: TBox): TCreateCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TCreateCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.newBox := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateCmd.Free; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (Free(SELF.newBox); (SELF.FreeObject; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TCreateCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('newBox: TBox'); $END; {$ENDC} $PROCEDURE TCreateCmd.Commit; $VAR boxView: TBoxView; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).boxList.InsLast(SELF.newBox); (SELF.newBox := NIL; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateCmd.UpdateSelection(thisSelection: TBoxSelection; cmdPhase: TCmdPhase); $BEGIN ({$IFC fTrace}BP(13);{$ENDC} (WITH thisSelection DO +CASE cmdPhase OF /doPhase, redoPhase: 5kind := boxSelectionKind; /undoPhase: 5kind := nothingKind; +END {CASE}; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (box: TBox; (thisSelection: TBoxSelection; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (thisSelection := TBoxSelection(boxView.panel.selection); (SELF.UpdateSelection(thisSelection, cmdPhase); (boxView.InvalBox(SELF.newBox.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TCreateCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).EachActualPart(DoToObject); (DoToObject(SELF.newBox); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TDuplicateCmd; $FUNCTION TDuplicateCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; FitsView: TBoxView; itsBox: TBox): TDuplicateCmd; $VAR newBox: TBox; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TDuplicateCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (SELF.image.view.panel.window.CommitLast; (SELF.oldBox := itsBox; (newBox := TBox(itsBox.Clone(itsHeap)); (SELF.newBox := newBox; "{$H-} OffSetLRect(newBox.shapeLRect, 20, 20); {$H+} ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TDuplicateCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('oldBox: TBox'); $END; {$ENDC} $PROCEDURE TDuplicateCmd.UpdateSelection(thisSelection: TBoxSelection; cmdPhase: TCmdPhase); $BEGIN ({$IFC fTrace}BP(13);{$ENDC} (WITH thisSelection DO +CASE cmdPhase OF /doPhase, redoPhase: 5box := SELF.newBox; /undoPhase: 5box := SELF.oldBox; +END {CASE}; ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxCutCopyCmd; $FUNCTION TBoxCutCopyCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; GitsView: TView; isCutCmd: BOOLEAN; itsBox: TBox): TBoxCutCopyCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxCutCopyCmd(TCutCopyCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, isCutCmd)); (SELF.box := itsBox; ({$IFC fTrace}EP;{$ENDC} $END; ${$IFC fDebugMethods} $PROCEDURE TBoxCutCopyCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('box: TBox'); $END; ${$ENDC} $PROCEDURE TBoxCutCopyCmd.Commit; $VAR s: TListScanner; (box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (IF SELF.isCut THEN ,BEGIN ,s := TBoxView(SELF.image).boxList.Scanner; ,WHILE s.Scan(box) DO 0IF box = SELF.box THEN 4BEGIN 4s.Delete(TRUE); 4s.Done; 4END; ,END; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxCutCopyCmd.DoCutCopy(clipSelection: TSelection; deleteOriginal: BOOLEAN; JcmdPhase: TCmdPhase); $VAR boxView: TBoxView; (thisBoxSelection: TBoxSelection; (clipHeap: THeap; (clipBoxList: TList; (clipBoxView: TBoxView; (clipBoxSelection: TSelection; (clipBox: TBox; (deltaH: LONGINT; (deltaV: LONGINT; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (IF cmdPhase = doPhase THEN ,BEGIN ,{prepare to copy} ,clipHeap := clipSelection.Heap; ,deltaH := SELF.box.shapeLRect.left; ,deltaV := SELF.box.shapeLRect.top; /{Copy the box to the scrap} ,clipBox := TBox(SELF.box.Clone(clipHeap)); %{$H-} OffsetLRect(clipBox.shapeLRect, -deltaH, -deltaV); {$H+} ,clipBoxList := TList.CREATE(NIL, clipHeap, 0); ,clipBoxList.InsLast(clipBox); /{make new clipboard selection} ,clipBoxView := TBoxView.CREATE(NIL, clipHeap, clipSelection.panel, clipBox.shapeLRect); ,clipBoxView.boxList := clipBoxList; ,clipBoxSelection := clipSelection.FreedAndReplacedBy( 4TBoxSelection.CREATE(NIL, clipHeap, clipBoxView, clipBox, boxSelectionKind, zeroLPt)); ,END; '{ If this is a cut then remake the selection and invalidate the cut box. } (IF SELF.isCut THEN ,BEGIN ,thisBoxSelection := TBoxSelection(boxView.panel.selection); ,WITH thisBoxSelection DO 0CASE cmdPhase OF 4doPhase, redoPhase: 8Kind := nothingKind; 4undoPhase: 8Kind := boxSelectionKind; 4END; &{$H-} boxView.InvalBox(SELF.box.shapeLRect); {$H+} ,END; (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxCutCopyCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (IF SELF.isCut THEN ,SUPERSELF.EachVirtualPart(DoToObject) (ELSE ,SELF.image.EachActualPart(DoToObject); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxCutCopyCmd.FilterAndDo(actualObj: TObject; PROCEDURE DoToObject(filteredObj: TObject)); (VAR box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (box := TBox(actualObj); (IF (box <> SELF.box) OR NOT SELF.isCut THEN ,DoToObject(actualObj); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxPasteCmd; $FUNCTION TBoxPasteCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; EitsView: TBoxView; itsH, itsV: LONGINT): TBoxPasteCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxPasteCmd(TPasteCommand.CREATE(object, itsHeap, itsCmdNumber, itsView)); (WITH SELF DO ,BEGIN ,pasteH := itsH; ,pasteV := itsV; ,pasteBox := NIL; ,END; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TBoxPasteCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (SUPERSELF.Fields(Field); (Field('pasteH: LONGINT'); (Field('pasteV: LONGINT'); (Field('pasteBox: TBox'); $END; {$ENDC} $PROCEDURE TBoxPasteCmd.Free; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (Free(SELF.pasteBox); (SELF.FreeObject; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxPasteCmd.Commit; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).boxList.InsLast(SELF.pasteBox); (SELF.pasteBox := NIL; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxPasteCmd.DoPaste(clipSelection: TSelection; pic: PicHandle; cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (panel: TPanel; (clipBoxSelection: TBoxSelection; (thisBoxSelection: TBoxSelection; (clipBoxView: TBoxView; (deltaH: LONGINT; (deltaV: LONGINT; (s: TListScanner; (clipBox: TBox; (box: TBox; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView :=TBoxView(SELF.image); (panel := boxView.panel; (IF cmdPhase = doPhase THEN ,BEGIN 0{ If the clipboard selection is of class TBoxSelection then we can paste it into document, 2otherwise we have to do other things } ,IF NOT InClass(clipSelection, TBoxSelection) THEN 0panel.selection.CantDoIt ,ELSE 0BEGIN 0clipBoxSelection := TBoxSelection(clipSelection); 6{ Place the box around the point indicated by pasteH and pasteV } ){$H-} WITH clipBoxSelection.box.shapeLRect DO {box.shapeLRect.topLeft = zeroLPt} 4BEGIN 4deltaH := Max(0, Min(SELF.pasteH - (right DIV 2), IboxView.extentLRect.right - right)); 4deltaV := Max(0, Min(SELF.pasteV - (bottom DIV 2), IboxView.extentLRect.bottom - bottom)); ){$H+} END; 0box := TBox(clipBoxSelection.box.Clone(boxView.Heap)); ){$H-} OffsetLRect(box.shapeLRect, deltaH, deltaV); {$H+} 0SELF.pasteBox := box; 0END; ,END; (thisBoxSelection := TBoxSelection(panel.selection); (panel.Highlight(thisBoxSelection, hOnToOff); (WITH thisBoxSelection DO ,CASE cmdPhase OF 0doPhase, redoPhase: 4BEGIN 4kind := boxSelectionKind; 4box := SELF.pasteBox; 4END; 0undoPhase: 4kind := nothingKind; 0END; "{$H-} boxView.InvalBox(SELF.pasteBox.shapeLRect); {$H+} )self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxPasteCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (SELF.image.EachActualPart(DoToObject); (DoToObject(SELF.pasteBox); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TClearAllCmd; $FUNCTION TClearAllCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; EitsView: TBoxView): TClearAllCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TClearAllCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealNone)); (SELF.kind := SELF.image.view.panel.selection.kind; ({$IFC fTrace}EP;{$ENDC} $END; {$IFC fDebugMethods} $PROCEDURE TClearAllCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('kind: INTEGER'); $END; "{$ENDC} $PROCEDURE TClearAllCmd.Commit; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).boxList.DelAll(TRUE); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TClearAllCmd.Perform(cmdPhase: TCmdPhase); $VAR thisSelection: TSelection; (boxView: TBoxView; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (thisSelection := boxView.panel.selection; (WITH thisSelection DO +CASE cmdPhase OF /doPhase, redoPhase: 6kind := nothingKind; /undoPhase: 6kind := SELF.kind; +END; 0{ Invalidate the whole panel } (boxView.panel.Invalidate; (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TClearAllCmd.EachVirtualPart(PROCEDURE DoToObject(filteredObj: TObject)); $BEGIN ({$IFC fTrace}BP(12);{$ENDC} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TClearCmd; $FUNCTION TClearCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; BitsView: TBoxView; itsBox: TBox): TClearCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TClearCmd(TBoxCutCopyCmd.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, itsBox)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TClearCmd.Perform(cmdPhase: TCmdPhase); $VAR boxView: TBoxView; (thisBoxSelection: TBoxSelection; (panel: TPanel; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} (boxView := TBoxView(SELF.image); (panel := boxView.panel; (thisBoxSelection := TBoxSelection(panel.selection); (WITH thisBoxSelection DO ,CASE cmdPhase OF 0doPhase, redoPhase: 4Kind := nothingKind; 0undoPhase: 4Kind := boxSelectionKind; 0END; (boxView.InvalBox(SELF.box.shapeLRect); (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TMoveBoxCmd; $FUNCTION TMoveBoxCmd.CREATE(object: TObject; itsHeap: THeap; itsCmdNumber: TCmdNumber; DitsView: TBoxView; itsBox: TBox; itsHOffset, itsVOffset: LONGINT) D: TMoveBoxCmd; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TMoveBoxCmd(TCommand.CREATE(object, itsHeap, itsCmdNumber, itsView, TRUE, revealAll)); (WITH SELF DO ,BEGIN ,hOffset := itsHOffset; ,vOffset := itsVOffset; ,movedBox := itsBox; ,END; ({$IFC fTrace}EP;{$ENDC} $END; %{$IFC fDebugMethods} $PROCEDURE TMoveBoxCmd.Fields(PROCEDURE Field(nameAndType: S255)); $BEGIN (TCommand.Fields(Field); (Field('hOffset: LONGINT'); (Field('vOffset: LONGINT'); (Field('movedBox: TBox'); $END; ${$ENDC} $PROCEDURE TMoveBoxCmd.Perform(cmdPhase: TCmdPhase); $VAR diffLPt: LPoint; $BEGIN ({$IFC fTrace}BP(12);{$ENDC} /{ Do nothing on the doPhase, since the box has already been moved } (IF cmdPhase <> doPhase THEN ,BEGIN %{$H-} WITH SELF DO 0CASE cmdPhase OF 4redoPhase: 8SetLPt(diffLPt, hOffset, vOffset); 4undoPhase: 8SetLPt(diffLPt, -hOffset, -vOffset); %{$H+} END; ,SELF.movedBox.MoveBox(TBoxView(SELF.image), diffLPt); ,END; (self.image.view.panel.selection.MarkChanged; {allow this document to be saved} ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxProcess; $FUNCTION TBoxProcess.CREATE: TBoxProcess; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (SELF := TBoxProcess(TProcess.CREATE(NewObject(mainHeap, THISCLASS), mainHeap)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxProcess.NewDocManager(volumePrefix: TFilePath; openAsTool: BOOLEAN): TDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewDocManager := TBoxDocManager.CREATE(NIL, mainHeap, volumePrefix); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxDocManager; $FUNCTION TBoxDocManager.CREATE(object: TObject; itsHeap: THeap; itsPathPrefix: TFilePath) E: TBoxDocManager; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxDocManager(TDocManager.CREATE(object, itsHeap, itsPathPrefix)); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxDocManager.NewWindow(heap: THeap; wmgrID: TWindowID):TWindow; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (NewWindow := TBoxWindow.CREATE(NIL, heap, wmgrID); ({$IFC fTrace}EP;{$ENDC} $END; END; METHODS OF TBoxWindow; $FUNCTION TBoxWindow.CREATE(object: TObject; itsHeap: THeap; itsWmgrID: TWindowID): TBoxWindow; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} (IF object = NIL THEN +object := NewObject(itsHeap, THISCLASS); (SELF := TBoxWindow(TWindow.CREATE(object, itsHeap, itsWmgrID, TRUE)); ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE TBoxWindow.BlankStationery; $VAR viewLRect: LRect; (panel: TPanel; (boxView: TBoxView; (aSelection: TSelection; $BEGIN ({$IFC fTrace}BP(10);{$ENDC} )panel := TPanel.CREATE(NIL, SELF.Heap, SELF, 0, 0, [aScroll, aSplit], [aScroll, aSplit]); (SetLRect(viewLRect, 0, 0, 5000, 3000); (boxView := TBoxView.CREATE(NIL, SELF.Heap, panel, viewLRect); (boxView.InitBoxList(SELF.Heap); ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.NewCommand(cmdNumber: TCmdNumber): TCommand; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 0NewCommand := TClearAllCmd.CREATE(NIL, SELF.heap, cmdNumber, RTBoxView(SELF.selectPanel.view)); ,OTHERWISE 0NewCommand := SUPERSELF.NewCommand(cmdNumber); ,END; ({$IFC fTrace}EP;{$ENDC} $END; $FUNCTION TBoxWindow.CanDoCommand(cmdNumber: TCmdNumber; VAR checkIt: BOOLEAN): BOOLEAN; $BEGIN ({$IFC fTrace}BP(11);{$ENDC} (CASE cmdNumber OF ,uClearAll: 4CanDoCommand := TRUE; ,OTHERWISE 0CanDoCommand := SUPERSELF.CanDoCommand(cmdNumber, checkIt); ,END; ({$IFC fTrace}EP;{$ENDC} $END; END; 3. "6F^9D!$ǐ^'3. "6F^9D!$ǐ^; P8BOXER.TEXT 1 3 2500 $-#BOOT-TK/PABC ; Apple building block phrase files can be included here 1000 8Boxer ; Other application alerts can be included here, numbered between 1001 and 32000 0 1 $-#BOOT-TK/PABC~File/Print 2 Edit Undo Last Change#205 - Cut/X#202 Copy/C#201 Paste/V#203 Duplicate/D#1011 - Clear Box#208 Clear All/Z#1012 - 3 Shades White#1006 Light Gray#1007 Gray#1008 Dark Gray#1009 Black#1010 5 $-#BOOT-TK/PABC~Page Layout 99 $-#BOOT-TK/PABC~Debug 100 $-#BOOT-TK/PABC~Buzzwords Create Box#2000 Move Box#2001 0 3. "6F^9exD!$ǐ^  wsVIN ({$IFC fTrace}BP(12);{$ENDC} (TBoxView(SELF.image).boxList.InsLast(SELF.newBox); (SELF.newBox := NIL; ({$IFC fTrace}EP;{$ENDC} $END; $PROCEDURE {TCreateCmd.} UpdateSBddXEXT"jLxxEXT 6Æd TRàØZN6øOpOpXX0T28 SLOT2CHAN1 ;no assembler files $ ;no building blocks $ ;no links $ y y n BoxNum8 %F B-TK3-TK/=,-#BOOT-$ Y B-TK3-IconEdit.OBJ,-#BOOT-$ B-LOWER-M1BOXER.TEXT,$ B-LOWER-U1BOXER=.TEXT,$ Y B-LOWER-P1BOXER.TEXT,$ B-LOWER-X1BOXER.TEXT,$ B-LOWER-M2BOXER.TEXT,$ B-LOWER-U2BOXER=.TEXT,$ Y B-LOWER-P2BOXER.TEXT,$ B-LOWER-X2BOXER.TEXT,$ B-LOWER-M3BOXER.TEXT,$ B-LOWER-U3BOXER=.TEXT,$ Y B-LOWER-P3BOXER.TEXT,$ B-LOWER-X3BOXER.TEXT,$ B-LOWER-M4BOXER.TEXT,$ B-LOWER-U4BOXER=.TEXT,$ Y B-LOWER-P4BOXER.TEXT,$ B-LOWER-X4BOXER.TEXT,$ B-LOWER-M5BOXER.TEXT,$ B-LOWER-U5BOXER=.TEXT,$ Y B-LOWER-P5BOXER.TEXT,$ B-LOWER-X5BOXER.TEXT,$ B-LOWER-M6BOXER.TEXT,$ B-LOWER-U6BOXER=.TEXT,$ Y B-LOWER-P6BOXER.TEXT,$ B-LOWER-X6BOXER.TEXT,$ B-LOWER-M7BOXER.TEXT,$ B-LOWER-U7BOXER=.TEXT,$ Y B-LOWER-P7BOXER.TEXT,$ B-LOWER-X7BOXER.TEXT,$ B-LOWER-M8BOXER.TEXT,$ B-LOWER-U8BOXER=.TEXT,$ Y B-LOWER-P8BOXER.TEXT,$ B-LOWER-X8BOXER.TEXT,$ Q %% %%% %%% $$$$$$$$$$ $ $ $ $ $$$$$$$$$$$$$ O              )*(+)*-.,/-.NOMPNQORPQ T US VT U X YW ZX [Y \Z [ ^ _] `^ a_ b` ca db ec fd  ge  hf  ig  jh  ki lj mk nl om pn qo rp sq tr us vt wu xv yw zx {y |z }{  ~| !} "~ #                                                                                      O  !" #!$" %# &$ '% (& )'*(+),*+./-0./231423 6 75 86 7!:!;9!<:!=;!><!?=!@>!?"B"CA"DB"EC"FD"GE"HF"IG"JH" KI" LJ" MK" NL" OM"PN"QO"RP"SQ"TR"S#V#WU#XV#W$Z$[Y$\Z$[%^%_]%`^%_&b&ca&db&ec&fd&ge&hf&ig&jh& i'l'mk'nl'om'pn'qo'rp'sq'tr' us' vt' wu' xv' yw'zx'{y'|z'}{'~|'}'~'''(((())))****++++++++++ + + ,,,,,,,,,, , , , , ,,,,,,,,,,,,,,,,,,, ,!,",#,$,%----....////0000000000 0 0 0 0 1111111111 1 1 1 1 1111111111111111111 1!1"1#1$1%1&1'1(1)22223 3  3  3 44 445555555555 5 5 5 5 5 5!5" 5#!5$"5#6&6'%6(&6)'6*(6+)6,*6-+6.,6 /-6 0.6 1/6 206 316426536646756866976:86;96<:6=;6><6?=6@>6A?6B@6CA6DB6EC6 FD6!GE6"HF6#IG6$JH6%KI6&LJ6'MK6(NL6)OM6*PN6+QO6,RP6-SQ6.TR6/US60VT61WU62XV63YW64ZX65[Y66\Z67][68^\69_]6:`^6;a_6db6?c7f7ge7hf7g8j8ki8lj8k%9n9om9pn9o:r:sq:tr:s:vt:u