Developer

API Reference

IConstraintContainer_Insert()

Brew Release
Brew MP 1.0.2
See Also
- IConstraintContainer Interface
- IWidget Interface
- WidgetConstraint
- IConstraintContainer_Remove()
Description
This function allows an application to insert a widget into the constraint container's widget stack -- at the top of the stack, at the bottom, or some place in-between. By default, widgets will be inserted at the top of the stack. However, an application may choose to instead insert widgets anywhere within the container's widget stack. For example, consider an application that wishes to keep one widget always at the top of the container's widget stack so that the layout of this widget is always based on the location of the topmost visible widget. As new widgets are added to the screen, the application wants to make sure that the fixed widget remains on the top of the stack, so each time a new widget is added it will be inserted before the fixed widget, passing a pointer to the fixed widget in the function's 'pb' parameter.
Parameters
  • p
    []:
    A pointer to an IConstraintContainer object.
  • pw
    []:
    Pointer to the widget to be inserted into the constraint container's widget stack.
  • pb
    []:
    Indicates where in the constraint container's widget stack that the new widget should be inserted. This value may be expressed as either a pointer to a widget already in the widget stack, in which case the new widget will be inserted immediately before the widget pointed to by 'pb' -- or as a constant that identifies a relative position within the widget stack, as
  • follows
    []:
    WIDGET_ZNORMAL - Allow BREW to place the inserted widget at the default location. For a constraint container, this places the new widget at the top of container's widget stack. WIDGET_ZTOPMOST - The new widget should be inserted as the topmost widget in the container's widget stack. WIDGET_ZBOTTOMMOST - The new widget should be inserted as the bottommost widget in the container's widget stack.
  • pwc
    []:
    Pointer to a WidgetConstraint data structure, containing the constraint value for the inserted widget, as well as its visibility attribute. If this parameter is set to NULL, pw will be inserted with WIDGET_KEEP_EXTENT and an offset of zero for all constraints, and visibility will be set to TRUE.

Prototype
   int IConstraintContainer_Insert(IConstraintContainer *p, IWidget *pw, IWidget *pb, const WidgetConstraint *pwc);
Return
   
   AEE_SUCCESS   --  The widget was successfully inserted into the constraint container's widget stack.
   AEE_EBADPARM  --  The widget pointer passed in 'pb' either does not exist, or refers to a widget
                 that is not in the constraint container's widget stack.
   ENOMEMORY --  The widget stack could not grow to accommodate a new widget.

Side Effect
Calling IConstraintContainer_Insert() will cause the constraint container to adjust the object layout to include the newly added widget.
Comment
None
  • Follow