Developer

API Reference

IPropContainer_GetPadding()

Brew Release
Brew MP 1.0.2
See Also
-IPropContainer_SetPadding()
Description
This function retrieves the padding that will be applied before and/or after the given widget. The values returned are either the proportional layout value or the exact number of pixels to be applied before and/or after the widget during layout. Positive values are to be interpreted as proportional layout values - the numerator of the fraction of this spacer's extent to the combined extents of all other proportional objects managed by the container. Negative values are to be interpreted as the exact pixel width to be left clear ahead and/or behind the widget.
Parameters
  • p
    []:
    A pointer to an IPropContainer object.
  • pw
    []:
    Identifies the widget within the prop container's widget stack that will serve as a reference point for the widget to be retrieved. 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 - Use the widget at the prop container's default location as the retrieval reference point. BREW interprets this to be the widget at the top of the widget stack. WIDGET_ZTOPMOST - Use the widget at the top of the widget stack as the retrieval reference point. WIDGET_ZBOTTOMMOST - Use the widget at the bottom of the widget stack as the retrieval reference point. When 'pw' is NULL, the function will return either the top or bottom widget on the stack, depending on the value of 'd'. When 'pw' is NULL and 'd' is TRUE, IPropContainer_GetWidget() will return the bottommost widget. When 'pw' is NULL and 'd' is FALSE, the function will return the topmost widget.
  • pdwBefore
    []:
    Contains the padding value to be applied ahead of the widget. If this value is positive, it indicates a proportional layout value. If this value is negative, it indicates an exact pixel value.
  • pdwAfter
    []:
    Contains the padding value to be applied behind the widget. If this value is positive, it indicates a proportional layout value. If this value is negative, it indicates an exact pixel value.

Prototype
   int IPropContainer_GetPadding(
      IPropContainer *p, 
      IWidget *pw, 
      int16 *pwBefore, 
      int16 *pwAfter);
Return
   
   AEE_SUCCESS   --  The spacing around the widget was successfully retrieved.
   AEE_EBADPARM  --  The widget pointer passed in 'pw' either does not exist, or 
                 refers to a widget that is not in the prop container's widget 
                 stack.

Side Effect
None
Comment
Assuming a PropContainer has been set up with a number of widgets, the following code can be used to obtain the padding before and after a certain widget.
   
       IWidget *pWidget = NULL;
       int16 wBefore, wAfter;

       if (AEE_SUCCESS == IPropContainer_GetPadding (
                        pPropContainer, 
                        pWidget, 
                        &wBefore,
                        &wAfter)) {
          
         if (dwBefore > 0) {
            // this is a proportional layout value
         } else {dwBefore < 0)
            // -dwBefore is the number of pixels to be 
            // left clear ahead of this widget
         } else {
            // No leading padding in front of this widget
         }

         if (dwAfter > 0) {
            // this is a proportional layout value
         } else {dwAfter < 0)
            // -dwAfter is the number of pixels to be left 
            // clear behind of this widget
         } else {
            // No leading padding behind of this widget
         }

       }

  • Follow