Developer

API Reference

AEECLSID_BlendWidget

Brew Release
Brew MP 1.0.2
See Also
Model Events AEECLSID_BorderWidget IWidget_SetExtent() IWidget_SetProperty() IWidget_SetModel() IWidget_SetTransparency() ISHELL_CreateInstance() Widget Events
Description

The blend widget is derived from the decorator object and is used as a visual filter through which a child widget will be blended into the display. The effect is to make the child widget appear semi-transparent (i.e. "dimmed" or "faded"). Typically, a user interface will display inactive objects in a distinctly subdued manner to lessen their prominence on the display. For example, an application may choose to dim a bitmap image depending on some application state (off-line buddies, a dormant network connection, etc).
A blend widget is created by calling ISHELL_CreateInstance() and passing AEECLSID_BlendWidget as the class id. If successful, a pointer to the blend widget object will be returned in the 'ppobj' parameter of ISHELL_CreateInstance.
Applications may control the degree to which the underlying widget will be blended by setting the PROP_TRANSPARENCY property of the blend widget. A PROP_TRANSPARENCY value of 0 would produce a fully opaque result. A value of 1 would add a small degree of transparency to the widget, 2 a little more, 3 a little more... up to 255 which would render the widget completely transparent (i.e. invisible!). The default is to apply a completely transparent blend.
To create a blend widget, an application would do the following: 1) Call ISHELL_CreateInstance() with a class ID of AEECLSID_BlendWidget to retrieve a reference counted instance of the blend widget. 2) If the blend widget is to be displayed with a degree of transparency, call IWidget_SetTransparency().
Once a blend widget has been created, it can be used to affect the display of other widgets. Continuing the example above, the newly created blend widget could be attached as a decorator to the child widget we wish to display with some level of transparency.
Supported Events:
The blend widget handles events to get or set the properties that will control how blend effects should be applied to the widget that it decorates. Events not identified below will be routed to the base decorator widget from which the blend widget is derived.
Event                 Description
-----                 ------------------------------------------------------------
EVT_WDG_SETPROPERTY:  The blend widget responds to this event by attempting to set the
                      property identified by the 'wParam' parameter.  The blend widget 
                      allows the following properties to be set. 
                      
                          PROP_TRANSPARENCY   --  Sets the transparency level of the blend 
                                                  widget. 
                          PROP_ALPHA          --  Sets the opacity level of the blend widget 
                          PROP_BUFFERED       --  Sets the buffered status of the blend widget 
                                                  
                      These properties are discussed below in greater detail. 

                      The blend widget will route the EVT_WDG_SETPROPERTY event to the 
                      base decorator widget if 'wParam' identifies a property that does
                      not appear in the list above. 

EVT_WDG_GETPROPERTY:  The blend widget responds to this event by attempting to retrieve 
                      the property identified by the 'wParam' parameter.  The blend widget 
                      allows the following properties to be retrieved. 
                      
                          PROP_TRANSPARENCY   --  Gets the transparency level of the blend 
                                                  widget. 
                          PROP_ALPHA          --  Gets the opacity level of the blend widget. 
                          PROP_BUFFERED       --  Gets the buffered status of the blend widget. 
                                                  
                      These properties are discussed below in greater detail. 

                      The blend widget will route the EVT_WDG_GETPROPERTY event to the 
                      base decorator widget if 'wParam' identifies a property that does 
                      not appear in the list above. 


Properties:
Property             Description
--------             ------------------------------------------------------------
PROP_TRANSPARENCY:   This property controls the degree to which the underlying widget will be 
                     blended.  A value of 0 would produce a fully opaque result.  A value of 1 would 
                     add a small degree of transparency to the widget, 2 a little more, 3 a little 
                     more... up to 255 which would render the widget completely transparent 
                     (i.e. invisible!). PROP_ALPHA and PROP_TRANSPARENCY are tied with the 
                     relationship valueof(PROP_ALPHA) == 255 - valueof(PROP_TRANSPARENCY) - 
                     i.e. changing one will change the other. 
 
PROP_ALPHA           This property controls the degree to which the underlying widget will be 
                     blended.  A value of 0 would produce a fully transparent result 
                     (i.e. invisible!).  A value of 1 would add a small degree of opacity to the 
                     widget, 2 a little more, 3 a little more... up to 255 which would render the 
                     widget completely opaque. See also PROP_TRANSPARENCY. 
 
PROP_BUFFERED        This property controls whether or not a drawing of the BlendWidget requires its 
                     child widget to redraw itself. If PROP_BUFFERED is TRUE, then the child 
                     widget's draw is buffered, and the child widget is only asked to redraw when 
                     necessary (as a result of invalidating itself). Otherwise the buffer is used, 
                     and the child does not need to draw. This has potential performance benefits 
                     for complex child content. 

Required Model: None
Instantiaion

A blend widget is created by calling ISHELL_CreateInstance() and passing AEECLSID_BlendWidget as the class ID. If successful, a pointer to the blend widget object will be returned in the ppobj parameter of ISHELL_CreateInstance.
Cleanup

The Blend Widget is reference counted. When you are done with your reference to the blend widget, you should Release it. Any specific cleanup will be handled for you when all references are released.
Default Interface Name
Other Interfaces
Side Effect

Setting the PROP_TRANSPARENCY on a blend widget will invalidate the widget's parent decorator widget.
Comment

None
  • Follow