Back to Setting Object Properties
Up to Table of Contents
Ahead to What to Read Next

To Do List - Controlling Object Actions

Each object has a To Do List where you specify what you want to happen as soon as an event occurs for that selected object. The To Do List is available via a tab in the Object Editor. To open it, right click on an object and choose To Do List... from the popup menu.

The following figure shows an example of how the empty To Do List initially appears for a Push Button object (called PushButton1).

You can enter as many items as you want in the To Do list. For example, you can set it up so that when a user clicks on a Push Button the following actions occur:

The To Do list for this scenario would appear similar to the following:

The event list (in the top left corner) is set to Click. This means that any actions that are in the To Do List will occur when the user clicks on PushButton1. The first line in the To Do list specifies that PushButton1's Visible property will be set to False. The second line specifies that Graphic1's Filename property will be set to birds.gif.

You can set actions for any object or for the overall application. The following subsections describe how to set up the To Do list.

Adding an Object Item to the To Do List

To add an Object item to the To Do list:

1. In the Layout area or in the Object List, find the object to which you want to add a To Do List item.

For example, if you want something to happen when a user clicks on a Push Button, select the Push Button.

2. Right click on the object in the Layout area or in the Object List and choose To Do List... from the popup menu.

3. From the event list, select the event that you want to trigger a To Do List item.

The event list is the drop-down list near the top left side of the tab. As an example, the event list for a PushButton is set to Click by default and appears as follows:

4. Use the New To Do Item button to open the list of objects you can add to the To Do List.

As soon as you click on the New To Do Item button, a new line is added to the To Do List and a drop-down list of all the objects on the page appears in the Object column. The following figure shows an example of how the To Do list appears if you click on this button.

If you don't know the precise name of the object you want to add to the Object list, click and hold down the Find Object button. The cursor becomes a cross-hairs. While still holding the mouse button down, drag the cross-hairs over the objects in the Page Layout Editor. The selected object's name appears in the Object column field.

The name of the object is added to the Object field when you release the mouse. Hint: You can also drag the button over the Object List in the Page Layout Editor.

5. Use the open list to select the object you want to add as a To Do List item.

When you select the object, the What To Do field automatically displays a list of the actions that are available for the selected object. There are two basic types of actions: properties and methods. Properties, as described earlier in this chapter, let you set basic characteristics of an object. For example, the Label property of a Push Button lets you set up the object's text label. Methods are special actions that command an object to do something, such as play an audio file.

6. Select the desired property or method from the What to Do list.

7. As necessary, set the Value field for the To Do List item.

Often, properties require a value and methods do not. For example, if you are setting a Push Button's Visible property, you must set the Value field to True or False. However, if you are setting an Audio object's Play method, you are simply directing the object to play. You do not need to specify a value.

Quick Helpers versus Typing

If the field requires a string, you can simply type it. However, many fields use Quick Helpers (specialized dialog boxes) to let you select values quickly and easily without typing. For example, if you click in the Value field of a Filename property an Open dialog box automatically appears to let you search for the desired filename.

If you need to type a value rather than select it from a Quick Helper, you can override the Quick Helper feature or turn it off. To override the feature, right click in the Value field and choose Edit Value from the popup menu. To turn off the Quick Helpers option, right click in the Object Editor and deselect the Quick Helpers command. Note that even when Quick Helpers are turned off, you still have the option of accessing the helper tools by clicking on a button that becomes available in the Value field.

When you finish selecting a value in a Quick Helper dialog box, you click on OK and the information is returned to the Value field. Note that if the selected value is a filename, the file is automatically copied to the correct project subdirectory if it is located elsewhere on your system.

The tool that lets you search for a filename is just an example of the many kinds of tools that let you set properties. Other examples are the Color dialog box that lets you select a color value and a Font dialog box that lets you select a font value. If you need assistance in using any of the tools that appear, refer to Appendix A for information on how to use the dialog boxes that are commonly found throughout Jamba.

Adding an Application Item to the To Do List

To add an Application item to the To Do list:

1. In the Layout area or in the Object List, find the object to which you want to add a To Do List item.

For example, if you want another page to display when a user clicks on a Push Button, select the Push Button.

2. Right click on the object in the Layout area or in the Object List and choose To Do List... from the popup menu.

3. From the event list, select the event that you want to trigger a To Do List item.

The event list is the drop-down list near the top left side of the tab. As an example, the event list for a PushButton is set to Click by default and appears as follows:

4. Use the New Application Item button to add Application to the To Do List.

As soon as you click on the New Application Item button, two things occur. First, a new line that contains the value Application is added to the To Do List. Second, the list of available actions automatically opens in the What to Do field. The following figure shows how the To Do list appears if you click on this button.

5. Select the desired method from the What To Do list.

For example, if you are setting up an item to display another page when the user clicks on a Push Button, you need to specify GoToPage() method.

6. As necessary, set the Value field for the To Do List item.

For example, if you are setting up an item to display another page, you need to specify the name of the page.

Editing the To Do List

The To Do list also provides special buttons to let you edit and reorder items in the list after you have entered them.

Edit buttons - These buttons let you cut, copy or paste items in the To Do List.

Re-Order List buttons - These buttons let you reorder the items in the To Do List. Example: Click on an item and click on the Move up button to move the item up one position. Remember, the order of the list is the order in which the actions occur at runtime.

User-Defined Values: Object.Property Syntax

Although most situations require you to set an explicit value (such as a filename or number) for a property or method, there are some situations where you might want to specify a user-defined value. A user-defined value is a value that is captured in an object's property when the user makes a selection or enters information. For example, you may want to set a Graphic's Filename property to the name of a file that a user types in a Text object. As another example, you could set an application to play an audio file (via an Audio object) after a user selects the name of the file from a List Box object.

To set a property to a value that originates from a user's interaction, type that value using the following syntax:

Object.Property

where:

Object is the name of the object the user affected.

Property is the name of the property (of the affected object) that contains the value to be used.

Important: By default, you may not be able to type in some Value fields because the Quick Helpers option is in effect. When you click in some Value fields a Quick Helper tool (such as the Color dialog box) appears automatically, preventing you from typing. To circumvent this feature, right click in the desired Value field and choose Edit Value from the popup menu. This places a typing cursor in the field. Or, you can turn off the Quick Helpers option by right clicking in the Object Editor and deselecting the Quick Helpers option.

The next section provides a brief lesson that demonstrates how to specify user-defined values.

Lesson: User-Defined Values

This lesson uses two objects: a List Box and an Audio object. You will create an applet that allows the user to select a filename from the list in order to play the Audio object.

Note: A completed version of this lesson, called lesn_2, is located in the \Jamba\lessons directory.

You don't need to set Audio1 to play; you'll set it to play in the ListBox's To Do List.

The To Do List will contain two items. The first item will set the Audio object's Filename property to the filename that the user selected. The second item will play the Audio object.

Remember that in order to specify a user-defined value, you need to type the Object.Property information into the Value field. Note also that, by default, when you click in the Value field for the Filename property a Quick Helper (an Open dialog box) appears to help you select a filename. You need to temporarily circumvent this feature so that you can type the user-defined value. Now you'll turn off the Quick Helpers.

You are ready to add the first To Do List item.

The To Do list should appear as follows:

Next, you'll add another To Do List item that plays Audio1.

The To Do list should appear as follows: