home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 1-4 / Prograph Reference 1-4.rsrc / TEXT_143.txt < prev    next >
Encoding:
Text File  |  1995-10-21  |  22.8 KB  |  580 lines

  1.  
  2. The Case Window*82*
  3.  
  4. A case window displays the structure of a case of a method.  
  5.  
  6. Banner*82*
  7.  
  8. The logo in the banner indicates the type of method (Plain, Get, Set, Initialization, or Local) and is followed by the name of the method. The number before the colon indicates the number of the case in the sequence of cases that constitute the method, while the number after the colon indicates the total number of cases in the method.  
  9.  
  10. The banner also contains three case control buttons. They are from left to right:  the Previous case arrow, Case list button, and Next case arrow. *82*
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. Opening*82*
  33.  
  34. Double-clicking a method icon opens its first case window. Other actions that open case windows are discussed in the ‚ÄúManipulation of Cases‚Äù section and the ‚ÄúOpening Operations: The Left and Right ‚ÄòClick Spots‚Äô ‚Äù section, both below in this chapter.
  35.  
  36. Creating *83*
  37.  
  38. Cmd-clicking in space creates an operation, Cmd-clicking just above the top of an operation creates a terminal, and Cmd-clicking just below the bottom of an operation creates a root. Terminals and roots cannot be created on certain operations with enforced arity (see the ‚ÄúEnforcement of Corresponding Arity‚Äù section below in this chapter).
  39.  
  40. Copying*83*
  41.  
  42. Copying an operation also copies all its roots and terminals but not any associated datalinks or synchro links. If the operation is a Local, its method is also copied.
  43. ________________________________________________________
  44. NOTE:  Input and output bars, roots, and terminals cannot be copied, cut, pasted, or replicated.
  45. --------------------------------------------------------
  46.  
  47. Deleting*83*
  48.  
  49. o    Deleting an operation deletes all its terminals and roots, and any synchro link beginning or ending on the operation.  
  50.  
  51. o    Deleting a Local operation deletes its associated Local method.
  52.  
  53. o    Deleting a terminal or root causes all associated datalinks to be deleted.  
  54.  
  55. o    Input and output bars cannot be deleted.
  56.  
  57. o    On certain operations in which arity is enforced, terminals and roots cannot be deleted (see the ‚ÄúEnforcement of Corresponding Arity‚Äù section below in this chapter). 
  58.  
  59. Naming*83*
  60.  
  61. When the name of an operation is changed, the operation is resized to accommodate the new name.
  62.  
  63. Specifying Execution Order*83*
  64.  
  65. A synchro is a connector between two operation icons which specifies their order of execution. If operation A is selected, and operation B is Option-clicked, a synchro will be drawn between them, indicating that operation A executes before operation B does. This does not necessarily mean that operation B will execute immediately after A; other operation executions may intervene.
  66.  
  67. Connecting / Disconnecting*84*
  68.  
  69. o    If a root A is selected, Option-clicking on a terminal B creates a datalink from A to B, or deletes an existing datalink from A to B. 
  70.  
  71. o    If a terminal B is selected, Option-clicking on a root A creates a datalink from A to B, or deletes an existing datalink from A to B.
  72.  
  73. o    If an operation A is selected, Option-clicking on an operation B creates a synchro link from A to B, or deletes an existing synchro link from A to B. 
  74.  
  75. Commenting*84*
  76.  
  77. Operations, roots, and terminals can have comments.
  78.  
  79. Dragging*84*
  80.  
  81. When an operation is dragged, its terminals and roots move with it.
  82.  
  83. Dragging of terminals and roots is restricted to the horizontal axis. When a terminal or root is dragged past the end of its operation, the operation grows symmetrically about its midpoint to accommodate the new position of the dragged terminal or root. 
  84. Similarly, if a terminal or root near the end of an operation is dragged towards the center, the operation shrinks to the extent allowed by its name and other terminals and roots.  
  85.  
  86. Dragging a Loop annotated terminal (or root) moves the corresponding Loop annotated root (or terminal). 
  87.  
  88. Certain roots and terminals cannot be dragged: namely, the roots of Constants or Partition-annotated operations, and the terminals of Matches.
  89.  
  90. Transformations*84*
  91.  
  92. An operation can be transformed by change of name or by annotation.  
  93.  
  94. If an operation is transformed to one of lesser arity, excess terminals and roots are deleted from right to the left. If an operation is transformed to one of greater arity, extra terminals and roots are added to the right.  
  95.  
  96. For example, if a choose operation with inputs a, b, c and output A is changed to a Get operation, the Get operation has a single input (a) and two outputs (A and the new root added to the right of A). *84*
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. Transformation by Name Change*85*
  108.  
  109. Changing the name of an operation to that of a Mac Method enforces the proper arity.
  110.  
  111. Changing the name of an operation by changing its name to that of a user-defined method enforces arity in one of two ways, provided that the name editing is followed by pressing the Return key.
  112.  
  113. o    If the name of the operation is a universal reference, context-determined      reference, or an explicit class method reference, the arity of the uniquely      determined method is applied to the operation.
  114.  
  115. o    If the name of the operation is a data-determined reference, a dialog is      opened displaying a scrolling list of classes in which methods of the       given name are defined. Selecting one of these classes and clicking the      Select button (or equivalently, double-clicking a class) dismisses the      dialog and applies the arity of the method from the chosen class to the      operation.  *85*
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. Annotating Operations*86*
  125.  
  126. Annotation                    Effect     
  127.  
  128. Opers : Simple    
  129.      Preserves previous arity.    
  130.  
  131. Controls : Simple    
  132.      Preserves previous arity. Removes Super or Repeat annotation and any associated control from operation, and all annotations from terminals and roots.    
  133.  
  134. Constant    
  135.      Enforces proper arity. The name becomes the value of the Constant. *86*     
  136.  
  137. Match    
  138.      Enforces proper arity. The name becomes the value of the Match.    
  139.  
  140. Persistent    
  141.      Reduces arity to allowable maximum, if necessary.    
  142.  
  143. Instance    
  144.      Enforces proper arity.    
  145.  
  146. Get    
  147.      Enforces proper arity.    *86*
  148.  
  149. Set    
  150.      Enforces proper arity.     
  151.  
  152. Local    
  153.      Preserves previous arity.    
  154.  
  155. Evaluate    
  156.      Reduces the name to an empty string if it is not a valid arithmetic expression, and forces the root arity to one.    *86*
  157.  
  158. Super    
  159.      Preserves previous arity.    
  160.  
  161. Repeat    
  162.      Transforms operation into a multiplex while preserving previous arity.    
  163. In the following, verifying an operation name means checking that it is appropriate for an operation of a particular kind. If verification fails, the empty string replaces the erroneous name.*86*
  164.  
  165. Mac Constant    
  166.      Verifies name and enforces proper arity.    *87*
  167.  
  168. Mac Match    
  169.      Verifies name and enforces proper arity.    
  170.  
  171. Mac Global    
  172.      Reduces arity to allowable maximum, if necessary.    
  173.  
  174. Mac Address    
  175.      Verifies name and enforces proper arity.  *87*    
  176.  
  177. Mac Get Field    
  178.      Verifies name and enforces proper arity.      
  179.  
  180. Mac Set Field    
  181.      Verifies name and enforces proper arity.  *87*    
  182.  
  183.  
  184.  
  185. Annotating Roots and Terminals*88*
  186.  
  187. Annotation                 Effect     
  188.  
  189. Simple    
  190.      Preserves arity, and if no Loop or List root or terminal remains, the Repeat annotation is removed from the operation.    *88*
  191.  
  192. Inject    
  193.      Adds a new Inject terminal to fixed-arity operations; otherwise, converts the selected terminal into an Inject. The name of the operation is removed. Only one terminal per operation can be annotated as Inject. Mac Methods cannot have Inject terminals.    *88*
  194.  
  195. Partition    
  196.      Enforces proper arity. The selected terminal is transformed into a List, and the two Partition roots True and False are created. This annotation can be applied only to a terminal of an operation with no roots.     *88*
  197.  
  198. List    
  199.      Preserves previous arity.     
  200.  
  201. Loop    
  202.      When applied to a terminal (or root), if the operation has no simple root (or terminal), a new root (or terminal) is added and the selected terminal (or root) and new root (or terminal) are annotated as a matching Loop.*88*
  203.  
  204.  
  205.  
  206.  
  207.      If the operation has simple roots (or terminals), the selected terminal (or root) and the horizontally closest simple root (or terminal) are annotated as a matching Loops. In both situations, the operation is annotated as Repeat if it is not already so annotated. *88*
  208.  ¬†
  209.  
  210.  
  211. __________________________________________________________
  212.  
  213.  
  214. Deleting Annotated Roots and Terminals*89*
  215.  
  216. Deleting                    Effect     
  217.  
  218. Partition    
  219.      Partition roots cannot be deleted. Deleting the List terminal simplifies the True and False roots, and removes the Repeat annotation from the operation.    *89*
  220.  
  221. Loop    
  222.      Deleting a Loop terminal (or root) simplifies the matching Loop root (or terminal). If it is the only Loop or List root or terminal, the Repeat annotation is removed from the operation.    
  223.  
  224. List    
  225.      Deleting a List terminal (or root) removes the Repeat annotation from the operation if there are no remaining List or Loop terminals or roots.    
  226. -------------------------------------------------
  227.  
  228. Combinations of Creating, Connecting, and Annotating*89*
  229.  
  230. Whenever an action results in the creation of several elements including an operation, the new operation becomes the selected element, unless the Command and Option keys have been depressed at the same time (see the ‚ÄúGeneral Rules in the Editor‚Äù section above in this chapter).
  231.  
  232. If a root (or terminal) is selected, Option-clicking near the top (or bottom) of an operation creates a terminal (or root) and a datalink connecting it with the selected root (or terminal). The originally selected root (or terminal) remains selected.
  233.  
  234. The effect of Option-clicking when a root (or terminal) is selected is further extended if the click is in space. Option-clicking in space creates an operation with a terminal (or root) and connecting datalink.  *89*
  235.  
  236. If an operation is selected, Option-clicking in space creates a new operation and a synchro from the original operation to the new one.
  237.  
  238. A double-click on a terminal creates a new operation with a single root, annotates it as a Constant, and creates a datalink between the terminal and the root of the Constant.
  239.  
  240. A double-click on a root creates a new operation with a single terminal, annotates it as a Match, and creates a datalink between the root and the terminal of the Match.
  241.  
  242. A double-click near the top (or bottom) of an operation, but not on an existing terminal (or root), first creates a new terminal (or root), and then, as described in the preceding paragraph, a new Constant (or Match), root (or terminal), and datalink. *89*
  243.  
  244. Selection of Element Groups*90*
  245.  
  246. Groups of operations or groups of roots and terminals can be selected. However, operations cannot be selected at the same time as roots or terminals. Marquee selection applies only to operations.  
  247.  
  248. Manipulation of Groups*90*
  249.  
  250. Locals*90*
  251.  
  252. The complexity of a case can be reduced by grouping a collection of operations into a Local.*90*
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. The annotation Opers to Local in the Opers menu applies to a group of selected operations. This group is transformed into a Local method associated with a Local operation that replaces the group in the case. The topology of the case is adjusted appropriately. All the datalinks (including synchros) that connect operations within the group are preserved. 
  269.  
  270. The terminals and roots of the Local operation are linked, respectively, to the roots and terminals of the remaining portion of the case, preserving the original horizontal order. However, any synchros that connect operations in a group with those outside of it are removed.  *90*
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. Comments attached to the roots from the remaining portion of the case, to which terminals of the Local operation are connected, are copied to the corresponding roots of the input bar of the Local method.*91*
  289.  
  290.  ¬†
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304. Editing*91*
  305.  
  306. Copy Object
  307.  
  308.      The group of selected operations and all links within the group are copied into the 
  309.      Object clipboard.  
  310.  
  311. Paste Object*91*
  312.  
  313.      The contents of the Object clipboard are copied into the case.
  314.  
  315. Replicate Object*92*
  316.  
  317.      Acts as Copy Object and Paste Object applied to the selected group, but does not 
  318.      alter the contents of the Object clipboard.
  319.  
  320. Cut Object*92*
  321.  
  322.      Selecting this item is equivalent to copying and deleting the selected group of 
  323.      operations. 
  324.  
  325. Dragging*92*
  326.  
  327.      Groups of terminals and roots cannot be dragged. 
  328.  
  329.  
  330. Enforcement of Corresponding Arity*92*
  331.  
  332. Correspondence between the terminals of a Local operation and the roots of the input bars of the cases of its corresponding Local method is enforced. The same applies to correspondence between the roots of a Local operation and the terminals on the output bars of the cases of its Local method.
  333.  
  334. Input and output arity is also enforced between cases of a method. Creation or deletion of any root on an input bar (or terminal on an output bar) automatically creates or deletes the corresponding root (or terminal) in all the remaining cases.
  335.  
  336. Propagation of Comments*92*
  337.  
  338. When a new method is created by a double-click on an operation, or an operation is annotated as a Local, the comments associated with the terminals (or roots) of the operation appear at the corresponding roots of the input bar (or terminals of the output bar) of the created method or Local method.*92*
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353. However, if a terminal of the operation does not have a comment, but is attached to a root with a comment, this comment is propagated to the corresponding root of the input bar of the new method or Local method, as shown in the picture.*93*
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367. Comments are automatically propagated only for new methods and Locals. If you add comments to an existing method or Local and want them to be propagated, select the method or Local and choose Propagate Comments from the Info menu. 
  368.  
  369. Opening Operations: The Left and Right ‚ÄúClick Spots‚Äù*93*
  370.  
  371. Double-clicking either end of an operation produces an effect that depends on the annotation of the operation, the kind of method reference made by the name, and the end on which the click occurs. 
  372.  
  373. If the operation references an existing element, clicking either end opens an appropriate window or dialog. Otherwise, double-clicking the left end creates the element referenced by the operation, and double-clicking the right end issues a warning to the user that the referenced element does not exist. 
  374.  
  375. Below is a table summarizing the results of double-clicks on the ends of operations, according to the name and annotation of the operation. *93*
  376.  
  377. Operation                             Left End<                         >Right End    
  378.  
  379. Simple*93* 
  380.    < name>    
  381. Left End<               If <name> is the empty string, a dialog with a scrolling list of names 
  382.                              of universal methods is displayed. Selecting a method transfers its 
  383.                              name to the operation and opens the first case window of the method.     
  384. >Right End                Same as left end.    
  385.  
  386.  Left End<               Otherwise, if a universal method called <name> exists, its first 
  387.                                case window is opened.     
  388. >Right End               Same as left end.    
  389.  
  390. Left End<                Otherwise, if no universal method called <name> already exists, the 
  391.                               method is created and its first case window is opened.    
  392. >Right End               An error message is produced.    
  393.  
  394. Simple *94*
  395.   /<name>    
  396. Left End<               Opens a dialog with a scrolling list of all classes that do not have a 
  397.                             method <name>. On selecting a class, the method is created and its 
  398.                             first case window is opened.
  399.  >Right End               Opens a dialog with a scrolling list of all classes that have a method 
  400.                              <name>. On selecting a class, the first case window of the method is 
  401.                               opened.    
  402.  
  403. Simple *94*
  404.    //<name>    
  405. Left End<               If the class containing the method in which the operation is located 
  406.                              has a method called <name>, the first case window of this method is 
  407.                              opened.    
  408. >Right End               Same as left end.    
  409.  
  410.  Left End<               Otherwise, the method is created and its first case window is 
  411.                                opened.    
  412. >Right End               An error message is produced.    
  413.  
  414. Simple*94*
  415.     <class>/<name>    
  416. Left End<               If a class called <class> exists and has a method <name>, the first 
  417.                               case window of this method is opened.    
  418.  >Right End              Same as left end.    
  419.  
  420. Left End<               If a class called <class> exists and does not have a method <name>, 
  421.                              the method is created and its first case window is opened.    
  422.  >Right End              An error message is produced.    
  423.  
  424. Left End<              Otherwise an error message is produced.         
  425. >Right End               Same as left end.    
  426.  
  427. Evaluate*94*                         No action.                         No action.    
  428.  
  429. Local*95*            Opens first case window.           Same as left end.    
  430.  
  431. Constant*95*       Opens a Change Value dialog.    Same as left end.    
  432.  
  433. Match*95*             Opens a Change Value dialog.    Same as left end.    
  434.  
  435. Persistent*95*    
  436.  Left End<              If the operation has no name, a dialog is opened with a scrolling list 
  437.                              of persistents. Selecting a persistent transfers its name to the 
  438.                              operation, and opens a Value window displaying its value.    
  439. >Right End               Same as left end.    
  440.  
  441. Left End<               If the persistent exists, a Value window is opened, displaying its 
  442.                              value.
  443. >Right End               Same as left end.    
  444.  
  445.  Left End<               Otherwise, the persistent is created and a Value window opened.    
  446.  >Right End              An error message is produced.    
  447.  
  448. Instance*95*    
  449.  Left End<              If the operation name has no name, a dialog is opened with a 
  450.                              scrolling list of classes. Selecting a class transfers its name to the 
  451.                              operation, and opens the Attributes window of the class.     
  452.  >Right End              If operation name is the empty string, a dialog is opened with a 
  453.                             scrolling list of classes. Selecting a class transfers its name to the
  454.                             operation and opens the Methods window of the class.    
  455.  
  456.  Left End<               Otherwise, if the class exists, its Attributes window is opened.    
  457.  >Right End             Otherwise, if the class exists, its Methods window is opened.    
  458.  
  459. Left End<               Otherwise, if the operation has a name and the class does not exist, 
  460.                              the Classes window is brought to the front and the class is created.    
  461. >Right End              Otherwise, an error message is produced.    
  462.  
  463. <name> *96*
  464.       Get or Set    
  465. Left End<                No action if the operation has no name.     
  466. >Right End               Same as left end.    
  467.  
  468. Left End<               Otherwise, opens a dialog with a scrolling list of all classes that do 
  469.                             not have an attribute <name>. On selecting a class, dialogs are 
  470.                             displayed (for specifying whether the attribute is to be a class or an 
  471.                             instance attribute, and for setting its default value) as for runtime 
  472.                             creation of attributes. (Refer to chapter 3, ‚ÄúThe Interpreter 
  473.                             Environment‚Äù).     
  474. >Right End               Opens a dialog with a scrolling list of all classes which have an 
  475.                              attribute <name>. On selecting a class, a Value window is opened 
  476.                             displaying the default value of the attribute.    
  477.  
  478. /<name> *96*
  479.     Get or Set    
  480.  Left End<              Opens a dialog with a scrolling list of all classes that do not have a 
  481.                              Get method <name>. On selecting a class, a Get method is created and 
  482.                              its first case window opened.
  483. >Right End                Opens a dialog with a scrolling list of all classes that have a Get 
  484.                              method <name>. On selecting a class, the first case of the Get method 
  485.                              is opened.    
  486.  
  487. Operation                     Left End                        Right End    
  488.  
  489. Mac Constant*96*    Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  490.  
  491. Mac Match*96*        Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  492.  
  493. Mac Global*96*            Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  494.  
  495. Mac Address*96*     Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  496.  
  497. Mac Get Field*96*    Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  498.  
  499. Mac Set Field*96*    Opens the ÀôInfo‚Ķ dialog.                 Same as left end.    
  500. ________________________________________________________
  501. NOTE:  With Mac Address, Mac Get Field, and Mac Set Field operations, if there exist multiple Mac Structs containing a field with the specified name, a dialog with a scrolling list of all possible owning Mac Structs is displayed.*96*
  502. -------------------------------------------------------
  503.  
  504. Manipulation of Cases*97*
  505.  
  506. The case-list button, previous-case arrow, and next-case arrow provide access to the different cases of a method.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521. Case Controls *97*
  522.  
  523. o    Clicking on the previous-case (or next-case) arrow opens a window onto the previous (or next) case, if such a case exists.
  524.  
  525. o    Option-clicking on the previous-case (or next-case) arrow creates a new case, inserted in the case list directly to the left (or right) of the current case, and opens a window onto it.  
  526.  
  527. o    Command-clicking on the previous-case (or next-case) arrow closes the current case window and opens a window onto the previous (or next) case, if such a case exists.*97*
  528.  
  529. o    Option-clicking in the case list button of a case window of a local will open its parent local or method. If the Command-key is also pressed, the current window will close.
  530.  
  531. o    Option-clicking the case list button  of an execution (i.e., dotted background) 
  532. window opens its calling method (or local method). If the current window is already at the top of the stack, the stack window will open. Pressing the Command-key along with the Option key will close the current execution window.
  533.  
  534. Case List Pane*97*
  535.  
  536. The Case List pane displays a numbered, draggable icon for each case of the method.  
  537.  
  538. Opening*98*
  539.  
  540. Clicking on the case-list button opens the Case List pane.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555. Closing*98*
  556.  
  557. Clicking in body of the case window or on the case-list button closes the Case List pane.  
  558.  
  559. Deleting*98*
  560.  
  561. When a case icon is deleted, the remaining icons are renumbered appropriately.
  562.  
  563. Commenting*98*
  564.  
  565. Case icons cannot be commented. 
  566.  
  567. Actions*98*
  568.  
  569. o    Clicking in space (before, after, or between the case icons) in the Case List pane creates a case icon and renumbers the cases to the right of the click. 
  570.  
  571. o    Double-clicking on a case icon opens the corresponding case window. 
  572.  
  573. Dragging*98*
  574.  
  575. Dragging is restricted to the horizontal. Dragging case icons reorders the cases, which are then renumbered.  
  576.  
  577. Closing Case Windows*98*
  578.  
  579. Command-clicking in the close box of a case window closes all case windows for that method.
  580.