DIRECTORY Menus USING [ChangeNumberOfLines], Rope USING [Concat, Equal, ROPE], TiogaDocumentsCache, TiogaDocumentPrivate, TiogaProfile USING [showUnsavedDocumentsList], ViewerClasses USING [Viewer], ViewerOps USING [CreateViewer, DestroyViewer, EstablishViewerPosition, PaintViewer], ViewerTools USING [SetContents]; TiogaDocumentsCache2Impl: CEDAR MONITOR IMPORTS Menus, Rope, TiogaProfile, ViewerOps, ViewerTools, TiogaDocumentsCache EXPORTS TiogaDocumentsCache = BEGIN OPEN TiogaDocumentsCache, TiogaDocumentPrivate; viewer: ViewerClasses.Viewer; Update: PUBLIC ENTRY PROC = { ENABLE UNWIND => NULL; rope: ROPE _ GetList[]; -- this is monitored, so get consistent list viewerName: ROPE = "Unsaved Documents List"; ViewerOk: PROC RETURNS [BOOL] = { RETURN [viewer # NIL AND ~viewer.destroyed AND viewer.file=NIL AND Rope.Equal[viewer.name, viewerName]] }; IF ~TiogaProfile.showUnsavedDocumentsList THEN RETURN; IF rope=NIL THEN { IF ViewerOk[] THEN ViewerOps.DestroyViewer[viewer]; RETURN }; IF ~ViewerOk[] THEN { viewer _ ViewerOps.CreateViewer[flavor: $Text, info: [name: viewerName, iconic: TRUE], paint: FALSE]; Menus.ChangeNumberOfLines[viewer.menu, 0]; -- don't let user mess with it ViewerOps.EstablishViewerPosition[viewer, viewer.wx, viewer.wy, viewer.ww, viewer.wh]; ViewerOps.PaintViewer[viewer, all] }; rope _ Rope.Concat["The following files were edited but not saved. They may still be restored with edits intact simply by loading them. If you really want to get rid of the edits, load the file and hit Reset.\n", rope]; ViewerTools.SetContents[viewer, rope]; viewer.newVersion _ TRUE; -- set edited bit ViewerOps.PaintViewer[viewer, caption] }; -- repaint the caption END. RTiogaDocumentsCache2Impl.mesa; Edited by Paxton on October 21, 1982 9:33 am ÊǘJšÏcK™KJ˜šÏk ˜ Jšœžœ˜"Jšœžœžœ˜!Jšœ˜J˜Jšœ žœ˜.Jšœžœ ˜Jšœ žœE˜TJšœ žœ˜ J˜—Jšœž ˜'J˜JšžœG˜NJšžœžœ˜J˜Jšžœžœ+˜5J˜J˜J˜šÏnœž œžœ˜Jšžœžœžœ˜Jšœžœ,˜DJšœ žœ˜,šŸœžœžœžœ˜!š žœ žœžœžœ žœž˜BJ˜'——Jšžœ(žœžœ˜6šžœžœž˜Jšžœ žœ!˜3Jšžœ˜ —šžœ žœ˜˜GJšœžœ žœ˜—Jšœ*˜IJšœV˜VJšœ&˜&—J˜ÝJ˜&Jšœžœ˜+Jšœ*˜@J˜—Jšžœ˜J˜—…—¦¿