Chapter 16. The EPOC Simple Forms Type 1 Support

esf1

Description

This is the EPOC R6 Crystal form implementation for use on devices like the Nokia Communicator series (9210/9290). It is typically called EPOC Simple Form Type 1.

Object Value

None

esf1.new()

Description

Creates an EPOC simple form with the specified caption. If no caption is given then the form will never have a caption. If a caption is provided then a form will always have a caption. The standard syntax is to name the caption parameter, as in: esf1.new(caption = "My Form").

Prototype

fsfileinputstream.new ( string caption )

Parameters

ParameterType nameDescription
captionstringThe caption to be assigned to the form

Properties

PropertyTypeAccessDescription
activebooleanread-onlyIndicates whether or not the form is active (displayed)
captionstringread-only Contains either the value .nul or the current caption
firstcbabuttonesf1cbabuttonread-only Contains a reference to the first Control Button Array (cba) button on the form. Every esf1 form has four cba buttons associated with it.
firstcontrolesf1controlread-only Contains a reference to the first control created for the form
focuscontrolesf1controlread-only Contains a reference to the control (if any) that currently has focus

Methods

activate()

Prototype

esf1var.activate ()

Description

Makes this form the active form. Returns .nul.

Parameters

None.

addcontrol()

Prototype

esf1var.addcontrol ( controltype type, integer left, integer top, integer width, integer height, esf1control next, integer error )

Description

Adds a control to an esf1 type form. The type parameter must be specified (such as esf1text). Default values for left, top, width, and height are all 1. Default value for next is .nul, which puts the new control before esf1.firstcontrol. If an error object is given it can be used to catch errors and cause a null object reference to be returned. The normal return value is a reference to the new control object. The new control must fit within the bounds of the form or an error is raised (or output in the error object).

Parameters
NameDefaultTypeDescription
type.nul.nul If an error object has been supplied, then an error will be returned in the object, and .nul will be returned from the function, otherwise a runtime error will occur.
any esf1 control type A control of the desired type will be created and returned, as long as no other reason for an error exists.
left1any valid value The control's upper left corner will start at the desired horizontal position, if the position is not within the bounds of the form, then an error will occur. If an error object was passed, then the error will be returned in the object and the function will return .nul as its result, otherwise a runtime error will occur.
top1any valid value The control's upper left corner will start at the desired vertical position, if the position is not within the bounds of the form, then an error will occur. If an error object was passed, then the error will be returned in the object and the function will return .nul as its result, otherwise a runtime error will occur.
width1any valid value The control's width will be set to the value passed, if the resulting control position is not entirely within the bounds of the form, then an error will occur. If an error object was passed, then the error will be returned in the object and the function will return .nul as its result, otherwise a runtime error will occur.
height1any valid value The control's height will be set to the value passed, if the resulting control position is not entirely within the bounds of the form, then an error will occur. If an error object was passed, then the error will be returned in the object and the function will return .nul as its result, otherwise a runtime error will occur.
next.nul.nulThe control will be added in front of the current first control
an existing esf1controlThe control will be placed in the control ring in front of the control referenced.
errornoneinteger This parameter must be an object, not an integer value. If an error (other than a syntax or parameter passing error) occurs because the new object position is not completely within the form, then the error number will be output to the specified object. If no error object is provided and an error occurs then the program will exit with an unhandled exception.

break()

Prototype

esf1var.break ()

Description

Breaks out of all process() methods currently associated with the form object. Returns .nul.

Parameters

None.

process()

Prototype

esf1var.process ( integer timeout )

Description

Puts the form into event processing mode until the timeout occurs or until the break() method is called. Returns .nul.

Parameters
NameDefaultTypeDescription
timeout.inf.nul A timeout of .nul does not wait in process for any length of time.
.inf A timeout of .inf waits in process forever (until the break() method is called).
integer The maximum amount of time to process events for before returning. The time is specified in microseconds.

processflush()

Prototype

esf1var.processflush ()

Description

Discards any pending input/events. Returns .nul.

Parameters

None.

setcaption()

Prototype

esf1var.setcaption ( string caption )

Description

Changes the form title bar caption. This can only be changed if the form was created with a caption (even if the value of the caption was ""). Returns .nul.

Parameters
NameDefaultTypeDescription
caption.nulany text value An entry of .nul or .inf will cause an error, any other value will be assigned although a value can be too long to be completely displayable.

setfocuscontrol()

Prototype

esf1var.setfocuscontrol ( esf1control control )

Description

Requests that the specified control should receive focus when the form is next in process(). Returns .nul.

Parameters
NameDefaultTypeDescription
controlesf1controlany esf1control The esf1control that will be given focus when the program returns to process().