Compound controls in S60 view architecture

Compound controls are controls that contain other controls. To create a compound control, you must do the following:

CCoeControl* CContainerContainer::ComponentControl(TInt aIndex) and CCoeControl::CountComponentControls work in conjunction with each other. The S60 platform can query the control as to how many components it has and then request a pointer to each of the component's controls. Controls can be added or removed at run time using these two methods. The framework uses this information to draw the container.

The compound control usually owns the child controls and therefore it is responsible of their construction and destruction. The compound control should also set the positions and sizes of its child controls; it must ensure that all child controls are inside the compound control rectangle and visible child rectangles do not overlap each other.