API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
- IDrawDecorator Interface - IWidget Interface - IDrawDecorator_GetWidget() - IDrawDecorator_SetExtent() - IWidget_SetExtent()
This function wraps the draw decorator around a target widget, and makes the target widget the child of the draw decorator. Once wrapped, the draw decorator may use a custom draw handler to enhance the visual display of the widget. For example, a draw decorator might be created to draw a wavy frame around a widget that displays bitmap images. The application would call IDrawDecorator_SetWidget() specifying both the draw decorator and the bitmap widget to make the decorator/widget binding, then hook a custom "wiggly frame" draw handler to the draw decorator to achieve the visual desired effect.
Pointer to the IDrawDecorator object that will be wrapped around the target widget.
Pointer to the target widget that will be managed by the draw decorator, or NULL if the decorator is to be completely detached from any child widgets.
  •    void IDrawDecorator_SetWidget(IDrawDecorator *p, IWidget *pw)
  • None
Side Effect
  • Calling IDrawDecorator_SetWidget() will set the extent of the draw decorator to be the exact same size as the widget it wraps. Therefore, a draw decorator that intends to decorate the widget "outside the lines" (i.e. a frame or border that draws around the widget), should subsequently call IDrawDecorator_SetExtent() to force the extent of the draw decorator to be greater than that of the child widget. Conversely, the application could call IWidget_SetExtent() to force the extent of the wrapped widget to be smaller than the draw decorator.
The reference count of the target widget 'pw' will be incremented.