Developer

API Reference

IGridContainer_Insert()

Brew Release
Brew MP 1.0.2
See Also
- IGridContainer Interface
- IWidget Interface
- IGridContainer_Remove()
Description
This function allows an application to insert a widget into the grid 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 instead to 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 IGridContainer object.
  • pw
    []:
    Pointer to the widget to be inserted into the grid container's widget stack.
  • pb
    []:
    Indicates where in the grid 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 grid 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 at the bottommost widget in the container's widget stack.
  • bVisible
    []:
    This parameter should point to a valid boolean in memory set to TRUE, if pw should be visible, or FALSE, if pw should not be visible. If this parameter is set to NULL, pw will be inserted with visibility set to TRUE.

Prototype
   int IGridContainer_Insert(IGridContainer *p, IWidget *pw, IWidget *pb, const boolean *bVisible);
Return
   
   AEE_SUCCESS   --  The widget was successfully inserted into the grid 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 grid container's widget stack.
   ENOMEMORY --  The widget stack could not grow to accommodate a new widget.

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