DIRECTORY FS USING [ComponentPositions, Error, ExpandName], Graph USING [BackgroundIndex, CaretIndex, ColorMap, ColorMode, Error, GraphHandle, GraphProc, ROPE, Viewer], GraphCleanUp USING [CleanUpHandle], GraphOps USING [Lock, Unlock], GraphPrivate USING [CallWithLock, GetGraph, PaintAll, Print, RemoveAllCurves, ShowChart, ShowController, SwitchAuto, SwitchCaretVisibility, SwitchCaretBlinking, SwitchSlope, SwitchTarget, SwitchGrid, UserEditAllowed, WriteGraphFile, WriteTextFile], GraphUtil USING [BlinkMsg, ControllerNotNil, HandleFromViewer, HandleNotNil, ReplaceFileExt, SetCursorForBackgroundIndex, UseCedarColors, UseDefaultColors, UseMyColors, WDirOfViewer], Menus USING [AppendMenuEntry, CreateEntry, CreateMenu, GetNumberOfLines, Menu, MenuLine, MenuProc, MouseButton], PopUpSelection USING [Request], Rope USING [Concat, Find, IsEmpty], Terminal USING [ColorCursorPresentation, Current, SetColorCursorPresentation, Virtual], TiogaMenuOps USING [AllLevels, FewerLevels, FirstLevelOnly, MoreLevels], ViewerBLT USING [ChangeNumberOfLines], ViewerOps USING [FindViewer, MoveViewer, OpenIcon, PaintViewer, SaveViewer, TopViewer], ViewerTools USING [GetSelectionContents, MakeNewTextViewer]; GraphMenus: CEDAR MONITOR IMPORTS FS, Graph, GraphCleanUp, GraphOps, GraphPrivate, GraphUtil, Menus, PopUpSelection, Rope, Terminal, TiogaMenuOps, ViewerBLT, ViewerOps, ViewerTools EXPORTS GraphPrivate = { OPEN Graph, GraphOps, GraphPrivate, GraphUtil; ControllerMenus: PUBLIC PROC [] RETURNS [menu: Menus.Menu] = { ENABLE UNWIND => NULL; menu _ Menus.CreateMenu[2]; Menus.AppendMenuEntry [menu, Menus.CreateEntry[name: "Chart", proc: ShowChartProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry[name: "Spec", proc: ShowSpecProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry[name: "Values", proc: ShowXYsProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry[name: "Table", proc: ShowTableProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry[name: "Levels", proc: LevelsProc]]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "AutoDiv", proc: AutoDivisionsProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "AutoBounds", proc: AutoBoundsProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "Xhair1", proc: PrimXhairProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "Xhair2", proc: SecXhairProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "Slope", proc: SlopeProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "TextCaret", proc: TextCaretProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "TargetX", proc: TargetXProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "TargetY", proc: TargetYProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "GridX", proc: GridXProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "GridY", proc: GridYProc], 1]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "FirstLevelOnly", proc: FirstLevelOnlyProc], 2]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "MoreLevels", proc: MoreLevelsProc], 2]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "FewerLevels", proc: FewerLevelsProc], 2]; Menus.AppendMenuEntry[ menu, Menus.CreateEntry[name: "AllLevels", proc: AllLevelsProc], 2]; }; -- ControllerMenus ShowSpecProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF ControllerNotNil[handle.controller] THEN { OPEN handle.controller; IF NOT specVisible THEN { specVisible _ TRUE; -- rule always goes with spec. xysVisible _ tableVisible _ FALSE; ViewerOps.MoveViewer[viewer: xys, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; IF table # NIL THEN ViewerOps.MoveViewer[ viewer: table, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; ViewerOps.MoveViewer[viewer: spec, x: 0, y: 0, w: viewer.ww, h: 400, paint: TRUE]; }; }; }; CallWithLock[handle, proc]; }; -- ShowSpecProc ShowXYsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF ControllerNotNil[handle.controller] THEN { OPEN handle.controller; IF NOT xysVisible THEN { xysVisible _ TRUE; specVisible _ tableVisible _ FALSE; -- rule always goes with spec. ViewerOps.MoveViewer[viewer: spec, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; IF table # NIL THEN ViewerOps.MoveViewer[ viewer: table, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; ViewerOps.MoveViewer[viewer: xys, x: 0, y: 0, w: viewer.ww, h: 1000, paint: TRUE]; }; }; }; CallWithLock[handle, proc]; }; -- ShowXYsProc ShowTableProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF ControllerNotNil[handle.controller] THEN { OPEN handle.controller; IF NOT tableVisible THEN { tableVisible _ TRUE; specVisible _ xysVisible _ FALSE; -- rule always goes with spec. ViewerOps.MoveViewer[viewer: spec, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; ViewerOps.MoveViewer[viewer: xys, x: 1000, y: 0, w: 0, h: 0, paint: FALSE]; IF table # NIL THEN ViewerOps.MoveViewer[ viewer: table, x: 0, y: 0, w: viewer.ww, h: 1000, paint: TRUE]; }; }; }; CallWithLock[handle, proc]; }; -- ShowTableProc ShowChartProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; Lock[handle]; ShowChart[handle]; -- will unlock handle. - No more, 11/13/85. Unlock[handle]; -- added this on 11/13/85. }; -- ShowChartProc LevelsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; IF HandleNotNil[handle] THEN { Lock[handle]; { OPEN handle; numLines: Menus.MenuLine _ Menus.GetNumberOfLines[controller.menu]; SELECT numLines FROM 2 => numLines _ 3; 3 => numLines _ 2; ENDCASE => ERROR; ViewerBLT.ChangeNumberOfLines[controller.viewer, numLines]; }; Unlock[handle]; }; }; -- SwitchesProc SwitchIt: PROC [wasOn: BOOL, mouseButton: Menus.MouseButton, label: ROPE] RETURNS [BOOL] = { RETURN[SELECT mouseButton FROM red => NOT wasOn, blue => wasOn, ENDCASE => SELECT PopUpSelection.Request[ header: label, choice: LIST["on (red)", "off (blue)"], default: 1] FROM 1 => NOT wasOn, 2 => wasOn, ENDCASE => FALSE]; }; -- SwitchIt AutoDivisionsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; IF SwitchIt[graph.auto[divisions], mouseButton, "Auto Divisions"] THEN SwitchAuto[handle, divisions]; }; CallWithLock[handle, proc]; }; -- AutoDivisionsProc AutoBoundsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; IF SwitchIt[graph.auto[bounds], mouseButton, "Auto Bounds"] THEN SwitchAuto[handle, bounds]; }; CallWithLock[handle, proc]; }; -- AutoBoundsProc PrimXhairProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; SwitchCaret[parent, mouseButton, primary, shift]; }; SecXhairProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; SwitchCaret[parent, mouseButton, secondary, shift]; }; TextCaretProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; SwitchCaret[parent, mouseButton, text, shift]; }; SwitchCaret: PROC[parent: REF ANY, mouseButton: Menus.MouseButton, index: CaretIndex, shift: BOOL] = { handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; IF shift THEN { IF SwitchIt[chart.caretState[index].toBlink, mouseButton, "Blinking"] THEN { SwitchCaretBlinking[handle, index]; IF chart.caretState[index].toBlink AND NOT graph.caret[index].on THEN SwitchCaretVisibility[handle, index]; } } ELSE IF SwitchIt[graph.caret[index].on, mouseButton, "Caret"] THEN SwitchCaretVisibility[handle, index]; }; CallWithLock[handle, proc]; }; -- SwitchCaret SlopeProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; IF SwitchIt[graph.showSlope, mouseButton, "Slope"] THEN SwitchSlope[handle]; }; CallWithLock[handle, proc]; }; -- SlopeProc TargetXProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF SwitchIt[handle.graph.target[x].on, mouseButton, "Target X"] THEN SwitchTarget[handle, x]}; CallWithLock[handle, proc]; }; -- TargetXProc TargetYProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF SwitchIt[handle.graph.target[y].on, mouseButton, "Target X"] THEN SwitchTarget[handle, y]}; CallWithLock[handle, proc]; }; -- TargetYProc GridXProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF SwitchIt[handle.graph.grids[x], mouseButton, "Vertical Grids"] THEN SwitchGrid[handle, x]}; CallWithLock[handle, proc]; }; -- GridXProc GridYProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { IF SwitchIt[handle.graph.grids[y], mouseButton, "Horiz. Grids"] THEN SwitchGrid[handle, y]}; CallWithLock[handle, proc]; }; -- GridYProc FirstLevelOnlyProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = {TiogaMenuOps.FirstLevelOnly[handle.controller.table]}; CallWithLock[handle, proc]; }; -- FirstLevelOnlyProc MoreLevelsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = {TiogaMenuOps.MoreLevels[handle.controller.table]}; CallWithLock[handle, proc]; }; -- MoreLevelsProc FewerLevelsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = {TiogaMenuOps.FewerLevels[handle.controller.table]}; CallWithLock[handle, proc]; }; -- FewerLevelsProc AllLevelsProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = {TiogaMenuOps.AllLevels[handle.controller.table]}; CallWithLock[handle, proc]; }; -- AllLevelsProc ChartMenus: PUBLIC PROC [] RETURNS [menu: Menus.Menu] = { ENABLE UNWIND => NULL; menu _ Menus.CreateMenu[]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Color", SetColorProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Cursor", SetCursorColorProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Background", SetBackgroundIndexProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Get", GetGraphProc]]; --, guarded: TRUE]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Merge", MergeGraphProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Store", PutGraphProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["List", ListGraphProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Interpress", InterpressProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Clear/Refresh", ClearRefreshProc]]; Menus.AppendMenuEntry [menu, Menus.CreateEntry["Controller", ShowControllerProc]]; }; -- ChartMenus SetColorProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; newColorMap: ColorMap; newColorMode: ColorMode; SELECT PopUpSelection.Request[ header: "Options", choice: LIST[ "my colors", "graph default colors", "my colors _ graph default", "cedar default colors", "black and white" ], default: 1] FROM 1 => {newColorMode _ color; newColorMap _ mine}; 2 => {newColorMode _ color; newColorMap _ default}; 3 => {newColorMode _ color; newColorMap _ replace}; 4 => {newColorMode _ color; newColorMap _ cedar}; 5 => {newColorMode _ bw; newColorMap _ colorMap}; ENDCASE => {newColorMode _ colorMode; newColorMap _ colorMap}; SetCursorForBackgroundIndex[backgroundIndex]; IF colorMode # newColorMode THEN { colorMode _ newColorMode; PaintAll[handle, TRUE, FALSE, TRUE]; }; IF colorMap # newColorMap THEN { colorMap _ newColorMap; SELECT newColorMap FROM mine => UseMyColors[handle]; cedar => UseCedarColors[]; default => UseDefaultColors[]; replace => UseDefaultColors[handle]; ENDCASE; }; }; -- proc CallWithLock[handle, proc]; }; -- SetColorProc SetCursorColorProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; virtual: Terminal.Virtual _ Terminal.Current[]; SELECT PopUpSelection.Request[ header: "Options", choice: LIST["black", "white"], default: 1] FROM 1 => [] _ Terminal.SetColorCursorPresentation[virtual, onesAreBlack]; 2 => [] _ Terminal.SetColorCursorPresentation[virtual, onesAreWhite]; ENDCASE => SetCursorForBackgroundIndex[backgroundIndex]; -- * }; CallWithLock[handle, proc]; }; -- SetCursorColorProc SetBackgroundIndexProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; newBkGndIndex: BackgroundIndex = SELECT PopUpSelection.Request[ header: "Options", choice: LIST["white", "gray", "dark gray", "black"], default: 1] FROM 1 => white, 2 => gray, 3 => darkGray, 4 => black, ENDCASE => backgroundIndex; IF backgroundIndex # newBkGndIndex THEN { backgroundIndex _ newBkGndIndex; SetCursorForBackgroundIndex[backgroundIndex]; PaintAll[handle, TRUE, FALSE, TRUE]; }; }; CallWithLock[handle, proc]; }; -- SetBackgroundIndexProc GetGraphProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; file, msg: ROPE _ NIL; [file, msg] _ SelectedFile[WDirOfViewer[chart.viewer], "graph"]; IF msg = NIL THEN { SELECT PopUpSelection.Request[ header: "Confirm replacing data with", choice: LIST[file], default: 1] FROM 1 => { handle _ GraphCleanUp.CleanUpHandle[handle, FALSE]; msg _ GetGraph[handle, file ! Error => {msg _ info; CONTINUE}]; IF msg = NIL THEN { -- replace the caption. handle.chart.viewer.name _ file; ViewerOps.PaintViewer[handle.chart.viewer, caption, FALSE, NIL]; }; }; ENDCASE; }; IF msg # NIL THEN BlinkMsg[msg]; }; IF UserEditAllowed[handle] THEN CallWithLock[handle, proc]; }; -- GetGraphProc SelectedFile: PROC [defaultWDir, defaultExt: ROPE] RETURNS [file, msg: ROPE _ NIL] = { file _ ViewerTools.GetSelectionContents[]; IF file.IsEmpty[] THEN msg _ "Please select a file name." ELSE { [file, ] _ FS.ExpandName[file, defaultWDir ! FS.Error => {msg _ error.explanation; CONTINUE}]; IF msg = NIL THEN IF file.Find["."] < 0 THEN file _ ReplaceFileExt[file, defaultExt]; }; }; -- SelectedFile MergeGraphProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; file, msg: ROPE _ NIL; [file, msg] _ SelectedFile[WDirOfViewer[chart.viewer], "graph"]; IF msg = NIL THEN { SELECT PopUpSelection.Request[ header: "Confirm merging data from", choice: LIST[file], default: 1] FROM 1 => msg _ GetGraph[handle, file ! Error => {msg _ info; CONTINUE}]; ENDCASE; }; IF msg # NIL THEN BlinkMsg[msg]; }; IF UserEditAllowed[handle] THEN CallWithLock[handle, proc]; }; -- MergeGraphProc ListGraphProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; file, msg: ROPE _ NIL; [file, msg] _ SelectedFile[WDirOfViewer[chart.viewer], "list"]; IF file.Find["/", 1] > 1 OR file.Find["]"] > 1 THEN msg _ "Please specify a local directory."; IF msg = NIL THEN { SELECT PopUpSelection.Request[ header: "Confirm listing data in", choice: LIST[file], default: 1] FROM 1 => { v: Viewer; msg _ WriteTextFile[handle, file]; v _ ViewerOps.FindViewer[file]; IF v = NIL THEN { v _ ViewerTools.MakeNewTextViewer[info: [name: file, file: file]]; ViewerOps.SaveViewer[v]; }; IF v.iconic THEN ViewerOps.OpenIcon[icon: v, bottom: FALSE] ELSE ViewerOps.TopViewer[viewer: v]; }; ENDCASE; }; IF msg # NIL THEN BlinkMsg[msg]; }; CallWithLock[handle, proc]; }; -- ListGraphProc PutGraphProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; file, msg, newName: ROPE; [file, msg] _ SelectedFile[WDirOfViewer[chart.viewer], "graph"]; IF file.Find["/", 1] > 1 OR file.Find["]"] > 1 THEN msg _ "Please specify a local directory."; IF msg = NIL THEN { SELECT PopUpSelection.Request[ header: "Confirm file name", choice: LIST[file], default: 1] FROM 1 => [msg, newName] _ WriteGraphFile[handle, file ! Error => {msg _ info; CONTINUE}]; ENDCASE; }; IF msg = NIL THEN BlinkMsg[newName.Concat[" is written."]] ELSE BlinkMsg[msg] }; CallWithLock[handle, proc]; }; -- PutGraphProc InterpressProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; file, msg: ROPE _ NIL; printingColorMode, colorModeSave: ColorMode; SELECT PopUpSelection.Request[ header: "Options", choice: LIST["color", "black and white"], default: 1] FROM 1 => printingColorMode _ color; 2 => printingColorMode _ bw; ENDCASE => msg _ "You must choose either color or black-and-white."; IF msg = NIL THEN [file, msg] _ SelectedFile[WDirOfViewer[chart.viewer], "ip"]; IF file.Find["/", 1] > 1 OR file.Find["]"] > 1 THEN msg _ "Please specify a local directory."; IF msg = NIL THEN SELECT PopUpSelection.Request[ header: "Confirm writing interpress master in", choice: LIST[file], default: 1] FROM 1 => { colorModeSave _ colorMode; colorMode _ printingColorMode; msg _ Print[handle, file ! Error => {msg _ info; CONTINUE}]; IF msg = NIL THEN msg _ file.Concat[" is written."]; colorMode _ colorModeSave; }; ENDCASE; BlinkMsg[msg]; }; CallWithLock[handle, proc]; }; -- InterpressProc ClearRefreshProc: ENTRY Menus.MenuProc = { ENABLE UNWIND => NULL; handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; SELECT PopUpSelection.Request[ header: "Options", choice: LIST["refresh", "clear and refresh", "update div/bounds", "remove all curves"], default: 1] FROM 1 => PaintAll[handle, FALSE, FALSE, TRUE]; 2 => PaintAll[handle, TRUE, FALSE, TRUE]; 3 => PaintAll[handle, TRUE, TRUE, TRUE]; 4 => RemoveAllCurves[handle]; ENDCASE; }; CallWithLock[handle, proc]; }; -- ClearRefreshProc ShowControllerProc: ENTRY Menus.MenuProc = { handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; IF UserEditAllowed[handle] THEN { proc: GraphProc = { ShowController[handle, WDirOfViewer[handle.chart.viewer]]; }; CallWithLock[handle, proc]; }; }; -- ShowControllerProc }. LOG. SChen, create at October 9, 1985 6:41:19 pm PDT GraphMenus.mesa, Copyright 1985, 1987 by Xerox Corporation. All rights reserved. Last Edited by: Christian Le Cocq April 27, 1987 5:48:33 pm PDT Sweetsun Chen, November 27, 1985 3:42:10 pm PST TiogaOps USING [Jump, ViewerDoc], menus switches levels menus menuprocs show up the spec panel ViewerOps.MoveViewer[viewer: rule, x: 0, y: 399, w: rule.ww, h: 1, paint: FALSE]; ViewerOps.PaintViewer[viewer: viewer, hint: client]; show up the XY values panel ViewerOps.MoveViewer[viewer: rule, x: 1000, y: 0, w: rule.ww, h: 1, paint: FALSE]; ViewerOps.PaintViewer[viewer: viewer, hint: client]; show up the table of texts and curves ViewerOps.MoveViewer[viewer: rule, x: 1000, y: 0, w: rule.ww, h: 1, paint: FALSE]; ViewerOps.PaintViewer[viewer: viewer, hint: client]; handle.waitingGraph _ TRUE; AutoBoundsProc: Menus.MenuProc = { handle: GraphHandle _ HandleFromViewer[NARROW[parent]]; proc: GraphProc = { OPEN handle; wasOn: BOOL _ graph.auto[bounds]; update, switchIt: BOOL _ TRUE; SELECT mouseButton FROM red => switchIt _ NOT wasOn; blue => switchIt _ wasOn; ENDCASE => SELECT PopUpMenu.RequestSelection[ label: "Auto Bounds", choice: LIST["on (red)", "off (blue)"], default: 1] FROM 1 => switchIt _ NOT wasOn; 2 => switchIt _ wasOn; ENDCASE => switchIt _ update _ FALSE; IF switchIt THEN SwitchAuto[handle, bounds] ELSE IF update AND wasOn THEN { IF chart.viewer = NIL THEN graph.bounds _ DataBounds[graph.entityList, graph.bounds] ELSE PaintAll[handle]; }; }; CallWithLock[handle, proc]; }; -- AutoBoundsProc menuprocs [parent: REF, clientData: REF, mouseButton: MouseButton, shift, control: BOOL] chart.viewer (parent) # nil try selected viewer first. v: Viewer _ ViewerTools.GetSelectedViewer[]; IF v = NIL THEN msg _ hint ELSE IF v.class.flavor = $Text THEN file _ v.file :Icode "cedar" styleSS "cedar" styleK "cedar" style/K "cedar" style,k/ "cedar" style K "cedar" style)1K "cedar" styleS lK "cedar" style #K "cedar" style K "cedar" style K "cedar" style K "cedar" styleepK "cedar" style K "cedar" style#K "cedar" style IWK "cedar" style 6HK "cedar" style !K "cedar" style &K "cedar" style HWK "cedar" style +K "cedar" styleK "cedar" style "cedar" styleK "cedar" style>> "cedar" styleK "cedar" style== "cedar" styleK "cedar" style>> "cedar" styleK "cedar" style?? "cedar" styleK "cedar" style==K "cedar" styleK "cedar" style "cedar" styleK "cedar" styleGG "cedar" styleK "cedar" styleGG "cedar" styleK "cedar" styleBB "cedar" styleK "cedar" styleAA "cedar" styleK "cedar" style== "cedar" styleK "cedar" styleEE "cedar" styleK "cedar" styleAA "cedar" styleK "cedar" styleAA "cedar" styleK "cedar" style== "cedar" styleK "cedar" style==K "cedar" styleK "cedar" style  "cedar" styleK "cedar" styleOO "cedar" styleK "cedar" styleGG "cedar" styleK "cedar" styleII "cedar" styleK "cedar" styleEEK "cedar" styleK "cedar" stylec "cedar" styleK "cedar" style  "cedar" style &K "cedar" styleK "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style%E "cedar" style K "cedar" style2K "cedar" style"K "cedar" styleJQK "cedar" styleDK "cedar" style )K "cedar" style18K "cedar" styleLRK "cedar" style44K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style %K "cedar" style  K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style%E "cedar" style K "cedar" style K "cedar" styleBK "cedar" styleELK "cedar" styleKR "cedar" style )K "cedar" style18K "cedar" styleLRK "cedar" style44K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style 'K "cedar" style%K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style%E "cedar" styleK "cedar" styleK "cedar" style@K "cedar" styleELK "cedar" styleKRK "cedar" styleDK "cedar" style )K "cedar" style9?K "cedar" style44K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style 'K "cedar" styleK "cedar" style' 7K "cedar" style K "cedar" styleK "cedar" style+>K "cedar" style*K "cedar" styleK "cedar" style "cedar" style $K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" styleK "cedar" styleCC "cedar" style K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style;;K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style  )\ "cedar" style K "cedar" styleK "cedar" style "cedar" style)K "cedar" style(GK "cedar" styleK "cedar" style K "cedar" styleK "cedar" style K "cedar" style "cedar" style+K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style@eK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style(K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style:\K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style"K "cedar" style' 7 "cedar" style K "cedar" style!K "cedar" style "cedar" style K "cedar" styleK "cedar" style "cedar" style-K "cedar" style(NK "cedar" styleK "cedar" styleK "cedar" style%K "cedar" styleK "cedar" style + "cedar" styleK "cedar" style:TK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style 'K "cedar" styleK "cedar" style11K "cedar" styleK "cedar" style "cedar" style &K "cedar" styleK "cedar" style33K "cedar" styleK "cedar" style "cedar" style 'K "cedar" styleK "cedar" style..K "cedar" styleK "cedar" style "cedar" style  <fK "cedar" style' 7 "cedar" style  "cedar" style "cedar" styleDLK "cedar" style## "cedar" style!EK "cedar" style%%K "cedar" styleK "cedar" styleK "cedar" style7&hK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style #K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style1LK "cedar" styleK "cedar" styleK "cedar" style K "cedar" style "cedar" style %K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style>DK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style &K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style>DK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style #K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style@FK "cedar" styleK "cedar" styleK "cedar" style K "cedar" style "cedar" style #K "cedar" styleK "cedar" style' 7 "cedar" style "cedar" style>DK "cedar" styleK "cedar" styleK "cedar" style K "cedar" style "cedar" style,K "cedar" styleK "cedar" style' 7K "cedar" styleIIK "cedar" styleK "cedar" styleK "cedar" style "cedar" style)K "cedar" styleK "cedar" style' 7K "cedar" styleEEK "cedar" styleK "cedar" styleK "cedar" style "cedar" style)K "cedar" styleK "cedar" style' 7K "cedar" styleFFK "cedar" styleK "cedar" styleK "cedar" style "cedar" style 'K "cedar" styleK "cedar" style' 7K "cedar" styleDDK "cedar" styleK "cedar" styleK "cedar" style "cedar" style 9K "cedar" styleK "cedar" style "cedar" styleK "cedar" style22 "cedar" styleK "cedar" style88 "cedar" styleK "cedar" style@@ "cedar" styleK "cedar" style0E "cedar" styleK "cedar" style33 "cedar" styleK "cedar" style22 "cedar" styleK "cedar" style2 "cedar" styleK "cedar" style9 "cedar" styleK "cedar" style= "cedar" styleK "cedar" styleK "cedar" style-- "cedar" style"K "cedar" styleK "cedar" styleK "cedar" style$K "cedar" style "cedar" style K "cedar" style "cedar" style K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style$K "cedar" styleK "cedar" styleK "cedar" style K "cedar" styleK "cedar" styleK "cedar" style "cedar" style,K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style// "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style K "cedar" styleEEK "cedar" styleEEK "cedar" style2=K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style0K "cedar" styleK "cedar" style' 7 "cedar" style  "cedar" style!?K "cedar" styleK "cedar" style(4K "cedar" style K "cedar" style K "cedar" style K "cedar" styleK "cedar" style K "cedar" style "cedar" style!)K "cedar" style K "cedar" style--K "cedar" style$K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style &K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style K "cedar" style@@ "cedar" style "cedar" styleK "cedar" style/K "cedar" styleK "cedar" style,3K "cedar" style4? "cedar" style+K "cedar" style K "cedar" style4@K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style K "cedar" styleK "cedar" style;K "cedar" styleK "cedar" style "cedar" style  V "cedar" styleK "cedar" style,,K "cedar" style K "cedar" style1K "cedar" style**K "cedar" style#9 "cedar" style "cedar" style ,K "cedar" style$1K "cedar" style )UK "cedar" styleK "cedar" styleK "cedar" style "cedar" style(K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style K "cedar" style@@ "cedar" style "cedar" styleK "cedar" style-IK "cedar" style9DK "cedar" styleK "cedar" styleK "cedar" style K "cedar" styleK "cedar" style;K "cedar" styleK "cedar" style "cedar" style 'K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style K "cedar" style??K "cedar" style+^ "cedar" style "cedar" styleK "cedar" style+G "cedar" styleK "cedar" style K "cedar" style"K "cedar" style "cedar" styleK "cedar" styleBBK "cedar" styleK "cedar" styleK "cedar" style %;K "cedar" style $K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style &K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" styleK "cedar" style@@K "cedar" style+^ "cedar" style "cedar" styleK "cedar" style%A "cedar" style11K "cedar" style#K "cedar" styleK "cedar" styleK "cedar" style):K "cedar" styleK "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style "cedar" style(K "cedar" styleK "cedar" style' 7 "cedar" style K "cedar" style K "cedar" style,, "cedar" styleK "cedar" styleK "cedar" style)K "cedar" style K "cedar" styleK "cedar" styleK "cedar" style=DK "cedar" style>OK "cedar" style+^ "cedar" style0K "cedar" style8T "cedar" styleK "cedar" styleK "cedar" styleK "cedar" style1