home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / apple2 / 66 < prev    next >
Encoding:
Internet Message Format  |  1991-05-11  |  19.0 KB

  1. From: jac@yoko.rutgers.edu (Jonathan A. Chandross)
  2. Newsgroups: comp.sources.apple2
  3. Subject: v001SRC047:  Texter -- text editor (GS Only) Part 01/02
  4. Message-ID: <May.10.15.46.17.1991.13826@yoko.rutgers.edu>
  5. Date: 10 May 91 19:46:18 GMT
  6. Approved: jac@paul.rutgers.edu
  7.  
  8.  
  9. Submitted-by: Joel Sumner (q4kx@cornella.ccs.cornell.edu)
  10. Posting-number: Volume 1, Source:47
  11. Archive-name: editor/texter/part01
  12. Architecture: ONLY_2gs
  13. Version-number: 1.1.1
  14.  
  15. Texter is a text editor for the GS.
  16.  
  17. Enjoy.
  18.  
  19.  
  20. =Read.Me
  21. -
  22. -Texter
  23. -
  24. -Version 1.1.1
  25. -
  26. -I am not perfect so please point out errors, suggestions, etc. to
  27. -me.  I would appreciate knowing what I am doing right or wrong.
  28. -
  29. -This source is compiled with Orca/Pascal (tm Byteworks) and the
  30. -Resource was created with Genesys (tm SSSI) though I created APW
  31. -Rez (tm Apple Computer) source with Genesys so you could see what
  32. -the resource fork was.
  33. -
  34. -Also included is a unit by Dave Lyons of Apple Computer to utilitize
  35. -MessageCenter.  This unit is Public Domain.  I made 1 little change
  36. -to it because of compiler type-checking and such.  His original code
  37. -is still there, enclosed in comments.
  38. -
  39. -This code is for demonstration purposes only.  Please do not re-distribute
  40. -without this header.
  41. -
  42. -If you have any questions, contact me at:
  43. -
  44. -    Joel Sumner
  45. -    19 Fossen Way
  46. -    Andover, MA 01810
  47. -
  48. -    GEnie: JOEL.SUMNER
  49. -    Internet: q4kx@cornella.ccs.cornell.edu
  50. -          q4kx@vax5.cit.cornell.edu
  51. -    Bitnet:   q4kx@CORNELLA
  52. -          q4kx@CRNLVAX5
  53. -
  54. -Release Notes:
  55. -
  56. -    Fixed bug in Version 1.1 where PrDefault() was called every
  57. -    time the user selected "Page Setup" instead of calling
  58. -    PrDefault() when Texter was started up and then PrValidate
  59. -    after that.
  60. -
  61. =Manifest
  62. -
  63. -Read.Me
  64. -icons.bsc
  65. -messunit.pas
  66. -mystuffintf.pas
  67. -texter.doc
  68. -texter.pas
  69. -texter.r.equ
  70. -texter.r.src
  71. -texter2.pas
  72. -
  73. =texter.doc
  74. -
  75. -                        Texter v1.1
  76. -                       By Joel Sumner
  77. -
  78. -Background
  79. -----------
  80. -     This is the next in a continuing series of little programs that
  81. -I have made because I needed them.  This one in particular is
  82. -just a text editor.  Simple enough.  But I couldn't find one
  83. -that allowed you to double-click on the file from the finder
  84. -and have it load the text editor and the file you double-
  85. -clicked upon.  Appleworks GS does this but many other programs
  86. -don't.  Therefore, I decided to write one.  I happened to write
  87. -this the same week that I had two exams and a long paper due.
  88. -I always seem to do that to myself.  Anyway, I hope you like it.
  89. -
  90. -Use
  91. ----
  92. -     You can run Texter one of two ways.  Either run it as a regular
  93. -application just as you would any other program, or you can
  94. -double-click upon a text file in a finder window and Texter
  95. -will automatically be run and the file you clicked upon will
  96. -be run.  You can even select more than one file and double-
  97. -click upon them.  A maximum of 5 files will be loaded though,
  98. -even if you select more than that.
  99. -
  100. -Installation
  101. -------------
  102. -     Included in this archive is the program (Texter), the
  103. -documentation file (Texter.Doc), and an Icon file (Texter.ICN).
  104. -Place the Icon file in the ICONS folder of your boot disk
  105. -and place Texter in the SYSTEM subdirectory of your boot
  106. -disk.  It should now work just fine.
  107. -     If you need to put Texter somewhere besides the SYSTEM
  108. -subdirectory of your boot disk (due to space or preference),
  109. -you will have to edit the attributes of the Icon file to
  110. -reflect the new loaction of Texter.  This can be accomplished
  111. -with one of the Icon Editors out there.  (I recommend DiCeD by
  112. -Dave Lyons.)  Simply load the Icon file into the editor
  113. -and change the attributes like that says:
  114. -
  115. -*/SYSTEM/TEXTER
  116. -
  117. -to whatever pathname that Texter currently resides in.
  118. -(The '*' refers to your boot disk.  My hard drive title is '/js'
  119. -and I boot off it so '*' is the same as '/js')
  120. -
  121. -Note, if you try to run the program and get a text dialog saying
  122. -"Error $1E06", that means that the resource fork was not copied
  123. -properly.  Make sure you extract the archive with GSHK and copy
  124. -it to your destination with the Apple IIgs Finder.
  125. -
  126. -Features
  127. ---------
  128. -     This is pretty no-frills.  You can open up to 5 files at a
  129. -time.  Their full pathname will be displayed in the window
  130. -title and part of their pathname can be seen in the 'Windows'
  131. -menu.  If you have a bunch of windows open and you wish to
  132. -view one of the bottom ones, you can either move all the top
  133. -windows out of the way (slow way), or you can simply select
  134. -that window in the 'Windows' menu (fast way).
  135. -     You can cut and paste text between windows, but the Undo
  136. -command does not function.
  137. -
  138. -Texter uses all of the standard Text Edit shortcuts:
  139. -
  140. -- The arrow keys can be used to move the cursor
  141. -- Control-D or Delete will delete the current selection or the
  142. -  character to the left of the cursor.
  143. -- Clear clears the current selection
  144. -- Control-F removes the current selection or deletes the
  145. -  character to the right of the cursor
  146. -- Control-Y removes all characters from the cursor to the
  147. -  end of the line
  148. -- Control-X cuts the selection like OA-X and Cut
  149. -- Control-C copies the selection like OA-C and Copy
  150. -- Control-V pastes from the clipboard like OA-V and Paste
  151. -- A single click places the cursor where the click was
  152. -- A double click selects the word under the arrow
  153. -- A triple click selects the line under the arrow
  154. -- Holding down shift selects everything from the cursor to the
  155. -  mouse click
  156. -
  157. -You can also print your document.  I assure you that the default
  158. -font (Shaston 8) looks pretty horrid on a printer.  Thus, simply
  159. -select the Choose Font option from the Goodies menu and select
  160. -a better font to print with.  Experiment until you find something
  161. -that looks acceptable.
  162. -
  163. -Finally, you can choose if you want the document word-wrapped or
  164. -not.  Simply select the toggle in the Goodies Menu.  If "Word Wrap On"
  165. -is checked, then the current document has word wrap activated.
  166. -This setting is dependent on the window so turning it on or off
  167. -only affects the current window.
  168. -
  169. -None of the above settings are changed because, after all, this edits
  170. -straight text files, not word processor files.
  171. -
  172. -Other Notes
  173. ------------
  174. -- TextEdit automatically formats your files so they word wrap.
  175. -This takes a certain amount of time.  Thus loading large files
  176. -(200K or more) can take a good amount of time (20-25 seconds)
  177. -to be formatted.  Please be patient.
  178. -- Files cannot be loaded that are more than 1/2 of available
  179. -memory.  This is because two copies of the file must temporarily
  180. -be in memory simultaneously when loading or saving files and
  181. -there would be no memory available to do this.
  182. -
  183. -Conclusion
  184. -----------
  185. -     Well, that's about it.  I hope you enjoy or use this program.
  186. -As you may notice, I have said nothing about money.  That's
  187. -because I don't want any.  This is Freeware.  As a request though,
  188. -if you do actually install it and use it, please drop me a line
  189. -and let me know what you think.  If you send it via E-Mail, even
  190. -the response doesn't cost anything.  If you have any questions,
  191. -comments, or responses, I can be reached at the following
  192. -addresses:
  193. -
  194. -Joel Sumner
  195. -19 Fossen Way
  196. -Andover, MA 01810
  197. -
  198. -GEnie: JOEL.SUMNER
  199. -Internet:
  200. -q4kx@cornella.ccs.cornell.edu
  201. -q4kx@vax5.cit.cornell.edu
  202. -Bitnet:
  203. -q4kx@cornella
  204. -q4kx@crnlvax5
  205. -
  206. -Updates
  207. ---------
  208. -(Version 1.1)
  209. -- Fixed bug that caused an error $206 on startup and prevented printing
  210. -  with anything but the ImageWriter driver.
  211. -- Added Goodies Menu with Word Wrap selection and Font selection.
  212. -- Added 'Formatting Text' dialogs.
  213. -- Better Tool Error dialogs to determine where errors have occurred.
  214. -- New (and improved) icon file.
  215. -
  216. =icons.bsc
  217. -FiLeStArTfIlEsTaRt
  218. -ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789()
  219. -IICONS.BSC      AMQuAAAAAYwwDIAA2qKAq(AHPUhtAMQuAcj0
  220. -GVvTlzW6BcbYAAAAOwCAEkwWAAAAb5ALAQQCAIAAAAAAAAAA5CAAAAwAAAAAAAAA
  221. -GVvTRLJ2BAAPAMAABAAAA8CAAAw4AoMAAAAAAAAAAAgAbFBKAMAHFAAAcslEAAwA
  222. -OwCAEkwWAAAAAAAAAAwAAAAAMAAAAAAAAAAIAAAABAAAAAAAAAAAAgMACAAAAIAA
  223. -AAAAGYAA1AAAAAgAYVEVSVEVDlkLT50TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  224. -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  225. -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  226. -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  227. -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  228. -AAAA4jMAFsNAbHABIwAACCJEPAQqYyLVOc2ktJTnEzjXOB18zJjmhaJJObEWyBDm
  229. -EYAMFBUEEYAwAIhACBABPAwSz0vtm)EAxcQgAWx)AN7l)LAwI4jgn9g(IBAUTI8i
  230. -pTjSwDwPb5PomTlWwoKAjKckqPvmEBQUF4UuqU9y18Z1IiRAADeCP8p1Urv0ASRi
  231. -RJATVLd7pCwW85Lz97e)wgxKICc4ABQQgjDsbNKAFC0HnSZGV6JZV474mbFGJMoh
  232. -8ZzFiFHGZsYx8fXTOLHGnIJyklaYlJd62opTl7fcncf(CFa0VddgrTvyLha0z7)y
  233. -yQl(MXOVl5Un6VnGnVe1MweAgaDuxl7WW7xfwe7iHScee9w09g5bMWsUGiTEyMHz
  234. -QtMcOt27zD6O80wv7CUEwoHgNqIgIogKanVggYi2hDAAKA4BACMAS0LPXeGgYBBn
  235. -ZfBYrFn)u31lD3MuAC(WRc7Ygjz7OtrpOaA3yxcASAAExj27aIqJFbA64GAFK74A
  236. -mnuuPchGHvGaMtoH4RUsqypUbNCSHrGHsj5fh4gBrpwniumy5mGr49ALvwq0tJ9b
  237. -hnCzroKWMaKe7a6CGRoegTgJBkCz6TlvEA6JLokh8KaAq42AC6u70666pppUolpP
  238. -OtuqMiDpFYiSHwv5YE8TmQ9oV4zx(bD60pg7MBrvAAYBLdhQ)EQNvJ42IKbMqyme
  239. -qb5H4m5jAgHYAWOmwsYIii85KvMrUIDrYPKrZXtgF4Jgpp9CgWQpAAwHAAAAAAAA
  240. -AE2e
  241. =messunit.pas
  242. -{$Keep 'MessUnit'}
  243. -UNIT MessUnit;
  244. -{
  245. -  PUBLIC DOMAIN      20-Sep-89      v1.1
  246. -  Easy-to-use interface for reading a list of pathnames
  247. -  passed to an application by the Finder or another
  248. -  program selector.  This list is passed in the Message
  249. -  Center as described in the Tool Locator chapter of
  250. -  the Toolbox Reference, Volume 2.
  251. -  Modified September 1989 for TML Pascal II.
  252. -  To use:
  253. -    Call InitReadMC with a valid memory ID.  If it returns
  254. -    -1, no message was available.  If InitReadMC returns 0
  255. -     or 1, then a list of pathnames is available.  0 means
  256. -     the application should OPEN the files, and 1 means it
  257. -     should PRINT them.
  258. -     Repeatedly call ReadNextMC to get a pathname. It
  259. -     returns FALSE when there are no more pathnames to
  260. -     get.  (To clarify, False means the PREVIOUS call gave
  261. -     you the last available pathname.)
  262. -     Even if you are going to accept only one pathname from
  263. -     the MessageCenter (not recommended), you should still
  264. -     call ReadNextMC until it returns FALSE.  Otherwise some
  265. -     memory will needlessly be left allocated.
  266. -     Tip:  Be sure to allow for people fiddling with their
  267. -     icon files!  Do NOT assume that any pathname given to
  268. -     you by the MessageCenter will specify a file of the
  269. -     type you expect--check.
  270. -     Also, don't assume that the volumes containing the files
  271. -     are necessarily online when your application is launched.
  272. -     You may need to ask the user to insert the correct disk.
  273. -  by David A. Lyons a.k.a. DAL Systems
  274. -  P.O. Box 287
  275. -  North Liberty, IA 52317
  276. -  CompuServe 72177,3233
  277. -  GEnie D.LYONS2
  278. -  AppleLink--PE Dave Lyons
  279. -}
  280. -INTERFACE
  281. -USES Common, ToolLocator, MemoryMgr;
  282. -
  283. -Type     Str255 = string[255];   {My Additions to TYPE}
  284. -         StringPtr = ^Str255;
  285. -
  286. -function  InitReadMC(id: integer): integer;
  287. -function  ReadNextMC(s: StringPtr): boolean;
  288. -IMPLEMENTATION
  289. -type
  290. -  myMessageRec = RECORD
  291. -    messageNext: longint;
  292. -    messageType: integer;
  293. -    messageData: integer;
  294. -    fileNames: packed array[1..32000] of char;
  295. -  END;
  296. -  MessagePtr = ^myMessageRec;
  297. -  MessageH = ^MessagePtr;
  298. -var
  299. -  MsgHand:  MessageH;
  300. -  MsgIndex: integer;
  301. -function InitReadMC;
  302. -var
  303. -  err: integer;
  304. -begin
  305. -  InitReadMC := -1;
  306. -  MsgIndex := 1;
  307. -  MsgHand := MessageH(NewHandle(0,id,attrNoCross,nil));
  308. -  MessageCenter(getMessage,1,Handle(MsgHand));
  309. -  err := ToolError;
  310. -  MessageCenter(deleteMessage,1,nil);
  311. -  if err=0 then
  312. -    InitReadMC := MsgHand^^.messageData
  313. -  else
  314. -    DisposeHandle(handle(MsgHand));
  315. -end;
  316. -function ReadNextMC;
  317. -var
  318. -  len,i: integer;
  319. -  tempStr: Str255;
  320. -begin
  321. -  s^ := '**********';
  322. -  ReadNextMC := false;
  323. -  len := ord(MsgHand^^.FileNames[MsgIndex]);
  324. -  if len<>0 then begin
  325. -    ReadNextMC := true;
  326. -    {BlockMove(@MsgHand^^.FileNames[MsgIndex],ptr(s),len+1);} {Dave's}
  327. -    For i:=0 to len do
  328. -     tempStr[i]:=MsgHand^^.FileNames[MsgIndex+i];    {My [Joel's] Routine}
  329. -    MsgIndex := MsgIndex + len + 1;
  330. -  end else
  331. -    DisposeHandle(handle(MsgHand));
  332. -s^:=TempStr;
  333. -end;
  334. -END.
  335. =mystuffintf.pas
  336. -{$Keep 'MyStuff'}
  337. -Unit MyStuff;
  338. -Interface
  339. -
  340. -Uses     Common,
  341. -         DialogMgr,
  342. -         MscToolSet,
  343. -         WindowMgr,
  344. -         QuickDrawII,
  345. -         {$LibPrefix '0/'}
  346. -         MessUnit;       {Dave Lyon's Unit for Message Center}
  347. -
  348. -
  349. -type
  350. -         SubstArray = Array [0..1] of StringPtr;
  351. -
  352. -var
  353. -         TempTextString:     Str255;
  354. -         result:        Integer;
  355. -         errString:     StringPtr;
  356. -         errStringArr:  SubstArray;
  357. -         errStringPtr:  ^SubstArray;
  358. -
  359. -
  360. -PROCEDURE SystemError (ErrNum : Integer);
  361. -Function cnvihs(theint:integer):StringPtr;
  362. -Procedure ErrorBox(error,where:integer);
  363. -
  364. -Implementation
  365. -PROCEDURE SystemError;
  366. -
  367. -    BEGIN    { This is to save code - we don't need Pascal's Run-Time errors }
  368. -    END;
  369. -
  370. -Function cnvihs;      {converts integer to hex string}
  371. -var tmpStrPtr    :StringPtr;
  372. -    TmpStr       :String;
  373. -    i:        integer;
  374. -begin
  375. -tmpstr[0]:=char(5);
  376. -i:=integer((theint & $F)+48);
  377. -if I<58 then tmpstr[5]:=char(i)
  378. -    else tmpstr[5]:=char(i+7);
  379. -i:=integer((theint & $F0) div $10 +48);
  380. -if I<58 then tmpstr[4]:=char(i)
  381. -    else tmpstr[4]:=char(i+7);
  382. -i:=integer((theint & $F00)div $100 + 48);
  383. -if I<58 then tmpstr[3]:=char(i)
  384. -    else tmpstr[3]:=char(i+7);
  385. -i:=integer((theint & $F000)div $1000 + 48);
  386. -if (I<56) and (I>47) then tmpstr[2]:=char(i)
  387. -    else if (I=40) or (I=41) then tmpstr[2]:=char(I+16)
  388. -    else if I>41 then tmpstr[2]:=char(i+23);
  389. -tmpstr[1]:=char('$');
  390. -TempTextString:=tmpstr;
  391. -tmpstrPtr:=@TempTextString;
  392. -cnvihs:=tmpstrPtr;
  393. -end;
  394. -
  395. -Procedure ErrorBox;   {put error dialog on screen}
  396. -begin
  397. -SysBeep;
  398. -errString:=cnvihs(Error);
  399. -new(ErrStringArr[0]);
  400. -errStringArr[0]^:=errString^;
  401. -errString:=cnvihs(where);
  402. -new(ErrStringArr[1]);
  403. -errStringArr[1]^:=errString^;
  404. -result:=AlertWindow(5,ptr(ErrStringPtr),pointer(2));
  405. -end;
  406. -
  407. -
  408. -END.
  409. =texter.r.equ
  410. -// --------------------------------------------------------------------
  411. -// Genesys created REZ defines
  412. -// Simple Software Systems International, Inc.
  413. -// APWREZ.SCG 1.2
  414. -// --------------------------------------------------------------------
  415. -
  416. -
  417. -// --- type $8004 defines
  418. -
  419. -#define Text_Edit_Control $00000001
  420. -
  421. -// --- type $8006 defines
  422. -
  423. -#define Apple_pString $00000001
  424. -#define File_pString $00000002
  425. -#define Edit_pString $00000003
  426. -#define Windows_pString $00000004
  427. -#define Goodies_pString $00000005
  428. -#define Undo_pString $000000FA
  429. -#define Cut_pString $000000FB
  430. -#define Copy_pString $000000FC
  431. -#define Paste_pString $000000FD
  432. -#define Clear_pString $000000FE
  433. -#define Close_pString $000000FF
  434. -#define About_pString $00000100
  435. -#define Quit_pString $00000101
  436. -#define New_pString $00000102
  437. -#define Open_pString $00000103
  438. -#define Save_pString $00000104
  439. -#define SaveAs_pString $00000105
  440. -#define Page_Setup_pString $00000107
  441. -#define Print_pString $00000108
  442. -#define Window1_pString $00000109
  443. -#define Window2_pString $0000010A
  444. -#define Window3_pString $0000010B
  445. -#define Window4_pString $0000010C
  446. -#define Window5_pString $0000010D
  447. -#define Word_Wrap_pString $0000010E
  448. -#define Choose_Font_pString $0000010F
  449. -#define Text_Window_Title $00010005
  450. -
  451. -// --- type $8008 defines
  452. -
  453. -#define Application_Menu_Bar $00000001
  454. -
  455. -// --- type $8009 defines
  456. -
  457. -#define Apple_Menu $00000001
  458. -#define File_Menu $00000002
  459. -#define Edit_Menu $00000003
  460. -#define Window_Menu $00000004
  461. -#define Goodies_Menu $00000005
  462. -
  463. -// --- type $800A defines
  464. -
  465. -#define Undo_Menu_Item $000000FA
  466. -#define Cut_Menu_Item $000000FB
  467. -#define Copy_Menu_Item $000000FC
  468. -#define Paste_Menu_Item $000000FD
  469. -#define Clear_Menu_Item $000000FE
  470. -#define Close_Menu_Item $000000FF
  471. -#define About_Menu_Item $00000100
  472. -#define Quit_Menu_Item $00000101
  473. -#define New_Menu_Item $00000102
  474. -#define Open_Menu_Item $00000103
  475. -#define Save_Menu_Item $00000104
  476. -#define SaveAs_Menu_Item $00000105
  477. -#define Page_Setup_Item $00000107
  478. -#define Print_Item $00000108
  479. -#define Window1_Item $00000109
  480. -#define Window2_Item $0000010A
  481. -#define Window3_Item $0000010B
  482. -#define Window4_Item $0000010C
  483. -#define Window5_Item $0000010D
  484. -#define Word_Wrap_Item $0000010E
  485. -#define Choose_Font_Item $0000010F
  486. -
  487. -// --- type $800E defines
  488. -
  489. -#define Text_Window $00000FFA
  490. -
  491. -// --- type $8010 defines
  492. -
  493. -#define Text_Window_wColor $00000001
  494. -
  495. -// --- type $8013 defines
  496. -
  497. -#define Tool_Startup_Table $00000001
  498. -
  499. -// --- type $8015 defines
  500. -
  501. -#define Printing_Alert $00000001
  502. -#define Tool_Error_Alert $00000002
  503. -#define Save_Alert $00000003
  504. -
  505. -// --- type $8016 defines
  506. -
  507. -#define Window_Text $00000003
  508. =texter2.pas
  509. -{$Keep 'Texter2'}
  510. -Unit Texter2;
  511. -Interface
  512. -
  513. -Uses     Common,
  514. -         ToolLocator,
  515. -         DialogMgr,
  516. -         ControlMgr,
  517. -         WindowMgr,
  518. -         QuickDrawII,
  519. -         {$LibPrefix '0/'}
  520. -         MessUnit,       {Dave Lyon's Unit for Message Center}
  521. -         MyStuff;
  522. -
  523. -type
  524. -         Document       =
  525. -              RECORD
  526. -                   index:         integer;
  527. -                   InUse:         Boolean;
  528. -                   New:           Boolean;
  529. -                   Saved:         Boolean;
  530. -                   Wrap:          boolean;
  531. -                   DocGSString:   GSOSInString;
  532. -                   DocRef:        Integer;
  533. -                   DocWindow:     GrafPortPtr;
  534. -                   WindowTitle:   Str255;
  535. -              end;
  536. -
  537. -         DocumentPtr    = ^Document;
  538. -
  539. -var      Windows:       Array[1..5] of Document;
  540. -
  541. -Procedure DoAbout;
  542. -procedure NoRun(i:integer);
  543. -Procedure DoToFront(thewind:Integer);
  544. -procedure DrawWindow;
  545. -
  546. -Implementation
  547. -
  548. -
  549. -procedure DrawWindow;
  550. -begin
  551. -DrawControls(GetPort);
  552. -end; { of DrawWindow }
  553. -
  554. -Procedure DoToFront;
  555. -begin
  556. -SelectWindow(Windows[thewind].DocWindow);
  557. -end;
  558. -
  559. -Procedure NoRun;
  560. -var    string2ptr:pStringPtr;
  561. -begin
  562. -string2ptr:=pStringPtr(cnvihs(i));
  563. -result:=TLTextMountVolume(@'Unable to run due to Tool Error #',
  564. -                          string2ptr,
  565. -                          @'Quit',
  566. -                          @'Quit');
  567. -end;
  568. -
  569. -Procedure DoAbout;
  570. -var AboutDlog,
  571. -    ApplicPort:     GrafPortPtr;
  572. -    r:             Rect;
  573. -    itemHit:       Integer;
  574. -
  575. -begin
  576. -ApplicPort:=GetPort;
  577. -   SetRect(r,20,40,320,170);
  578. -   AboutDlog :=NewModalDialog(r,true,0);
  579. -If ToolError<>0 then ErrorBox(ToolError,$1201);
  580. -   SetPort(AboutDlog);
  581. -   SetRect(r,230,18,290,30);
  582. -   NewDItem(AboutDlog,1,r,10,@'Ok',0,0,nil);
  583. -If ToolError<>0 then ErrorBox(ToolError,$1202);
  584. -
  585. -SetForeColor(1);
  586. -MoveTo(65,20);DrawString(@'Texter v1.1');
  587. -SetForeColor(0);
  588. -Moveto(20,35);DrawString(@'Another little Utility by:');
  589. -MoveTo(30,50);DrawString(@'Joel Sumner');
  590. -MoveTo(30,60);DrawString(@'19 Fossen Way');
  591. -MoveTo(30,70);DrawString(@'Andover, MA 01810');
  592. -MoveTo(30,80);DrawString(@'q4kx@cornella.ccs.cornell.edu');
  593. -MoveTo(30,90);DrawString(@'q4kx@CORNELLA.BITNET');
  594. -MoveTo(15,110);DrawString(@'Some code property of ByteWorks and');
  595. -MoveTo(25,120);DrawString(@'Apple Computer Inc. 1986-1989');
  596. -
  597. -   itemHit := ModalDialog(nil);
  598. -If ToolError<>0 then ErrorBox(ToolError,$1203);
  599. -   CloseDialog(AboutDlog);
  600. -If ToolError<>0 then ErrorBox(ToolError,$1204);
  601. -SetPort(ApplicPort);
  602. -end; { of AboutDlog }
  603. -
  604. -END.
  605. -
  606. + END OF ARCHIVE
  607.