Create another Button Reusable Part

The ancestor of  a reusable part does not have to be a primitive component (#PRIM_*), it can also be another reusable part.

To see how this works, create a new reusable part (in this example it is called #EOEXAM21). Make its Ancestor the button reusable part (EOEXAM20) created in the previous section. Make its Caption "Button B".

Make the Group property of the part "Buttons".

Note that apart from the BEGIN_COM statement your reusable part does not contain any code:

FUNCTION OPTIONS(*DIRECT)

BEGIN_COM ROLE(*EXTENDS #EOEXAM20) CAPTION('Button B')

END_COM

However, even though not visible in the source code, it inherits the Click event behavior from its ancestor EOEXAM20.

Compile the reusable part.