Book Contents          Previous Chapter          Next Chapter

Attribute Steps

This chapter describes attribute steps, the user interface technique used by Magic Cap to allow the user to enter several related items of information, such as all the parts of a postal address. Before reading this chapter, you should be familiar with windows and buttons.

About Attribute Steps

Magic Cap provides attribute steps as a convenient way for users to enter a series of related items, such as all the parts of a name or postal address. Attribute steps provide a small window called an attribute window for the user to enter one or two items of information, along with buttons to navigate among the related steps. Magic Cap defines classes AttributeStep and AttributeWindow to represent these objects.

To use this technique, you'll specify an attribute step object for each step and an attribute step list, an object list that refers to all the steps. You'll also specify the attribute window to be used for the steps. Magic Cap defines class AttributeStepList to represent these objects.

When you use attribute steps in your packages, you'll specify the attribute step objects, the attribute step list object that refers to all the steps, and the attribute window that displays the steps.

Features of Attribute Steps

This section describes the operations provided by attribute steps and related classes. You won't often call operations of these classes when you use attribute steps. Instead, you'll just specify the appropriate objects in your instance definition file. Much of the work is handled automatically by Magic Cap when you start the editing process on the attribute objects you specify.

Attribute Steps

Class AttributeStep defines many fields that contain information specifying how the step should work, and a few operations that you might call. This section describes the fields and operations of class AttributeStep.

Use the prompt field to refer to a text object that contains the text that appears in the attribute window to prompt the user. The targetAttribute field gives the attribute that will be set by the information entered in the window. If you want to provide a list of choices for the attribute, the choiceList attribute refers to the choice list object. You can provide helpful information for the step in the stepInfo field. If you want to use a control for input instead of a text field, you can refer to the control in the stepControl field. The removeCard field belies its name by indicating whether the step might rename a name card. This allows the name card file to re-alphabetize the card if necessary.

Set the showNumbers field to true to switch the on-screen keyboard to numbers mode at the beginning of this step. This helps the user type in items like phone numbers, credit card numbers, and zip codes. Set the blankSetCaps field to true to shift the keyboard into uppercase mode for one character after each space the user types. This mode helps the user type in names and titles. Set the keyboardShift flag to true to put the keyboard into caps mode at the beginning of this step, so the first character the user types is in uppercase. You'll probably set this field to true whenever you set blankSetCaps.

The checkMatchName field is used by Magic Cap itself. You will probably set this field to false in your attribute steps. Set the useLabelButton field to true if you want to show a button labeled with the prompt text. When the user taps this button, Magic Cap selects the text in the corresponding field. The usePrefixField field controls whether a prefix, such as a country code in a phone number entry, should be displayed between the prompt and the field. The prefix itself is stored in the prefixField field of the attribute window.

You can set the acceptImmediately field to true if you want to accept a value as soon as the field is deactivated. If you set this flag to true in an attribute window with two steps, the value in a step will be accepted as soon as the user moves to the other step in the window. If you set the useTimePicker flag, Magic Cap will show the time picker window to allow the user to choose a time, rather than displaying a text field and the on-screen keyboard.

Attribute Step Lists

When you use attribute steps, you'll usually specify the objects you need in your instance definition file. You'll need the following objects:

You don't have to specify your own attribute window. Instead, you'll probably use an indexical to refer to one of the standard attribute windows. See the Attribute Windows section below for more information.

To begin entering information with the attribute steps, your package can call EditAttribute. Calling EditAttribute begins the editing process by displaying the attribute window with the first step inside. When you call EditAttribute, you pass the object whose attribute will be changed as a parameter.

Attribute Windows

When you use attribute steps to get user input, your attribute step list specifies a window to use for the steps. You can use an indexical to refer to one of the following standard attribute windows:

#define iOneStepAttributeWindow		MakeIndexical(17,23)
#define iTwoStepAttributeWindow		MakeIndexical(17,26)
#define iWideAttributeWindow			MakeIndexical(17,57)

Use iOneStepAttributeWindow if you want to display one attribute step in the window, and iTwoStepAttributeWindow to show two attribute steps in the same window. You can use iWideAttributeWindow if you want to use an extra-wide window for entering unusually long text. Magic Cap uses iWideAttributeWindow when the user enters an internet e-mail address on a name card.

Reference

For more information, see the following topics in Magic Cap Class and Method Reference:

class AttributeStep

fields:

acceptImmediately
blankSetCaps
blankSetCaps
checkMatchName
choiceList
keyboardShift
prefixField
prompt
removeCard
showNumbers
stepControl
stepInfo
targetAttribute
useLabelButton
usePrefixField
useTimePicker

class AttributeWindow

class AttributeStepList

operations and attributes:

EditAttribute

indexicals:

iOneStepAttributeWindow
iTwoStepAttributeWindow
iWideAttributeWindow


Book Contents          Previous Chapter          Next Chapter