Adding Methods to Your Subclassed Control

You can add new methods to your control class as you can for any other class. Some of the methods that you add are likely to be the reimplementation of superclass methods.

Controls have the following method types.

Event methods are methods that are usually triggered by an event.

Event methods execute the logic in the method and then call a method (whose method name is specified by the control-name_this-method-name signature) of the form on which the control is placed.

When you reimplement an event method, include the inheritMethod call.

You must add event methods as external methods.

When you create your own event external methods, the highest method that is not reimplemented has the following format.

event-name(parameter-list) is CallControlEvent in jadpmap updating;

At run time, it is this call that causes a form message to be generated. Methods are event methods only if the highest level of method implementation has a signature with this format.

When a control is displayed during painting (that is, at development time), the control can respond only to the create, paint, and windowCreated events.

If you reimplement these methods, ensure that you include an inheritMethod call. For example, if your subclassed control implements the click method, calling the inheritMethod instruction causes the control-name_click method to also be executed. When you add an event to your control, JADE does nothing to that event unless you write code to implement it.

For details, see the appropriate method in Chapter 2 of the JADE Encyclopaedia of Classes.

Generally, where there is a requirement to set default values for properties, a constructor is implemented for the class. Alternatively, your method can perform initialization logic in the windowCreated event. You can also reimplement the following methods that control how your subclassed control is manipulated in the JADE Painter.

For details, see Chapter 2 of the JADE Encyclopaedia of Classes.

In the Properties dialog, you can control how the property value is displayed and the values that are acceptable (that is, you can provide validation of the input value). To do this, reimplement the following methods.