SetRowHeight (nRow, height)
-
Sets the height of row nRow.
GetRowHeight (nRow)
-
Gets the height of row nRow.
SetColumnWidth (nCol, width)
-
Sets the width of column nCol.
GetColumnWidth (nCol)
-
Gets the width of column nCol
GetFixedRowsHeight ()
-
Gets the combined height of the fixed rows.
GetFixedColumnsWidth ()
-
Gets the combined width of the fixed columns.
GetVirtualHeight ()
-
Gets the combined height of all the rows.
GetVirtualWidth ()
-
Gets the combined width of all the columns.
GetCellOrigin (row, col)
-
Gets the topleft point for cell (nRow,nCol).
Cell must be visible for success.
Return an [x, y] if successful.
GetCellRect (row, col)
-
Gets the bounding rectangle for the given cell.
Cell must be visible for success.
Return an [left, top, right, bottom] array if successful.
GetTextRect (row, col)
-
Gets the bounding rectangle for the text in the given cell.
Cell must be visible for success.
Return an [left, top, right, bottom] array if successful..
GetTextExtent (nRow, nCol, str)
-
Gets the bounding rectangle for the given text for the given cell.
Return an [width, height] array if successful.
GetCellTextExtent (nRow, nCol)
-
Gets the bounding rectangle for the text in the given cell.
Return an [width, height] array if successful.
GetCellFromPt (x, y)
-
Gets the cell position from the given point.
Return an [row, col] if successful.
SetImageList (imagelist)
-
Sets the current image list for the grid.
The control only takes a copy of the pointer to the image list, not a copy of the list itself.
GetImageList ()
-
Gets the current image list for the grid.
SetGridLines ([nWhichLines = GVL_BOTH])
-
Sets which (if any) gridlines are displayed.
Possible values.
GVL_NONE = No grid lines
GVL_HORZ = Horizontal lines only
GVL_VERT = Vertical lines only
GVL_BOTH = Both vertical and horizontal lines
GetGridLines ()
-
Gets which (if any) gridlines are displayed.
Possible values.
GVL_NONE = No grid lines
GVL_HORZ = Horizontal lines only
GVL_VERT = Vertical lines only
GVL_BOTH = Both vertical and horizontal lines
SetEditable ([bEditable = TRUE])
-
Sets if the grid is editable.
IsEditable ()
-
Gets whether or not the grid is editable.
SetListMode ([bEnableListMode = TRUE])
-
Sets the grid into (or out of) List mode.
When the grid is in list mode, full row selection is enabled and clicking on the column header will sort the grid by rows.
GetListMode ()
-
Get whether or not the grid is in list mode.
SetSingleRowSelection ([bSingle = TRUE])
-
Sets the grid into (or out of) Single row selection mode.
This mode is only effective when in ListMode. When in this mode, only a single row at a time can be selected, so the grid behaves somewhat like a multicolumn listbox.
GetSingleRowSelection ()
-
Get whether or not the grid is in single row selection mode.
SetSingleColSelection ([bSing = TRUE])
-
Sets the grid into (or out of) Single column selection mode.
When in this mode, only a single column at a time can be selected.
GetSingleColSelection ()
-
Get whether or not the grid is in single column selection mode.
EnableSelection ([bEnable = TRUE])
-
Sets whether or not the grid cells can be selected.
IsSelectable ()
-
Get whether or not grid cells are selectable.
SetFixedRowSelection ([bSelect = TRUE])
-
Set whether or not clicking on a fixed row selects the cells next to it.
GetFixedRowSelection ()
-
Get whether or not clicking on a fixed row selects the cells next to it.
SetFixedColumnSelection ([bSelect = TRUE])
-
Set whether or not clicking on a fixed column selects the cells underneath.
GetFixedColumnSelection ()
-
Get whether or not clicking on a fixed column selects the cells underneath.
EnableDragAndDrop ([bAllow = TRUE]);
-
Sets whether drag and drop is enabled.
GetDragAndDrop ()
-
Get whether drag and drop is allowed.
SetRowResize ([bResize = TRUE])
-
Sets whether or not rows can be resized.
GetRowResize ()
-
Gets whether or not rows can be resized.
SetColumnResize ([bResize = TRUE])
-
Sets whether or not columns can be resized.
GetColumnResize ()
-
Gets whether or not columns can be resized.
SetHandleTabKey ([bHandleTab = TRUE])
-
Sets whether or not the TAB key is used to move the cell selection.
GetHandleTabKey ()
-
Gets whether or not the TAB key is used to move the cell selection.
SetDoubleBuffering ([bBuffer = TRUE])
-
Sets whether or not double buffering is used when painting (avoids flicker).
GetDoubleBuffering ()
-
Gets whether or not double buffering is used when painting.
EnableTitleTips ([bEnable = TRUE])
-
Sets whether or not titletips are used.
GetTitleTips ()
-
Gets whether or not titletips are used.
SetTrackFocusCell ([bTrack = TRUE])
-
Sets whether or not the fixed cells on the same row/column as the current focus cell are highlighted with a sunken border.
GetTrackFocusCell ()
-
Gets whether or not the fixed cells on the same row/column as the current focus cell are highlighted with a sunken border.
SetFrameFocusCell ([bFrame = TRUE])
-
Sets whether or not the cell with the focus is highlighted with a framed border.
GetFrameFocusCell ()
-
Gets whether or not the focus cell is highlighted with a framed border.
SetAutoSizeStyle ([nStyle = GVS_BOTH])
-
Sets how the auto-sizing should be performed.
Possible values.
GVS_BOTH = use fixed and non fixed cells;
GVS_HEADER = use only the fixed cells;
GVS_DATA = use only non-fixed cells.
GetAutoSizeStyle ()
-
Gets how the auto-sizing should be performed
EnableHiddenColUnhide ([bEnable = TRUE])
-
Sets whether or not hidden (0-width) columns can be unhidden by the user resizing the column.
GetHiddenColUnhide ()
-
Gets whether or not hidden (0-width) columns can be unhidden by the user resizing the column.
void EnableHiddenRowUnhide ([bEnable = TRUE])
-
Sets whether or not hidden (0-height) rows can be unhidden by the user resizing the row.
GetHiddenRowUnhide ()
-
Gets whether or not hidden (0-height) rows can be unhidden by the user resizing the row.
EnableColumnHide ([bEnable = TRUE])
-
Sets whether or columns can be contracted to 0 width via mouse.
GetColumnHide ()
-
Gets whether or not columns can be contracted to 0 width via mouse.
void EnableRowHide ([bEnable = TRUE])
-
Sets whether or not rows can be contracted to 0 height via mouse.
GetRowHide ()
-
Sets whether or not rows can be contracted to 0 height via mouse.
SetModified ([bModified = TRUE], [nRow = -1], [nCol = -1])
-
Sets the modified flag for a cell.
If no row or columns is specified, then change affects the entire grid.
GetModified ([nRow = -1], [nCol = -1])
-
Gets the modified flag for a cell, or if no cell, it returns the status for the entire grid.
SetCellText (nRow, nCol, str)
-
Sets the text for the given cell. Returns TRUE on success
GetCellText (nRow, nCol)
-
Gets the text for the given cell.
SetCellData (nRow, nCol, lParam)
-
Sets the lParam (user-defined data) field for the given cell. Returns TRUE on success.
GetCellData (nRow, nCol)
-
Gets the lParam (user-defined data) field for the given cell.
SetCellImage (nRow, nCol, iImage)
-
Sets the image index for the given cell. Returns TRUE on success.
GetCellImage (nRow, nCol)
-
Gets the image index for the given cell.
SetCellState (nRow, nCol, state)
-
Sets the state of the given cell. Returns TRUE on success.
GetCellState (nRow, nCol)
-
Gets the state of the given cell.
SetCellFormat (nRow, nCol, nFormat)
-
Sets the format of the given cell.
Returns TRUE on success.
Default implementation of cell drawing uses CDC::DrawText, so any of the DT_* formats are available.
DT_TOP
DT_LEFT
DT_CENTER
DT_RIGHT
DT_VCENTER
DT_BOTTOM
DT_WORDBREAK
DT_SINGLELINE
DT_EXPANDTABS
DT_TABSTOP
DT_NOCLIP
DT_EXTERNALLEADING
DT_CALCRECT
DT_NOPREFIX
DT_INTERNAL
DT_EDITCONTROL
DT_PATH_ELLIPSIS
DT_END_ELLIPSIS
DT_MODIFYSTRING
DT_RTLREADING
DT_WORD_ELLIPSIS
GetCellFormat (nRow, nCol)
-
Gets the format of the given cell (default returns a CDC::DrawText DT_* format).
SetCellBkColor (nRow, nCol, [color = CLR_DEFAULT])
-
Sets the background colour of the given cell. Returns TRUE on success
GetCellBkColor (nRow, nCol)
-
Gets the background colour of the given cell.
SetCellColor (nRow, nCol, [color = CLR_DEFAULT])
-
Sets the foreground colour of the given cell. Returns TRUE on success.
GetCellColor (nRow, nCol)
-
Gets the foreground colour of the given cell.
SetCellFont (nRow, nCol, ...)
-
Sets the font of the given cell. Returns TRUE on success.
GetCellFont (nRow, nCol)
-
Gets the font of the given cell.
EnsureCellVisible (nRow, nCol)
-
Ensures that the specified cell is visible.
IsCellVisible (nRow, nCol)
-
Returns TRUE if the cell is visible.
IsCellSelected (nRow, nCol)
-
Returns TRUE if the cell is selected
SetCellEditable (nRow, nCol, [bEditable = TRUE])
-
Sets the edtitable state of the given cell.
IsCellEditable (nRow, nCol)
-
Returns TRUE if the cell is editable.
IsCellEditing (nRow, nCol)
-
Returns TRUE if the cell is currently being edited.
IsCellFixed (nRow, nCol)
-
Returns TRUE if the cell is a fixed cell.
GetSelectedCount ()
-
Gets the number of selected cells.
SetFocusCell (nRow, nCol)
-
Sets the cell with the focus
GetFocusCell ()
-
Gets the cell with the focus.
InsertColumn (strHeading, [nFormat = DT_CENTER|DT_VCENTER|DT_SINGLELINE], [nColumn = -1])
-
Inserts a column at the position given by nCol, or at the end of all columns if nCol is < 0.
strHeading is the column heading and nFormat the format.
Returns the position of the inserted column.
InsertRow (strHeading, [nRow = -1])
-
Inserts a row at the position given by nRow, or at the end of all rows if nRow is < 0.
strHeading is the row heading.
The format of each cell in the row will be that of the cell in the first row of the same column.
Returns the position of the inserted row.
DeleteColumn (nColumn)
-
Deletes column "nColumn", return TRUE on success.
DeleteRow (nRow)
-
Deletes row "nRow", return TRUE on success.
DeleteAllCells ()
-
Deletes all rows and contents in the grid.
DeleteNonFixedRows ()
-
Deletes all non-fixed rows in the grid.
AutoSizeRow (nRow, [bResetScroll = TRUE])
-
Auto sizes the row to the size of the largest item.
If bResetScroll is TRUE then the scroll bars will be reset.
AutoSizeColumn (nCol, [nAutoSizeStyle = GVS_DEFAULT], [bResetScroll = TRUE])
-
Auto sizes the column to the size of the largest item.
nAutoSizeStyle sets the way the autosize will occur.
If bResetScroll is TRUE then the scroll bars will be reset.
AutoSizing options :
GVS_DEFAULT = default
GVS_HEADER = Size using column fixed cells data only
GVS_DATA = Size using column non-fixed cells data only
GVS_BOTH = Size using column fixed and non-fixed
AutoSizeRows ()
-
Auto sizes all rows.
AutoSizeColumns ([nAutoSizeStyle = GVS_DEFAULT])
-
Auto sizes all columns.
nAutoSizeStyle sets the way the autosize will occur.
AutoSizing options :
GVS_DEFAULT = default
GVS_HEADER = Size using column fixed cells data only
GVS_DATA = Size using column non-fixed cells data only
GVS_BOTH = Size using column fixed and non-fixed
AutoSize ([nAutoSizeStyle = GVS_DEFAULT])
-
Auto sizes all rows and columns.
nAutoSizeStyle sets the way the autosize will occur.
AutoSizing options :
GVS_DEFAULT = default
GVS_HEADER = Size using column fixed cells data only
GVS_DATA = Size using column non-fixed cells data only
GVS_BOTH = Size using column fixed and non-fixed
ExpandColumnsToFit ([bExpandFixed = TRUE])
-
Expands the column widths to fit the grid area.
If bExpandFixed is TRUE then fixed columns will be modified, otherwise they will not be affected.
ExpandLastColumn ()
-
Expands the last column width to fill any remaining grid area.
ExpandRowsToFit ([bExpandFixed = TRUE])
-
Expands the row heights to fit the grid area.
If bExpandFixed is TRUE then fixed rows will be modified, otherwise they will not be affected.
ExpandToFit ([bExpandFixed = TRUE])
-
Expands the rows and columns to fit the grid area.
If bExpandFixed is TRUE then fixed cells will be modified, otherwise they will not be affected.
SetRedraw (bAllowDraw, [bResetScrollBars = FALSE])
-
Stops/starts redraws on things like changing the number of rows and columns and autosizing, but not for user-intervention such as resizes.
RedrawCell (nRow, nCol, [hDC=0])
-
Redraws the given cell. Drawing will be via the hDC if one is supplied.
RedrawRow (row)
-
Redraws the given row.
RedrawColumn (col);
-
Redraws the given column.
Refresh ()
-
Redraws the entire grid.
GetCellRange ()
-
Gets the range of cells for the entire grid.
Return an [nMinRow, nMinCol, nMaxRow, nMaxCol] array.
SetSelectedCellRange (nMinRow, nMinCol, nMaxRow, nMaxCol, [bForceRepaint = FALSE], [bSelectCells = TRUE])
-
Sets the range of selected cells.
GetSelectedCellRange ()
-
Gets the range of selected cells.
Return an [nMinRow, nMinCol, nMaxRow, nMaxCol] array.
IsValid (nRow, nCol)
-
Returns TRUE if the given row and column is valid.
GetNextCell (nRow, nCol, nFlags)
-
Searches for a cell that has the specified properties and that bears the specified relationship to a given item.
Cell Searching options :
GVNI_FOCUSED = Search for focus cell
GVNI_SELECTED = Search for selected cells
GVNI_DROPHILITED = Search for drop highlighted cells
GVNI_READONLY = Search for read-only cells
GVNI_FIXED = Search for fixed cells
GVNI_MODIFIED = Search for modified cells
GVNI_ABOVE = Search above initial cell
GVNI_BELOW = Search below initial cell
GVNI_TOLEFT = Search to the left of the initial cell
GVNI_TORIGHT = Search to the right of the initial cell
GVNI_ALL = Search all cells in the grid starting from the given cell
GVNI_AREA = Search all cells below and to the right of the given cell
ClearCells (nMinRow, nMinCol, nMaxRow, nMaxCol)
-
Clear cell in range.
AutoFill ()
-
Auto fill witk blank cell.
SetHeaderSort ([bSortOnClick = TRUE])
-
Sets whether or not rows are sorted on column header clicks in ListMode.
GetHeaderSort ()
-
Gets whether or not rows are sorted on column header clicks in ListMode.
SetSortColumn (nCol)
-
Sets the index of the currently sorted column.
GetSortColumn ()
-
Gets the index of the currently sorted column.
SetSortAscending ([bAscending = TRUE])
-
Sets whether the current sort column is sorted ascending.
GetSortAscending ()
-
Gets whether the current sort column is sorted ascending.
SortTextCells (nCol, bAscending)
-
Sorts the grid on the given column based on cell text. Returns TRUE on success
SortNumericCells (nCol, bAscending)
-
Sorts the grid on the given column based on cell numeric text. Returns TRUE on success
SortCells (nCol, bAscending, [pfun = NULL])
-
Sort given method and given sort order.
Optional a custom sort fonction.
Sort Function samples :
sub { my ($e1, $e2) = @_; return (int($e1) - int ($e2)); }
SetSortFunction ([pFun = NULL], [nCol = -1])
-
Set or Remove Perl sort function.
If nCol is -1, Set or remove a default sort method.
If nCol is a valid column , Set or remove a sort method for this column only.
Sort Function samples :
sub { my ($e1, $e2) = @_; return (int($e1) - int ($e2)); }