CFixedGridobjects provide the means to arrange other
CSubviewobjects into defined grid cells. All
CFixedGridcells are homogeneous in size. For more information, see
CViewobjects into its cells. Objects inside a grid can either clip to their enclosing cell or force the cell to enlarge to incorporate the largest object.
All row and column operations assume that 0,0 is the coordinate for the top-left cell.
const CRect& theRegion,
theEnclosureis a pointer to the subview that will contain the grid. theRegion is a coordinate location, local to the enclosure, that is used to place the grid. This method also requires you to specify the number of rows and columns in the grid, and it divides the given region into rows and columns.
CPointcoordinate for placing the top-left corner of the grid. You specify the size of the grid by giving it a row height and a column width, as well as the number of rows and columns.
CFixedGrid(const CFixedGrid& theGrid);
CFixedGrid& operator=(const CFixedGrid& theGrid);
BOOLEAN IFixedGrid(BOOLEAN isClipping = TRUE,
PLACEMENT thePlacement = TOPLEFT,
BOOLEAN isGridVisible = FALSE,
POLICY theSizingPolicy = ADJUSTCellSize,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);
isClippingparameter takes a
BOOLEANvalue indicating whether the items placed in the grid are clipped to their cells. By default, clipping is turned on.
thePlacementspecifies the orientation for placing items in their cells-in the top left corner by default.
isGridVisiblesets whether the lines of the grid are visible or not.
theSizingPolicytakes a value indicating one of the two different sizing policies for grids:
ADJUSTCellSize(the default) or
isVisibleparameter sets the visibility state for the entire grid object (as opposed to
isGridVisible, which pertains to the horizontal and vertical lines within the grid). Finally, this initializer takes a glue type. You can override one or more of these defaults by calling
CFixedGridoverrides the following basic inherited methods.
virtual CRect GetCellSize(int theRow,
int theColumn) const;
CRect, which consists of that cell's coordinates, which are local to the grid. A
CRect(0,0,0,0) is returned it
virtual int GetRow(UNITS theVerticalPoint) const;
virtual int GetCol(UNITS theHorizontalPoint) const;
CFixedGridoverrides the following basic inherited methods:
virtual void SizeCell(UNITS theNewCellWidth,
virtual void SetNumCells(int theNumberOfColumns,
BOOLEAN theGridWillResize = TRUE);
SetNumCellsenlarges or reduces the size of the entire grid by giving it the specified number of columns and rows.
FALSE, the overall size of the grid does not change. In this case, the sizes of the cells are adjusted to fit
virtual UNITS GetWidth(int col = 0) const;
virtual UNITS GetHeight(int row = 0) const;