Defining a New Method

To add a method to an existing class, you use the following syntax to begin the method definition:
winclass ExistingClass : ExistingClass

The syntax ExistingClass : ExistingClass means that the declaration that follows extends the existing class definition, instead of replacing it.

Note: Adding a method to an existing class adds the method to all instances of the class.


To add a SelectAll() method to the TextField class, add the following code to your file:
 winclass TextField : TextField
In your test cases, you can then use the SelectAll method like any other method in the TextField class.