
Redening the View menu
The View menu allows any app to dene views in addition to the standard seven views shown in the table
above. By default, each HP app has its own set of additional views contained in this menu. The VIEW
command allows you to redene these views to run programs you have created for an app. The syntax for the
VIEW command is:
VIEW "text", function()
By adding VIEW "text", function() before the declaration of a function, you will override the list of
views for the app. For example, if your app program
denes three views—"SetSides", "RollDice" and
"PlotResults"—when you press you will see SetSides, RollDice, and PlotResults instead of the app’s
default view list.
Customizing an app
When an app is active, its associated program appears as the rst item in the Program Catalog. It is within this
program that you put functions to create a custom app. A useful procedure for customizing an app is
illustrated below:
1. Decide on the HP app that you want to customize. The customized app inherits all the properties of the
HP app.
2.
Go to the Applications Library ( ), highlight the HP app, tap and save the app with a
unique name.
3. Customize the new app if you need to (for example, by conguring the axes or angle measure settings).
4.
Open the Program Catalog, select your new app program, and tap .
5. Develop the functions to work with your customized app. When you develop the functions, use the app
naming conventions described above.
6. Put the VIEW command in your program to modify the app's View menu.
7. Decide if your app will create new global variables. If so, you should EXPORT them from a separate user
program that is called from the
Start() function in the app program. This way they will not have their
values lost.
8. Test the app and debug the associated programs.
It is possible to link more than one app via programs. For example, a program associated with the Function
app could execute a command to start the Statistics 1Var app, and a program associated with the Statistics
1Var app could return to the Function app (or launch any other app).
Example
The following example illustrates the process of creating a custom app. The app is based on the built-in
Statistics 1Var app. It simulates the rolling of a pair of dice, each with a number of sides specied by the user.
The results are tabulated, and can be viewed either in a table or graphically.
1. In the Application Library, select the Statistics 1Var app but don’t open it.
Select Statistics 1Var.
The User Keyboard: Customizing key presses 577
Comentarios a estos manuales