CEDAR PROGRAM = { CntrlReset: ActionProc = { OPEN handle; SELECT atom FROM $Divisions => ResetDivisionsFields[handle]; $Bounds => ResetBoundsFields[handle]; $Carets => ResetCaretsFields[handle]; $Targets => ResetTargetsFields[handle]; $Grids => ResetGridsFields[handle]; $Color => { msg: ROPE; index: INT; [msg, index] _ GetIntField[controller.colorIndex]; IF msg # NIL THEN BlinkMsg[msg.Concat[" in parsing the index field."]] ELSE IF index NOT IN ColorIndex THEN BlinkMsg[ Rope.Cat["Index must be in [0..", Convert.RopeFromInt[NumberOfColors], ")"]] ELSE ResetColorFields[handle]; }; $Font => { msg: ROPE; index: INT; [msg, index]_ GetIntField[controller.fontIndex]; IF msg # NIL THEN BlinkMsg[msg.Concat[" in parsing the index field."]] ELSE IF index NOT IN FontIndex THEN BlinkMsg[ Rope.Cat["Index must be in [0..", Convert.RopeFromInt[NumberOfFonts], ")"]] ELSE ResetFontFields[handle]; }; $Text => { msg: ROPE; id: INT; [msg, id] _ GetIntField[controller.textId]; IF msg # NIL THEN BlinkMsg[msg.Concat[" in parsing the id field."]] ELSE { text: Text _ TextFromId[handle.texts, id]; IF text = NIL THEN BlinkMsg[Rope.Concat["There is no text with id = ", Rope.RopeFromInt[id]]] ELSE ResetTextFields[handle, text]; }; }; $Entity => { msg: ROPE; id: INT; [msg, id] _ GetIntField[controller.entityId]; IF msg # NIL THEN BlinkMsg[msg.Concat[" in parsing the id field."]] ELSE { entity: Entity _ EntityFromId[controller.entityHash, id]; IF entity = NIL THEN BlinkMsg[Rope.Concat["There is no curve with id = ", Rope.RopeFromInt[id]]] ELSE ResetCurveFields[handle, curve]; }; }; $CurveGroup => { msg: ROPE; id: INT; [msg, id] _ GetIntField[controller.entityId]; IF msg # NIL THEN BlinkMsg[msg.Concat[" in parsing the id field."]] ELSE { eg: EntityGroup _ EntityGroupFromId[handle.entityGroupList, id]; IF eg = NIL THEN BlinkMsg[Rope.Concat["There is no curve group with id = ", Rope.RopeFromInt[id]]] ResetCurveGroupFields[handle, cg]; }; }; $Crosssection => { }; ENDCASE => RaiseError[$UnknownAtom, "in CntrlReset"]; }; -- CntrlReset ResetDivisionsFields: PROC[handle: GraphHandle] = { OPEN handle; SetSwitchColor[controller.autoDivision, graph.auto[divisions]]; SetIntField[controller.divX, graph.division[x]]; SetIntField[controller.divY, graph.division[y]]; }; -- SetDivisionFields ResetBoundsFields: PROC[handle: GraphHandle] = { OPEN handle; SetSwitchColor[controller.autoBounds, graph.auto[bounds]]; SetRealField[controller.xmin, graph.bounds.xmin]; SetRealField[controller.ymin, graph.bounds.ymin]; SetRealField[controller.xmax, graph.bounds.xmax]; SetRealField[controller.ymax, graph.bounds.ymax]; }; -- SetBoundsFields ResetCaretsFields: PROC[handle: GraphHandle] = { OPEN handle; SetSwitchColor[controller.xhari1On, graph.caret[primary].on]; SetRealField[controller.xhair1x, graph.caret[primary].place.x]; SetRealField[controller.xhair1y, graph.caret[primary].place.y]; SetSwitchColor[controller.xhari2On, graph.caret[secondary].on]; SetRealField[controller.xhair2x, graph.caret[secondary].place.x]; SetRealField[controller.xhair2y, graph.caret[secondary].place.y]; SetSwitchColor[controller.slopeOn, graph.showSlope]; ViewerTools.SetContents[controller.slope, RopeOfSlope[graph.caret[primary].place, graph.caret[secondary].place]]; SetSwitchColor[controller.textCaretOn, graph.caret[text].on]; SetRealField[controller.textCaretX, graph.caret[text].place.x]; SetRealField[controller.textCaretY, graph.caret[text].place.y]; }; -- ResetCaretsFields ResetTargetsFields: PROC[handle: GraphHandle] = { OPEN handle; SetSwitchColor[controller.targetXOn, graph.target[x].on]; SetRealField[controller.targetX, graph.target[x].value]; SetRealField[controller.targetXW, graph.target[x].width]; SetSwitchColor[controller.targetYOn, graph.target[y].on]; SetRealField[controller.targetY, graph.target[y].value]; SetRealField[controller.targetYW, graph.target[y].width]; }; -- ResetTargetsFields ResetGridsFields: PROC[handle: GraphHandle] = { OPEN handle; SetSwitchColor[controller.gridXOn, graph.grid[x]]; SetSwitchColor[controller.gridYOn, graph.grid[y]]; }; -- ResetGridsFields ResetColorFields: PROC[handle: GraphHandle, index: ColorIndex] = { OPEN handle; SetRealField[controller.red, graph.color[index].R]; SetRealField[controller.green, graph.color[index].G]; SetRealField[controller.blue, graph.color[index].B]; }; -- ResetColorFields ResetFontFields: PROC[handle: GraphHandle, index: FontIndex] = { OPEN handle; ViewerTools.SetContent[controller.fontFamily, graph.font[index].family]; SetIntField[controller.vFontSize, graph.font[index].vFontSize]; SetRealField[controller.pFontScale, graph.font[index].pFontScale]; }; -- ResetFontFields ResetTextFields: PROC[handle: GraphHandle, text: Text] = { OPEN handle; ViewerTools.SetContent[controller.textContent, text.name]; SetRealField[controller.textPlaceX, text.place.x]; ChoiceButtons.UpdateChoiceButtons[controller.viewer, controller.justifX, RopeFromJustifX[text.justifX]]; SetRealField[controller.textPlaceY, text.place.y]; ChoiceButtons.UpdateChoiceButtons[controller.viewer, controller.justifX, RopeFromJustifY[text.justifY]]; SetIntField[controller.textColor, text.colorIndex]; SetIntField[controller.textFont, text.fontIndex]; }; -- ResetTextFields ResetCurveFields: PROC[handle: GraphHandle, entity: Entity] = { OPEN handle; ViewerTools.SetContent[controller.entityName, entity.name]; SetIntField[controller.entityColor, entity.colorIndex]; SetRealField[controller.entityWidth, entity.width]; ChoiceButtons.UpdateChoiceButtons[controller.viewer, controller.markRef, RopeFromMark[entity.mark]]; SetIntField[controller.entityGroupId, entity.groupId]; ViewerTools.SetContent[controller.entityValues, RopeFromVector[entity.newValues]; }; -- ResetCurveFields ResetCurveGroupFields: PROC[handle: GraphHandle, eg: EntityGroup] = { OPEN handle; ViewerTools.SetContent[controller.groupName, eg.name]; SetIntField[controller.xId, eg.x.id]; ViewerTools.SetContent[controller.yIds, RopeOfEntityListIds[eg.entityList, eg.x]]; }; -- ResetCurveGroupFields }. ˜GraphCntrlReset.mesa Sweetsun Chen, September 6, 1985 8:10:57 pm PDT Reset values, if not set yet. Affects panel only. text # NIL! entity # NIL! ΚC˜šœ™Icode™/—J™JšΟkœ˜ J˜J˜˜J™1Jšœ˜ šœ˜Jšœ+˜+Jšœ%˜%Jšœ%˜%Jšœ'˜'Jšœ#˜#šœ ˜ Jšœœ˜ Jšœœ˜ Jšœ2˜2Jšœœœ5˜Fš œœœœ œ ˜.JšœL˜L—Jšœ˜J˜—˜ Jšœœ˜ Jšœœ˜ Jšœ0˜0Jšœœœ5˜Fš œœœœ œ ˜-JšœK˜K—Jšœ˜J˜—šœ ˜ Jšœœ˜ Jšœœ˜Jšœ+˜+Jšœœœ2˜Cšœ˜Jšœ*˜*JšœœœK˜]Jšœ˜#J˜—J˜—šœ ˜ Jšœœ˜ Jšœœ˜Jšœ-˜-Jšœœœ2˜Cšœ˜Jšœ9˜9Jšœ œœL˜`Jšœ!˜%J˜—J˜—˜Jšœœ˜ Jšœœ˜Jšœ-˜-Jšœœœ2˜Cšœ˜Jšœ@˜@JšœœœR˜bJšœ"˜"J˜—J˜—šœ˜J˜J˜—Jšœ.˜5—JšœΟc ˜J˜šΟnœœœ˜@Jšœ?˜?Jšœ0˜0Jšœ0˜0Jšœž˜—J˜šŸœœœ˜=Jšœ:˜:Jšœ1˜1Jšœ1˜1Jšœ1˜1Jšœ1˜1Jšœž˜—J˜šŸœœœ˜=Jšœ=˜=Jšœ?˜?Jšœ?˜?Jšœ?˜?JšœA˜AJšœA˜AJšœ4˜4šœ)˜)JšœG˜G—Jšœ=˜=Jšœ?˜?Jšœ?˜?Jšœž˜—J˜šŸœœœ˜>Jšœ9˜9Jšœ8˜8Jšœ9˜9Jšœ9˜9Jšœ8˜8Jšœ9˜9Jšœž˜—J˜šŸœœœ˜