API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
- IGridContainer_GetGridDescriptors() - GridDescriptor - IGridContainer
In order to properly use a grid container, two GridDescriptors need to be set, one for rows and one for columns. In order to set the GridDescriptors, create two arrays of GridDescriptors and initialize their data. Each row/column will be described by a GridDescriptor within the array. The zeroth element will correspond to the topmost row or leftmost column depending on whether you are describing a row or column. The array describing the rows (pRows) should be of length iRows. Similarly, the array describing columns (pCols) should be of length iCols. NULL may be passed in if you do not wish to set that descriptor e.g. -
   IGridContainer_SetGridDescriptors(picMyGrid, NULL, NULL, pCols, &iCols);
In this case, only the column GridDescriptors will be set. A layout will still be performed on the child widgets. Also note that grid container makes a copy of the GridDescriptors passed in, so it is not necessary to keep them in memory after this call.
[in] A pointer to an IGridContainer object.
[in] An array of GridDescriptors of length iRows describing the rows of the grid container.
[in] The number of rows the grid container has as well as the length of pRows
[in] An array of GridDescriptors of length iCols describing the columns of the grid container
[in] The number of columns the grid container has as well as the length of pCols

  •    int IGridContainer_SetGridDescriptors(IGridContainer *po, GridDescriptor *pRows, uint16 *iRows,
                                             GridDescriptor *pCols, uint16 *iCols);
  •    AEE_SUCCESS: Either the row or column grid descriptors were set properly.  This also indicates
                   grid container performed a layout on the contained widgets.
       AEE_EFAILED: Neither the row nor column grid descriptors were set because grid container
                   could not allocate new grid descriptors or the grid descriptors were identical to the
                   existing ones.  This return code indicates that a layout was not performed.
       ENOMEMORY:  This is a serious issue.  Grid container will set the number of rows/columns to zero 
                   in order to prevent a segmentation fault.
Side Effect
  • None
Do not attempt to change the number of rows or columns a grid container has by simply calling this function with iRows/iCols and NULL GridDescriptor parameters (pRows and pCols). If it were that straightforward, IWidget_SetProperty() would work for PROP_ROWS and PROP_COLS, which it does not. Grid container needs a valid array of GridDescriptors which corresponds to the new row/column size every time this function is called.