Developer

API Reference

IWidget_SetExtent()

Brew Release
Brew MP 1.0.2
See Also
IWidget IWidget_GetPreferredExtent IWidget_SetPreferredExtent IWidget_GetExtent WidgetExtent
Description
Sets the horizontal and vertical extent of the widget, independent of the widget's preferred size. IWidget_SetExtent() communicates to the widget the size it has been allocated on the display, and provides an opportunity for the widget to adjust its content as best suited for the allotted size. For example, a checkbox widget might choose to truncate, reformat or realign its text label when the extent has shrunk. The new size MUST be honored by the widget, as the parent object will clip any subsequent attempt to draw "outside the lines".
Parameters
  • pif
    []:
    [in] Pointer to the IWidget object.
  • pWExtent
    []:
    [in] Pointer to the WidgetExtent struct that provides the new extent of the widget.
Interface
Prototype
   void IWidget_SetExtent(IWidget *pif, WidgetExtent *pWExtent);
   
Return
None
Side Effect
None
Comment
Some containers may modify the extent of their child widgets regardless of what the application sets it to. In these containers the extent of a widget often changes as the size of the owning object changes. For example, as the size of a container object changes, the container may choose to resize each of the enclosed objects to best manage the available real estate on the display. The container would call IWidget_SetExtent() for any widget that needs to be resized.
Examples of containers which may reset their child widgets extent are ConstaintContainer, PropContainer and most Decorators like BlendWidget, RotateWidget and DrawDecorator.
On the other hand some containers never change their child widgets extent, delegating that responsability to the user. Examples of containers which never change the child's extent are RootContainer and XYContainer.
A widget shall never change its own extent. Only containers or the user shall be able to change the extent of a widget.
  • Follow