previous chapter contents page top page next chapter

SceneAdditions

May 8, 1995

Inherits from Object

Class Description

Often you'll want to add special stamps, tools, and rules to your Scene objects. Class SceneAdditions gives you an easy way to add those special touches.

Remember that if the documentation and the software (especially the definition files) disagree, always trust the software.

Programming information

Instantiate: often
Subclass: rarely
Call its methods:rarely

You'll rarely need to call the methods of class SceneAdditions. Instead, you'll just put your scene additions into place in your object definition files, and rely on the system to install them.

You can use scene additions to install any or all of these items in the given locations:

To connect your scene additions object with your scene, just fill in the additions field of your scene with your additions object.

      additions: (SceneAdditions "My Scene's Stuff" 20);

The system installs your additions for you when it opens your scene.

Methods defined by class SceneAdditions

Class SceneAdditions defines no methods.

Fields defined by class SceneAdditions

Class SceneAdditions defines the following fields:

Field Type Description
commands ObjectList Lists of commands to install in the magic lamp
rules ObjectList Lists of rules to install in the magic lamp
tools ObjectList Lists of tools to install in the tools window
stamps Viewable View chain of stamps to install in the local drawer of the stamper
stampBankNames Text Names of drawers for the scene's custom bank of drawers
stampBankContents ObjectList List of viewables to put into the scene's custom bank of drawers

The stamps field should contain the first stamp in a view chain that includes all the stamps you want installed in the local stamper drawer.

The stampBankNames field should contain a text object that lists the names for the drawers in your new stamp bank. Each name should be in a separate line of the text. Here's an example of the stamp bank names list used by the name cards' scene additions:

Instance Text 8445;
         text: 'main\nphones\naddresses\ne-mail\ngroups\n';
End Instance;

The object list in the stampBankContents field must contain the same number of entries as there are names in the bank names object. Each entry in the list should be the first viewable in a view chain list of items for one drawer.

The commands, rules, and tools fields should be object lists that contain two lists of class DenseObjectList. The first list should be a list of the commands, rules, or tools to install if the system is in normal mode. The second should be a list of items to install if the user has turned on construction mode. These two dense object lists can be the same object if there's no difference between normal mode and construction mode.

Here's an example of a package scene that adds special tools for users in construction mode, but adds no special commands:

Instance SceneAdditions 20;
       commands: (ObjectList 'Lists of Commands' 21);
          rules: nilObject;
          tools: (ObjectList 'Lists of Tools' 31);
         stamps: nilObject;
 stampBankNames: nilObject;
stampBankContents: nilObject;
End Instance;

Instance ObjectList 'Lists of Commands' 21;
         length: 2;
          entry: (DenseObjectList 'Commands' 22);
          entry: (DenseObjectList 'Commands' 22);
End Instance;

Instance DenseObjectList 'Commands' 22;
         length: 2;
          entry: (Button 'Build' 23);
          entry: (Button 'Destroy' 24);
End Instance;

Instance ObjectList 'Lists of Tools' 31;
         length: 2;
          entry: (DenseObjectList 'Normal Tools' 32);
          entry: (DenseObjectList 'Expert Tools' 33);
End Instance;

Instance DenseObjectList 'Normal Tools' 32;
         length: 2;
          entry: (Box 'Hammers' 34);
          entry: (Box 'Screwdrivers' 35);
End Instance;

Instance DenseObjectList 'Expert Tools' 33;
         length: 4;
          entry: (Box 'Hammers' 34);
          entry: (Box 'Screwdrivers' 35);
          entry: (Box 'Socket Wrenches' 36);
          entry: (Box 'Chisels' 37);
End Instance;

If you have only one item to install, you can put just the item in your list of lists, in the place of a dense object list. The scene additions for the default package scene does this. Here's its object definition:

Instance SceneAdditions 4241;
       commands: (ObjectList 4242);
          rules: nilObject;
          tools: nilObject;
         stamps: nilObject;
 stampBankNames: nilObject;
stampBankContents: nilObject;
End Instance;

Instance ObjectList 4242;
         length: 2;
          entry: (SimpleActionButton 'reset package' 4968);
          entry: (SimpleActionButton 'reset package' 4968);
End Instance;

This scene additions object installs just one command in the magic lamp, the same for both normal mode and construction mode.

Attributes defined by class SceneAdditions

Class SceneAdditions defines the following attributes:

Attribute Type Description
Commands ObjectList Interface to the commands field
Rules ObjectList Interface to the rules field
Tools ObjectList Interface to the tools field
Stamps Viewable Interface to the stamps field
StampBankNames Text Interface to the stampBankNames field
StampBankContents ObjectList Interface to the stampBankContents field