
17
Programming Concepts
myForm.append(label);
myForm.append(edit);
// Create the caption that will appear on the status bar
myForm.caption = "form demo";
// show the form
gui.showForm(myForm);
When the Form Demo Script runs, the OHV300 displays the following image:
Figure 3 – Form Demo Display
The user enters an employee number into the edit control and presses the left button (OK)
to submit the data.
3.2.3
Menus
Use the gui.Menu object (section 4.2.3.6) to define the menus for your application. Use the
gui.MenuItem constructor to define the controls in the menu. Each control has an
associated onClick property that defines the function of the OHV300.
The following example demonstrates how to build and display menus and submenus.
// JavaScript Menu Demo Script Document
// menu event handlers
function onTimeCard(){alert(postAlertFunc, "TimeCard");}
function onInventory()
{
gui.showSubMenu(subMenu, myMenu);
}
function onCapital(){alert(postAlertFunc, "capital");}
function onStock(){alert(postAlertFunc, "stock");}
// create menu objects
var myMenu = new gui.Menu();
var subMenu = new gui.Menu();
// create menu entries
var timeCardApp =