Preview #
About #
GraffitiGrid is a fully-custom listbox control complete with custom cell types and events for drawing the most complex list of data you can dream up. Supports embedding controls and containers, custom row and header rendering, frozen columns, and much more.
Enumerations #
Name | Values |
---|---|
CellBorderTypes | None Left Right Both |
RowBorderTypes | None Top Bottom Both |
SelectionTypes | Single Multiple |
Constants #
This object exposes no constants.
Events #
Name | Parameters | Return Type | Description |
---|---|---|---|
CellDrawBackground | g as Graphics column as GraffitiGridColumn row as GraffitiGridRow | Boolean | Raised when the cell background is being drawn. Return True to cancel default drawing. |
CellDrawValue | g as Graphics column as GraffitiGridColumn row as GraffitiGridRow | Boolean | Raised when the cell value is being drawn. Return True to cancel default drawing. |
CellPressed | column as GraffitiGridColumn row as GraffitiGridRow | None | Raised when the user presses a cell. |
CellValueChanged | column as GraffitiGridColumn row as GraffitiGridRow | None | Raised when the user has changed the value of a cell by editing. |
ColumnSorted | column as GraffitiGridColumn | None | Raised after the Grid’s rows have been sorted by pressing a column’s header. |
HeaderCellDrawBackground | g as Graphics column as GraffitiGridColumn | Boolean | Raised when the specified column header is being drawn. Return True to cancel default drawing. |
HeaderCellDrawText | g as Graphics, column as GraffitiGridColumn | Boolean | Raised when the specified column header is being drawn. Return True to cancel default drawing. |
HeaderPressed | column as GraffitiGridColumn | Boolean | Raised when the user presses a column’s header. Return True to cancel sorting if enabled. |
RowDrawBackground | g as graphics row as GraffitiGridRow | Boolean | Raised when the background of a row is being drawn. Return True to cancel default drawing. |
ScrollPositionChanged | None | None | Raised when the user has scrolled the Grid by dragging. |
SelectionChanged | None | None | Raised when the user has changed which row(s) within the Grid are selected. |
Methods #
Name | Parameters | Return Type | Description |
---|---|---|---|
AddColumn | column as GraffitiGridColumn | None | Add the specified column. |
AddColumnAt | index as Integer column as GraffitiGridColumn | None | Add the specified column at the supplied index. |
AddColumns | columns() as GraffitiGridColumn | None | Adds the specified columns. |
AddColumns | ParamArray columns() as GraffitiGridColumn | None | Adds the specified columns. |
AddRow | row as GraffitiGridRow | None | Adds the specified row. |
AddRowAt | index as Integer row as GraffitiGridRow | None | Adds the specified row at the supplied index. |
AddRows | rows() as GraffitiGridRow | None | Adds the specified rows. |
AddRows | ParamArray rows() as GraffitiGridRow | None | Adds the specified rows. |
ColumnAt | index as Integer | GraffitiGridColumn | Returns the column at the specified index. |
DeselectAllRows | None | None | Deselects all rows in the Grid. |
EditBegin | column as GraffitiGridColumn row as GraffitiGridRow | None | Enters edit mode for the specified cell. |
EditCancel | None | None | Cancels the current edit operation, if any. |
EditCommit | None | None | Commits changes on any current edit operation, if any. |
FirstVisibleRowIndex | None | Integer | Returns the index of the first row visible in the Grid’s viewport. |
IndexOfColumn | column as GraffitiGridColumn | Integer | Returns the index of the supplied column. |
IndexOfRow | row as GraffitiGridRow | Integer | Returns the index of the supplied row. |
InvalidateAllRows | None | None | Signals that all rows should be redrawn then refreshes the display. |
InvalidateHeader | None | None | Signals that all columns headers should be redrawn then refreshes the display. |
InvalidateRow | row as GraffitiGridRow | None | Singals that the specified row should be redrawn then refreshes the display. |
LastColumnIndex | None | Integer | Returns the index of the last column within the internal columns array. |
LastRowIndex | None | Integer | Returns the index of the last row within the internal rows array. |
LastVisibleRowIndex | None | Integer | Returns index of the last row visible within the Grid’s viewport. |
RemoveAllColumns | None | None | Removes all columns from the Grid. |
RemoveAllRows | None | None | Removes all rows from the Grid. |
RemoveColumn | column as GraffitiGridColumn | None | Removes the specified column. |
RemoveColumnAt | index as Integer | None | Removes the column at the specified index. |
RemoveRow | row as GraffitiGridRow | None | Removes the specified row. |
RemoveRowAt | index as Integer | None | Removes the row at the specified index. |
RowAt | index as Integer | GraffitiGridRow | Returns the row at the specified index within the internal row array. |
ScrollTo | column as GraffitiGridColumn row as GraffitiGridRow | None | Scrolls to the specified location. Column or Row may be Nil, but not both. |
ScrollTo | position as Xojo.Point | None | Scrolls to the specified (X, Y) position. |
ScrollToBottom | None | None | Scrolls to the maximum Y position. |
ScrollToTop | None | None | Scrolls to the minimum Y position. |
SelectAllRows | None | None | Selects all currently added rows. |
SelectedRows | None | GraffitiGridRow() | Returns all currently selected rows. |
Properties #
Name | Type | Default Value | Description |
---|---|---|---|
AllowDragReorderRows | Boolean | False | Controls whether users may long-press and drag to reorder rows. |
AllowDragReorderColumns | Boolean | False | Controls whether users may long-press and drag to reorder columns. |
BackgroundColor | ColorGroup | Nil | ColorGroup applied to the background of the Grid. |
BorderColor | ColorGroup | Nil | ColorGroup applied to the outside edge of the Grid. |
CellBorderColor | ColorGroup | Nil | ColorGroup applied to cell borders. |
CellBorderType | CellBorderTypes | CellBorderTypes.None | Determines which borders to draw on cells. |
CurrentEditor | GraffitiGridCellEditor | Nil | Instance of the currently active cell editor. Only non-Nil during edit operations. |
DefaultRowHeight | Integer | 24 | Default row height. Overridden by individual GraffitiGridRow.Height properties. |
FrozenBackgroundColor | ColorGroup | Nil | ColorGroup applied to the background of the left panel when there are frozen columns. |
HeaderBackgroundColor | ColorGroup | Nil | ColorGroup applied to the background of the header row. |
HeaderRowHeight | Double | 24 | Height of the header row. |
IsEditable | Boolean | False | Controls whether users may double-press cells to edit them when an appropriate cell editor is available. |
IsHeaderVisible | Boolean | False | Controls whether the column header row is visible. |
LockUpdate | Boolean | False | Controls whether redraw operations should be carried out as a result of changes to data or properties. Typically used to speed up data loading. |
ParentScreen | MobileScreen | Nil | The current parent screen of the Grid. Must be set for editing and control embedding. |
RowBorderColor | ColorGroup | Nil | ColorGroup applied to row borders. |
RowBorderType | RowBorderTypes | RowBorderTypes.None | Determines which borders to draw on rows. |
RowColorEven | ColorGroup | Nil | ColorGroup applied to the background of even-indexed rows. |
RowColorOdd | ColorGroup | Nil | ColorGroup applied to the background odd-indexed rows. |
ScrollMaximum (READ-ONLY) | Xojo.Point | Nil | Maximum X and Y scroll positions. |
ScrollPosition | Xojo.Point | Nil | Current X and Y scroll positions. Replace value to alter rather than altering properties of existing object. |
SelectedRowColor | ColorGroup | Nil | ColorGroup applied to the background of selected rows. |
SelectionType | SelectionTypes | SelectionTypes.Single | Controls how many rows may be selected by the user. When value is Multiple, taps alternate row selection. |
Notes #
ParentScreen Requirement #
In order to enable editing and control/container embedding, the ParentScreen property must be set to the parent MobileScreen of the control. Failure to do so may result in exceptions or missing functionality. Set this property as the first operation in the Opening event handler.