From fba773a9a7120b7a7807d86926144d376e4dc0b0 Mon Sep 17 00:00:00 2001 From: kirkpatc Date: Sun, 25 Nov 2007 10:13:29 +0000 Subject: [PATCH] LazDoc - contribution to Grids.xml from Wanderlan Santos dos Anjos git-svn-id: trunk@13018 - --- docs/xml/lcl/grids.xml | 138 +++++++++++++++++++++++++++++------------ 1 file changed, 97 insertions(+), 41 deletions(-) diff --git a/docs/xml/lcl/grids.xml b/docs/xml/lcl/grids.xml index eb88bd1dde..c736769b72 100644 --- a/docs/xml/lcl/grids.xml +++ b/docs/xml/lcl/grids.xml @@ -1139,10 +1139,39 @@ - - - - + The base class for all grid controls + A grid is a collection of cells that are organized in columns and rows. +Grids are adequate to show data that have tabular nature, for example tables in a database. +

Key properties:

+ +The ColCount and RowCount properties contain the column and row count of the grid.

+ +The FixedCols and FixedRows properties specify the count of fixed columns or rows that are used for headings.

+ +The column widths and row heights of the grid are accessible with the ColWidths and RowHeights properties.

+ +The DefaultColWidth and DefaultRowHeight properties are used to specify default column widths or row heights respectively.

+ +The colors of the cells and the grid elements are specified with the AlternateColor, BorderColor, FixedColor, FixedHotColor, FocusColor, GridLineColor and SelectedColor properties. The GridWidth and GridHeight properties contain the dimension of the entire grid.

+ +The ScrollBars property controls the creation of scrollbars for the grid.

+ +The LeftCol, TopRow, VisibleColCount and VisibleRowCount properties contain information about the visible area of the grid.

+ +The Options property controls options for the grid. +

Key methods and events:

+ +If the user highlights a cell of the grid, the SelectCell method is called that triggers the OnSelectCell event. The position of the highlighted cell is stored within the Col and Row property.

+ +The MouseToCell method calculates a grid cell from a given screen position.

+ +Huge changes to the grid should be encapsulated in calls to BeginUpdate and EndUpdate to speed up the application.

+ +Component developers must override the DrawCell method in customized grids. + + + + @@ -2168,14 +2197,12 @@ Before move selection method. - This method is called from TCustomGrid.MoveExtend method. - -This method is called whenever the current grid cursor location is about to change, the destination column and row are specified in DCol and DRow parameters respectively. + This method is called from TCustomGrid.MoveExtend method whenever the current grid cursor location is about to change. The destination column and row are specified in DCol and DRow parameters respectively. The new location is known to be a valid selectable cell (see ), and is given in absolute cell coordinates. At this point the current grid location has not changed and can be retrieved with Col and Row properties. -The purpose of this method in TCustomGrid is to call event handler OnBeforeSelection. +The purpose of this method is to call event handler OnBeforeSelection. @@ -2912,10 +2939,11 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec - - - - + Is called if a grid cell is highlighted. + The SelectCell method is called if a grid cell will be highlighted.

+The aCol and aRow parameters contain the column and the row of the highlighted cell.

+Component developers may use the SelectCell method to react on focus changes. The Result is true if the cell is allowed to be selected. +Application developers should use the OnSelectCell event instead. @@ -3083,28 +3111,38 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec - Number of columns. + Number of columns of the grid. This is the number of columns in the grid, including fixed and normal columns. + + + + + - - - + Column widths for the grid. + The column is specified with the aCol parameter. The aCol parameter must fall within the valid index range of 0 to ColCount-1.

+The return value of the property is the width of this column, measured in pixels.

+The initial width of a newly created column is specified with the DefaultColWidth property. After that the user may redefine this value.

+If the Options property includes the appropriate value, the column width may also be changed by the user at runtime. + - - - + Default value for the width of newly created grid columns. + If new columns of the grid are created by changing the ColCount property, the width of these new columns will be set to the value of the DefaultColWidth property.

+After that the user may redefine this value. If the Options property includes the appropriate value, the column width may also be changed by the user at runtime. + - - - + Default value for the height of newly created grid rows. + If new rows of the grid are created by changing the RowCount property, the height of these new rows will be set to the value of the DefaultRowHeight property.

+After that the user may redefine this value. If the Options property includes the appropriate value, the row height may also be changed by the user at runtime. + @@ -3150,21 +3188,32 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec - - - + Number of the fixed columns of the grid. + Contains the fixed column count of a grid.

+Fixed columns are normally used for headings. + + + + - - - + Number of the fixed rows of the grid. + Contains the fixed row count of a grid.

+Fixed rows are normally used for headings. + + + + - - - + The color for the fixed cells of the grid. + The color used by headings. + + + + @@ -3240,15 +3289,21 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec - - - + Number of rows in the grid + This is the number of rows in the grid, including fixed and normal rows. + + + + + - - - + The row heights for the grid. + The row is specified with the aRow parameter. The aRow parameter must fall within the valid index range of 0 to RowCount-1.

+The return value of the property is the height of this row, measured in pixels.

+The initial height of a newly created row is specified with the DefaultRowHeight property. After that the user may redefine this value. If the Options property includes the appropriate value, the row height may also be changed by the user at runtime. + @@ -3326,9 +3381,10 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec - - - + Is called after a grid cell is highlighted. + The Col and Row parameters contain the column and the row of the highlighted cell. + +Application developers may use the OnSelection and OnBeforeSelection events to react on focus changes. Component developers should use the SelectCell method instead. @@ -3397,7 +3453,7 @@ The purpose of this method in TCustomGrid is to call event handler OnBeforeSelec clear all cells from the grid. Reset Column and Row counts to 0. Grid is completely emptied. -Compatibility: This is a Lazarus grids only property, under Delphi/Kylix a grid can't be completly emptied. +Compatibility: This property applies to Lazarus grids only , under Delphi/Kylix a grid can't be completly emptied.