<> <> <> DIRECTORY ChoiceButtons USING [UpdateChoiceButtons], Convert USING [RopeFromInt, RopeFromReal], Graph USING [CaretIndex, ColorIndex, Entity, EntityList, FontIndex, NumberOfColors, NumberOfFonts, ROPE, Text, Texts, XY], GraphConvert USING [RopeFromJustifX, RopeFromJustifY, RopeFromMark, RopeFromSDL, RopeOfSlope], GraphPrivate USING [EntityGroupList, GraphAtomProc, GraphHandle, PaintEntity, PaintText], GraphUtil USING [BlinkMsg, ControllerNotNil, Crosssections, EntityFromId, GetIntField, GetRealField, HandleNotNil, InitSegAll, PanelIndexedEntity, PanelIndexedText, RaiseError, SetIntField, SetRealField, SetToggleColor, TextFromId], Rope USING [Cat], ViewerTools USING [SetContents]; GraphResume: CEDAR PROGRAM IMPORTS ChoiceButtons, Convert, GraphConvert, GraphPrivate, GraphUtil, Rope, ViewerTools EXPORTS GraphPrivate = { OPEN Graph, GraphPrivate, GraphUtil; Resume: PUBLIC GraphAtomProc = { <> <> <> <> IF HandleNotNil[handle] THEN IF ControllerNotNil[handle.controller] THEN { OPEN handle; msg: ROPE; i: INT; r: REAL; SELECT atom FROM $Divisions => ResumeDivisionsFields[handle]; $Bounds => ResumeBoundsFields[handle]; $Carets => ResumeCaretsFields[handle]; $Primary => ResumeCaretFields[handle, primary]; $Secondary => ResumeCaretFields[handle, secondary]; $Slope => ResumeSlopeFields[handle]; $TextCaret => ResumeCaretFields[handle, text]; $Targets => ResumeTargetsFields[handle]; <<$TargetX => ResumeTargetFields[handle, x];>> <<$TargetY => ResumeTargetFields[handle, y];>> $Grids => ResumeGridsFields[handle]; $Color => { [msg, i] _ GetIntField[controller.colorIndex]; IF msg = NIL THEN IF i IN ColorIndex THEN ResumeColorFields[handle, i] ELSE BlinkMsg[Rope.Cat[ "Index must be in [0..", Convert.RopeFromInt[NumberOfColors], ")"]]; }; $Font => { [msg, i]_ GetIntField[controller.fontIndex]; IF msg = NIL THEN IF i IN FontIndex THEN ResumeFontFields[handle, i] ELSE BlinkMsg[Rope.Cat[ "Index must be in [0..", Convert.RopeFromInt[NumberOfFonts], ")"]]; }; $Text => { text: Text _ PanelIndexedText[controller, allTexts]; IF text = NIL THEN BlinkMsg["No text with this id."] ELSE ShowText[handle, text]; }; $XEntry => ResumeXButtonField[handle]; $Entity => { entity: Entity _ PanelIndexedEntity[controller, entityHash]; IF entity = NIL THEN BlinkMsg["No entity with this id."] ELSE IF entity # entity.group.x THEN ShowEntity[handle, entity]; }; <<$CurveGroup => {>> <<[msg, i] _ GetIntField[controller.groupId, "id"];>> <> <> <> ViewerTools.SetContents[controller.entityValues, GraphConvert.RopeFromSDL[entity.segments]]; }; }; -- ResumeEntityFields <> <> <> <> <<}; -- ResumeCurveGroupFields>> ResumeCrossSectionFields: PROC[handle: GraphHandle, x: REAL] = { OPEN handle; rope, tRope: ROPE _ NIL; ok: BOOL; y: REAL; FOR el: EntityList _ graph.entityList, el.rest UNTIL el = NIL DO [ok, y] _ Crosssections[el.first.group.x.segments, el.first.segments, x]; tRope _ IF ok THEN Convert.RopeFromReal[y] ELSE "(*)"; rope _ IF rope = NIL THEN tRope ELSE rope.Cat[" ", tRope]; ENDLOOP; <> ViewerTools.SetContents[controller.xsectionYs, rope]; }; -- ResumeCrossSectionFields }. LOG. SChen, created at October 9, 1985 6:53:56 pm PDT.