Developer

API Reference

AEECLSID_BitmapWidget

Brew Release
Brew MP 1.0.2
See Also
Model Events ISHELL_CreateInstance() IWidget_SetBitmap() IInterfaceModel_SetIPtr() Widget Events AEEEvent
Description
The bitmap widget is used to display a bitmap image on the display. For example, a photo of your on-line buddy could be rendered as a bitmap widget. Likewise, an icon displayed in a list or an image displayed as part of a checkbox or radio button could all be managed by bitmap widgets.
Applications specify the bitmap to be displayed in the widget by calling IWidget_SetBitmap(), passing in a pointer to the IBitmap image to be displayed. The image itself will be displayed with its origin at the top-left corner of the widget's destination rectangle, cropped to the width and height of the widget's extent. The image is neither stretched, shrunk nor scaled to fit into the destination rectangle. The alignment of the bitmap image within the widget's destination rectangle can be altered by the following flags.
       Alignment Mask     Results
       --------------     -------
       IDF_ALIGN_LEFT     The image is displayed relative to the left coordinate of the
                          widget's border rectangle.  If the width of the image extends
                          beyond the border's right coordinate, it will be cropped on
                          the right side.
       IDF_ALIGN_RIGHT    The image is displayed relative to the right coordinate of the
                          widget's border rectangle.  If the width of the image extends
                          beyond the border's left coordinate, it will be cropped on the
                          left side.
       IDF_ALIGN_CENTER   The image is displayed horizontally centered in the widget's
                          border rectangle.  If the width of the image is wider than the
                          border rectangle, it will be cropped on both the left and right
                          sides.
       IDF_ALIGN_TOP      The image is displayed relative to the top coordinate of the
                          widget's border rectangle.  If the height of the image extends
                          below the border's bottom coordinate, it will be cropped on
                          the bottom side.
       IDF_ALIGN_BOTTOM   The image is displayed relative to the bottom coordinate of the
                          widget's border rectangle.  If the height of the image extends
                          above the border's top coordinate, it will be cropped on the
                          top side.
       IDF_ALIGN_MIDDLE   The image is displayed vertically centered in the widget's
                          border rectangle.  If the height of the image is larger than the
                          height of the border rectangle, the image will be cropped on both
                          the top and bottom sides.

By default, the bitmap is aligned with the flags IDF_ALIGN_LEFT and IDF_ALIGN_TOP.
To create a bitmap widget, an application would do the following:
       1. Call ISHELL_CreateInstance() with a class ID of AEECLSID_BitmapWidget to
          retrieve a reference counted instance of the bitmap widget.
       2. Call IWidget_SetBitmap() to identify the IBitmap image to be displayed by
          the widget.
       3. If the bitmap is to be displayed with transparency, call IWidget_SetTranspColor()
          passing in the RGB value of the transparency color.

Supported Events: The bitmap widget handles a very small set of events, as described below.
Event                 Description
-----                 ------------------------------------------------------------
EVT_WDG_SETPROPERTY:  The bitmap widget responds to this event by attempting to set the
                      property identified by the 'wParam' parameter.  The bitmap widget
                      allows the following properties to be set
                      
                          PROP_TRANSP_COLOR   --  Sets the transparency color to be used
                                                  when transferring the bitmap image to
                                                  the screen.
                      
                      The bitmap widget will return FALSE after setting the specified
                      property, thereby allowing other objects in the hierarchy to also
                      process the event.


Properties:
Property             Description
--------             ------------------------------------------------------------
PROP_TRANSP_COLOR:   This property determines how the bitmap will be transferred to the
                     display.  Set PROP_TRANSP_COLOR to RGB_NONE to copy the bitmap without
                     any transparency (i.e. every pixel in the source bitmapped will be
                     copied to the display), otherwise the bitmapped will be transferred
                     with transparency.

Required Model: IInterfaceModel
Model Data:
   
   IBitmap *modelData;

The bitmap widget relies on an interface model that represents its data as a pointer to an IBitmap data structure. The model stores only a pointer to the bitmap, not a copy of the bitmap itself, and should always return this pointer in response to data queries from a client widget.
A default model is created and assigned to the widget when the widget is created with ISHELL_CreateInstance(). The client can replace the widget's model at any time with the method: IWidget_SetModel(), as long as the supplied model interface is of the type that the widget expects.
Instantiaion
A new instance of the bitmap widget class object may be created by calling ISHELL_CreateInstance() and passing in AEECLSID_BitmapWidget.
Cleanup
The Bitmap Widget is reference-counted. When you are done with your reference to the bitmap widget, you should Release that reference with IWidget_Release(). Any specific cleanup will be handled for you when all references are released.
Default Interface Name
Other Interfaces
Comment
None
  • Follow