Many factors have to be taken into consideration when laying out controls. Component controls are normally laid out within their containers according to the prevailing UI policy, skin, font, text style, zoom-factor and the sizes and shapes of the controls themselves. A change to any one of these might necessitate a new layout.
The Control Framework supports run-time layout management with the MCoeLayoutManager interface. Each compound control knows which layout manager to call when it changes size. The layout manager then takes responsibility for making any adjustments to the layout.
A layout manager is associated with a compound control using:
Note that this call passes 'ownership' so the caller does not need to retain a pointer. A layout manager may be attached to more than one control so it must implement its own reference count and delete itself when the count becomes zero. SetLayoutManagerL() is also used to dissociate a layout manager from a control by passing either NULL or a pointer to a different layout manager.
The Control Framework does not provide any concrete layout managers. This is the responsibility of the UI variant library or the application developer.
Though layout managers are now built into the control framework their use is optional.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.