Developer

API Reference

IRootContainer_SetPos()

Brew Release
Brew MP 1.0.2
See Also
- IRootContainer
- IWidget
- WidgetPos
- IRootContainer_GetPos
Description
This function will change the layout position of a given widget within the root container, moving this widget to a new (x, y) location. The function may also, optionally, relocate that widget to a different spot in the root container's widget stack -- effectively changing the order of the stack. The new layout position and visibility attributes are passed to the function in a WidgetPos structure, pointed to by the 'ppos' parameter. The widget to receive the new attributes may be specified explicitly, by its widget pointer, or implicitly by a constant that identifies the widget's relative position within the root container's widget stack. The 'piwBefore' parameter controls whether or not the widget's order within the stack will move. Passing the constant WIDGET_ZNORMAL leaves the widget where it currently stands, without altering the order of the stack. Passing WIDGET_ZTOPMOST or WIDGET_ZBOTTOMMOST will move the widget to the top or bottom of the stack, while passing an explicit widget pointer will move the target widget to the stack location before the widget passed in 'piwBefore'.
Parameters
  • pif
    []:
    A pointer to an IRootContainer object.
  • pw
    []:
    Identifies the widget in the root container's widget stack that will be the target of the layout position change and (optionally) stack order relocation. This widget may be expressed explicitly as a widget pointer, or implicitly as a constant that identifies a relative position within the widget stack, as follows WIDGET_ZNORMAL - The target widget is the default widget, which BREW interprets to be the widget at the top of the widget stack. WIDGET_ZTOPMOST - The target widget is the widget at the top of the widget stack. WIDGET_ZBOTTOMMOST - The target widget is the widget at the bottom of the widget stack.
  • piwBefore
    []:
    Identifies a widget in the root container's widget stack that will serve as the relocation spot for the target widget. When this parameter is passed as an explicit pointer to a widget in the container's widget stack, the target widget will be moved to the stack location that is _before_ this widget. The new location for the target widget may be passed implicitly as a relative location in the stack by passing any of the following constants WIDGET_ZNORMAL - Specifies that the target widget should NOT be moved and should instead remain at its current location in the widget stack. WIDGET_ZTOPMOST - The target widget should be moved to the top of the widget stack. WIDGET_ZBOTTOMMOST - The target widget should be moved to the bottom of the widget stack.
  • ppos
    []:
    Pointer to a WidgetPos data structure, containing the new (x, y) location for the target widget, as well as its visibility attribute.

Prototype
   int IRootContainer_SetPos(IRootContainer *pif, IWidget *pw, IWidget *piwBefore, const WidgetPos *ppos);
Return
   
   AEE_SUCCESS   --  The layout position of the widget was successfully changed.
   AEE_EBADPARM  --  The widget pointers passed in 'pw' and/or 'piwBefore' either do not exist, or
                 refer to widgets that are not in the root container's widget stack.

Side Effect
None
Comment
If IRootContainer_SetPos() is being called to change the location of the widget within the root container's widget stack without changing the layout position of the widget, the caller MUST still pass in a pointer to the correct layout position in the 'ppos' parameter. In such cases, the application should first call IRootContainer_GetPos() to retrieve the current layout position, then call IRootContainer_SetPos() passing back the results received from IRootContainer_GetPos().
  • Follow