Window owning and non-window owning controls

Window-owning controls

Window-owning controls have the same size and position as a window in the display. Each window has a one-to-one relationship with the control that covers it, and shares its behavior with that control.

Examples of window-owning controls include:

The following code snippet is an example of the second phase construction of a window-owning control:

       
        
       
       CMyControl::ConstructL()
    {
    CreateWindowL();    // This makes the control window- 
                        // owning
    SetRectL(ClientRect()); // This sets the control’s 
                            // size
    ActivateL();        // This must be called before
                        // the control can be drawn
    }
      

CEikAppUi::ClientRect() returns the screen area available to the application for drawing. This typically does not include the space that is reserved for the status/control panes.

For more information, see The run-time control hierarchy

Non-window-owning controls

Non-window-owning controls typically cover only part of a window on the display, and must be contained in window-owning controls. They are faster and require fewer resources than window-owning controls.

Examples of non-window-owning controls include:

  • command buttons

  • edit windows

  • labels

Non-window-owning controls are assigned to window-owning controls by calling CCoeControl::SetContainerWindowL() when the control is constructed.

For more information, see The run-time control hierarchy