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_130.txt < prev    next >
Encoding:
Text File  |  1995-05-01  |  3.3 KB  |  74 lines

  1. Tutorial Intermission
  2.  
  3. Sprucing up the Film class
  4.  
  5.     In this section, you will make the Category and Rating fields into pop-up choices.  As the rest of the tutorial does not depend on you doing this now, you can skip this section and come back to it later.
  6.  
  7.     Make sure that the Film class is open and in author mode.  If it is not open, click on the user classes folder and then double-click on Film.  If the alignment grid is not visible that means that the form is in user mode. Type the escape key to change to author mode.
  8.  
  9. ‚Ä¢    Command-click on the category string field.
  10. ‚Ä¢    Choose View Options... from the pop-up menu.
  11. ‚Ä¢    Choose View Changer from the pop-up menu.
  12. ‚Ä¢    Choose pop-up choice view from the View Changer.
  13. ‚Ä¢    Click on Save & close the View Changer window.
  14.  
  15.     The field will change into a pop-up choice.  Now edit the choices.
  16.  
  17. ‚Ä¢    Command-click on the category pop-up choice.
  18. ‚Ä¢    Choose on Edit Choices from the pop-up menu.
  19.  
  20.     A choice editor for the field will open.
  21.  
  22. ‚Ä¢    Remove any existing choices in the list by clicking on them and then clicking Remove.
  23. ‚Ä¢    Click on Add and choose ‚Äúabc‚Äù  to insert a string.
  24. ‚Ä¢    Edit the value (near the bottom of the window)  to ‚ÄúMystery‚Äù.
  25.  
  26.     Add 3 or 4 other film categories like Romance, Comedy, etc.  You  can click the Test button at any time to see what the menu will look like in use.  You can change an items position in the list by clicking on it in the list and then clicking on Up or Down.
  27.  
  28.     You can check that your changes took effect by switching Film to user mode or by looking at one of the films in the film folder and trying the pop-up choice.
  29.  
  30.  
  31.  
  32. Fancy choices
  33.  
  34.     For the Category choices, you used strings for the choices.  For the Rating choices, you will use one string for the rating itself, and another to display in the pop-up choice.  Although you could use the same string for both the rating and the display in the choice, having different strings allows the choice‚Äôs string to be more descriptive while the ranking itself is terse.
  35.  
  36. ‚Ä¢    Double-click on Film in the user classes folder to open it.
  37. ‚Ä¢    Convert the rating field to a pop-up choice (as in the previous section) & open its choice editor.
  38. ‚Ä¢    Delete any items in the choice editor.
  39. ‚Ä¢    Create 5 titled choices using the Add button.
  40.  
  41.     An titled choice has two properties of interest: a string and a value.  Its string  is displayed in the pop-up choice.  When a choice is made, the value is stored into the choice‚Äôs property.
  42.  
  43. ‚Ä¢    Select a titled choice by clicking on it.
  44. ‚Ä¢    Change the display title for the  choice to "Must see - 5 stars".
  45. ‚Ä¢    Change the value for the first entry to "*****".
  46.  
  47.     Edit the string and values for the other 4 entries.  Clicking on any entry will select it and allow it to be edited.  If inspiration escapes you, you might use ‚ÄúGreat flick! - 4 stars‚Äù, ‚ÄúOK - 3 stars‚Äù, ‚ÄúTry to avoid - 2 stars‚Äù, and ‚ÄúDoggie - 1 star‚Äù for the other entries.
  48.  
  49.     Note that you can set the value of a titled choice any value and not just to strings.  You do this by dragging and dropping the value to the right of the string field in which you entered the value above.
  50.  
  51.     As in the previous section, you can check that your changes took effect by switching Film to user mode or by looking at one of the films in the film folder.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.