9. Generating Fields from Predefined Templates : How You Can Add a Generated Field to a Frame : The analog_clock Field Template : How an Analog Clock Field Works
 
Share this page                  
How an Analog Clock Field Works
When you run the frame containing the analog clock field, it displays the current time. The clock operates automatically and updates its display as specified. If you chose to display seconds, each individual second tick becomes red in turn to show the seconds.
An example of an analog clock display follows. Note that the second indicator is shown on the 11th second:
Setting Alarms
If the Enable Alarms feature is selected when the analog clock is created, the user can set alarms by clicking the clock, which opens the Timer Options dialog.
In this dialog, the user can set one or more alarms. The control button provides several options including inserting a row, deleting the current row, or deleting all rows. These functions are those provided in a table field frame (for more information, see Use a Table Field Frame (see Use a Table Field Frame)).
Alarm Time
In the Time entry field, the user enters the time the alarm will be activated (for example, 12:00 PM).
Memo/Event Field
The Memo/Event field is used to enter a message to be displayed at the time of the alarm event.
Alarm Status
When the Status option is checked, the selected alarm is set.
When an alarm is set, a bell icon appears at the right edge of the analog clock field as an indicator. Alarms are active only while the frame containing the analog clock is running.
Alarm Messages
When an alarm is triggered, a message box appears containing the message associated with the alarm.
The timekeeping and display functions of the analog_clock field and the digital_clock and elapsed_timer fields are handled by a number of user classes. All three fields are based on the timer_manager user class, which in turn uses several private classes and subclasses to perform its functions. For more information, see the appendix "Generated User Classes" in the Language Reference Guide.