Name Description Size
crashtests 9 1026
nsGrid.cpp The grid control expands the idea of boxes from 1 dimension to 2 dimensions. It works by allowing the XUL to define a collection of rows and columns and then stacking them on top of each other. Here is and example. Example 1: <grid> <columns> <column/> <column/> </columns> <rows> <row/> <row/> </rows> </grid> example 2: <grid> <columns> <column flex="1"/> <column flex="1"/> </columns> <rows> <row> <label value="hello"/> <label value="there"/> </row> </rows> </grid> example 3: <grid> <rows> <row> <label value="hello"/> <label value="there"/> </row> </rows> <columns> <column> <label value="Hey I'm in the column and I'm on top!"/> </column> <column/> </columns> </grid> Usually the columns are first and the rows are second, so the rows will be drawn on top of the columns. You can reverse this by defining the rows first. Other tags are then placed in the <row> or <column> tags causing the grid to accommodate everyone. It does this by creating 3 things: A cellmap, a row list, and a column list. The cellmap is a 2 dimensional array of nsGridCells. Each cell contains 2 boxes. One cell from the column list and one from the row list. When a cell is asked for its size it returns that smallest size it can be to accommodate the 2 cells. Row lists and Column lists use the same data structure: nsGridRow. Essentially a row and column are the same except a row goes alone the x axis and a column the y. To make things easier and save code everything is written in terms of the x dimension. A flag is passed in called "isHorizontal" that can flip the calculations to the y axis. Usually the number of cells in a row match the number of columns, but not always. It is possible to define 5 columns for a grid but have 10 cells in one of the rows. In this case 5 extra columns will be added to the column list to handle the situation. These are called extraColumns/Rows. 32158
nsGrid.h The grid data structure, i.e., the grid cellmap. 5448
nsGridCell.cpp 2934
nsGridCell.h Author: Eric D Vaughan 1423
nsGridLayout2.cpp 6965
nsGridLayout2.h The nsBoxLayout implementation for a grid. 3290
nsGridRow.cpp 1099
nsGridRow.h Author: Eric D Vaughan 1143
nsGridRowGroupFrame.cpp This is redefined because row groups have a funny property. If they are flexible then their flex must be equal to the sum of their children's flexes. 1741
nsGridRowGroupFrame.h Eric D Vaughan A frame that can have multiple children. Only one child may be displayed at one time. So the can be flipped though like a deck of cards. 1472
nsGridRowGroupLayout.cpp The nsGridRowGroupLayout implements the <rows> or <columns> tag in a grid. 7680
nsGridRowGroupLayout.h Author: Eric D Vaughan 1950
nsGridRowLayout.cpp 5177
nsGridRowLayout.h Author: Eric D Vaughan 2334
nsGridRowLeafFrame.cpp Our border and padding could be affected by our columns or rows. Let's go check it out. 2517
nsGridRowLeafFrame.h Eric D Vaughan A frame that can have multiple children. Only one child may be displayed at one time. So the can be flipped though like a deck of cards. 1758
nsGridRowLeafLayout.cpp If a child is added or removed or changes size 10086
nsGridRowLeafLayout.h Author: Eric D Vaughan 2386
nsIGridPart.h An additional interface implemented by nsBoxLayout implementations for parts of a grid (excluding cells, which are not special). 4019
reftests 32