home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / Codeworks 0.94b3 / Codeworks® WWW Demo Doc. / Tutorial.doc / Tutorial.doc.rsrc / TEXT_129.txt < prev    next >
Encoding:
Text File  |  1995-05-01  |  5.0 KB  |  163 lines

  1. Tutorial Part I
  2.  
  3. Creating a new Glyphic Codeworks document
  4.  
  5.     In the instructions that follow,  bulleted items indicate the sequence of actions you should take, while other text is commentary on those actions.
  6.  
  7. ‚Ä¢    Install Glyphic Codeworks if you haven‚Äôt already done so.
  8. ‚Ä¢    Launch Glyphic Codeworks‚Ñ¢.
  9. ‚Ä¢    Cancel the file chooser dialog.
  10. ‚Ä¢    Select New from the File menu.
  11. ‚Ä¢    Select Save As from the File menu.
  12.  
  13.     The list in the upper left of the document contains all of the document‚Äôs folders.  Each folder contains a list of objects.  Most of the folders start off empty, but if you select a folder, such as the ‚Äúsystem classes‚Äù folder,  the objects in that folder will appear in the list in the upper right corner.
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. Creating a class
  38.  
  39. ‚Ä¢    From the Utilities menu, select New Class....
  40.  
  41.     The ‚Äòclass creator‚Äô will open.
  42.  
  43. ‚Ä¢    Edit the Class name to read ‚ÄúFilm‚Äù.
  44. ‚Ä¢    Set ‚ÄúMake class folder‚Äù pop-up choice to ‚Äútrue‚Äù.
  45. ‚Ä¢    Click on  Create & Close.
  46.  
  47.     Notice that the class is automatically added to the user classes folder.  (If the user classes folder is not selected, clock on it to select it.)  In addition, a new folder named ‚Äúfilm folder‚Äù is added to the folder list in the upper left.
  48.  
  49.     A grid appears inside the window for the Film class.  This grid is called an aligner and will be used to hold the properties that are added to the class.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Adding properties to a class
  71.  
  72. ‚Ä¢    Command-click in the upper left grid cell of Film.
  73. ‚Ä¢    Select Insert View... from the pop-up menu.
  74. ‚Ä¢    Select Label from the pop-up menu.
  75. ‚Ä¢    Command-click on the new item.
  76. ‚Ä¢    Select Rename from the pop-up menu to rename it to ‚ÄúTitle:‚Äù.
  77.  
  78.     In general, you can command-click on any item (or title bar) to bring up a context specific pop-up menu.
  79.  
  80. ‚Ä¢    Command-click in the grid to the right of ‚ÄúTitle:‚Äù.
  81. ‚Ä¢    Select Insert View.../String Field from the pop-up menu.
  82. ‚Ä¢    Rename the new item to ‚Äútitle‚Äù as above.
  83.  
  84.     The string field will still have a value of ‚Äúabc‚Äù.  Changing its property name only changes the name by which it is referenced, not its value.
  85.  
  86.     Note that an existing field can be copied to a new grid location by dragging the existing field with the command key held down.
  87.  
  88. ‚Ä¢    Add a label named ‚ÄúCategory:‚Äù below ‚ÄúTitle:‚Äù. 
  89. ‚Ä¢    To the right of that, insert a string field.
  90. ‚Ä¢    Rename the property of the new item to ‚Äúcategory‚Äù. 
  91. ‚Ä¢    Add a label named ‚ÄúRating:‚Äù and a string field with the property name of ‚Äúrating‚Äù to the next row.
  92. ‚Ä¢    Add a Text Note to the lower right cell of Film.
  93.  
  94.      Now switch Film from author to user mode and set default values for all the fields.   The default values are the initial values for new films.
  95.  
  96. ‚Ä¢    With the Film window on top, type the escape key.
  97.  
  98.      Notice that in user mode the aligner grid is not drawn.
  99.  
  100. ‚Ä¢    Edit the Title to "no title".
  101. ‚Ä¢    Edit the Category to "-".
  102. ‚Ä¢    Edit the Rating to "*****".
  103. ‚Ä¢    Edit the text note to "comments".
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. Using a class
  125.  
  126.     Before starting this section, you will probably want to either close Film to get it out of the way, or drag it so that most of it is off the screen.  If you do close Film, you can reopen it by selecting ‚Äúuser classes‚Äù in the folder list and then double-clicking on Film in the list in the upper right.
  127.  
  128.     There should be a folder in the folder list (in the upper left of the document) named film folder.  If this is not the case, create one now by command-clicking in the folder list, choosing Create from the pop-up menu, and entering ‚Äúfilm folder‚Äù in the resulting dialog.
  129.  
  130. ‚Ä¢    Click on the film folder in the folder list.
  131. ‚Ä¢    Command-click in the film folder‚Äôs list (the upper right list).
  132. ‚Ä¢    Select Create from the resulting pop-up menu.
  133.  
  134.     An instance of the Film class is created and inserted into the film folder.
  135.  
  136. ‚Ä¢    Double-click on the new film.
  137. ‚Ä¢    Fill in the title, category, and rating and write in the note about the film if you like.
  138.  
  139.     Add several more films to the film folder.  Notice that all the films have the same name:  a Film.  It would be nice to change that to something more descriptive...
  140.  
  141.  
  142.  
  143. Overriding child-name for Film
  144.  
  145.  The default name for all films is  ‚Äúa film‚Äù (as you can see by looking at the films in the film folder).  By overriding the child-name property in Film, you can give its instances more descriptive names.
  146.  
  147. ‚Ä¢    Command-click in the title bar of Film.
  148. ‚Ä¢    Select Override...
  149. ‚Ä¢    Select "child-name" in the pop-up menu.
  150.  
  151.     A script editor for child-name will appear.  It will already be filled out with sample text for child-name (including a comment in italics at the top).  All of that text can be deleted.
  152.  
  153. ‚Ä¢    Edit the script for ‚ÄúFilm.child-name‚Äù so that it reads (including bolding and punctuation):
  154.  
  155.     return title && rating.
  156.  
  157.  You can select text and use command-b for bold text, command-p for plain, command-i for italic, and command-u for strikeout. 
  158.  
  159. ‚Ä¢    Click on Save.
  160. ‚Ä¢    Close the script editor.
  161.  
  162.     The names of the films in the film folder will change to reflect the script you just wrote.
  163.