StyleGrid REALbasic Plugin |

# StyleGrid Control

The StyleGrid REALbasic control allows to display styled spreadsheet data.
StyleGrid uses Einhugur's Floating Engine as data container.
The Floating Engine does not operate like an usual array/matrix class.
When using the Floating Engine you must be aware that things are not always what they seem.
For example, only the cells that have actually been used will exist in memory.
The cells which contain no data, do not exist.
The gap, the cells in-between, will be filled as Default Cell.
This means that when you want to write inside a cell and if you are not sure if that cell exists then you must test that with the WritableCell property, rather than with the Cell property.
Note:
The Grid rendering engine is transaction based, which means you get the best performance and most correct drawing if locking drawing while manipulating data. For example:
StyleGrid1.LockDrawing = true
// Here we will manipulate as much data as we want
StyleGrid1.LockDrawing = false

RectControl
StyleGrid

control StyleGrid

#### Properties

AreaSelection | To enable or disable area selection.
CancelEventAction | To cancel a internal handling of a event then set the CancelEventAction property to true from within a event.
CellEvenColor | To set or get the back color of even numbered cells use the CellEvenColor property.
CellOddColor | To set or get the back color of odd numbered cells use the CellOddColor property.
Cols | To set or get the column count.
CornerBtnEnabled | To determine if the cornerbutton should be enabled or not.
DataPtr | To set or get the data container of the StyleGrid.
DefaultColumnWidth | To set or get the default column width of the StyleGrid.
DefaultRowHeight | To set or get the default row height.
EvenBackColor | Sets or gets the color for even numbered out of bounds cells.
FreezeCols | Sets the number of columns to freeze to the left.
GetFocusOnClick | Set this property to true if the control should get focus when its clicked.
GridLineColor | To set or get the grid line color.
HasBackColor | This property is used to determine if the StyleGrid should use other than its default BackColor.
HasCellGridLineColor | This property is used to determine if the StyleGrid should use other than its default CellGridLineColor.
HasHeader | If the control should have a header then set this property to true.
HasInactiveSelectionColor | This property is used to determine if the StyleGrid should use other than its default InactiveSelectionColor.
HasOutOfBoundsGridLineColor | This property is used to determine if the StyleGrid should use other than its default CellOutOfBoundsGridLineColor.
HasSelectedTextColor | If this property is set to true then the color defined in the SelectedTextColor property is used for text in selected cells, and by doing that overriding the Text color that is defined in the style for the selected cells.
HasSelectionColor | This property is used to determine if the StyleGrid should use other than its default SelectionColor.
HorizontalGrid | To determine if the horizontal grid lines should be visible or not.
HorizontalScrollbar | To determine if an horizontal scrollbar should be visible or not.
HotTrack | Lets rows be hot tracked when mouse hovers over them on Windows systems.
HScrollValue | To set or get the horizontal scrollbar value.
InactiveSelectionColor | To set or get the selection color when the grid is deactivated.
LiveScroll | To enable LiveScroll then check this property in the property browser.
LockDrawing | To set or get LockDrawing value.
OddBackColor | Sets or gets the color for odd numbered out of bounds cells.
OutOfBoundsGridLineColor | To set or get the grid line color for out of bounds non existing cells.
PopupMenuCellFullSensitivity | If set to true then the entire cell for a PopUpMenu cell will trigger a popup, if not then only the popup arrows will trigger a popup.
RenderSortOrder | This property is used to determine if the sort order icon should be rendered in the corner button.
Rows | To set or get the row count.
SelectEntireRow | To set the selection mode to Row or to Single cell.
SelectedTextColor | Sets the color that is used for text in selected cells, and by doing that overriding the Text color that is defined in the style for the selected cells.
SelectionColor | To set or get the selection color.
ShadeSelection | Lets selected row be shaded with platform gradients using Quartz shading on MacOS X Cocoa, GDI plus on Windows and Cairo on Linux systems.
ShowResizeGlyph | To determine if a space should be available for the Grow button or not.
SortedBackwardsFlag | Use this property to set or get the the sort order direction that is drawn. If set to true then the sort indicator is drawn to represent a backward sort.
SortIndicatorColumn | This property is used to set or get the number of the column which should display a sort indicator.
StartupCocoaFont | Use this property to set the initial font name on MacOS Cocoa Target platform for the default Style.
StartupLinuxFont | Use this property to set the initial font name on Linux Target platforms for the default Style.
StartupLinuxFontSize | Use this property to set the initial font size on Linux Target platforms for the default Style.
StartupMacFont | Use this property to set the initial font name on MacOS Target platforms for the default Style.
StartupMacFontSize | Use this property to set the initial font size on MacOS Target platforms for the default Style.
StartupWin32Font | Use this property to set the initial font name on Win32 Target platforms for the default Style.
StartupWin32FontSize | Use this property to set the initial font size on Win32 Target platforms for the default Style.
UseFocusRing | This property is used to determine if the StyleGrid should show a focus ring or not.
VerticalGrid | This property is used to determine if the vertical grid should be visible or not.
VerticalScrollbar | To determine if an vertical scrollbar should be visible or not.
VScrollValue | To set or get the vertical scrollbar value.

#### Methods

AppendRow | Appends a pre created row at the end of the StyleGrid.
AppendRow | Creates a row and appends it at the end of the StyleGrid.
Cell | This setter/getter function is used to access the data of a cell in read mode.
CellBounds | Returns the bounds of a specified cell.
CellFromPoint | Finds a cell from a point inside the StyleGrid control. This variation of the CellFromPoint also gives information if the given point could trigger a cell action.
CellFromPoint | Finds a cell from a point inside the StyleGrid control.
CellText | To set or get the text of a cell.
Column | To get a specific column from the grid use the Column function.
DrawCell | This method is used to redraw one cell only.
EditCell | To manually put a cell in edit mode.
GetDefaultCell | This property is used to access the data from the StyleGrid Default Cell object.
GetDefaultStyle | This function is used to access the default style object that all cells that have no style assigned to them use.
GetHeaderDefaultStyle | This function is used to access the default style object that all headers that have no style assigned to them use.
GetMeasure | Retrieves a measurement from a given measurement constant from the StyleGrid.
InsertCol | To insert a column.
InsertRow | Creates a row and inserts it to a requested location.
InsertRow | Inserts a pre created row to a requested location.
MoveSelectionDown | This method is used to move the selection cursor down.
MoveSelectionLeft | This method is used to move the selection cursor to left.
MoveSelectionRight | This method is used to move the selection cursor to left.
MoveSelectionUp | This method is used to move the selection cursor up.
RemoveCol | To remove a column from the StyleGrid.
RemoveRow | Removes one row from the Grid.
RemoveRow | Removes multiple rows from the Grid.
Row | This property is used to access the data of a row.
RowHeight | To set or get the height, in pixels, of a row.
RowsOnScreen | This function returns the count of rows that are fully visible vertically on the screen.
Selection | Returns a instance of the StyleGridSelection class which represents the state of the selection in the Grid control.
SwapRows | Allows to very quickly exchange two rows by directly accessing the index vector.
WritableCell | This setter/getter function is used to access data of a cell.

#### Events

AfterMouseDown | This event if fired after a MouseDown event. When this event is fired then all internal MouseDown handling has been completed.
CellAction | This event is fired when a action is performed on a special cell.
CellDblClick | The user has double-clicked on a cell.
ColumnHeaderClick | The user has pressed the mouse button in a column header.
ControlCreated | This event is fired when the control has been safely created.
ControlResized | This event is fired when the control is getting Resized.
CornerBtnClick | The user has clicked the Corner button, usually to define the sort order.
EnableMenuItems | Fires when user has clicked in the menu bar or pressed a keyboard shortcut assigned to one of the menu items.
GotFocus | This event is generated when the grid gets the keyboard focus.
KeyDown | This event is fired when a keyboard key is hit when the Grid has the focus.
LostFocus | This event is generated when the grid looses keyboard focus.
MouseDown | The mouse button was pressed inside the StyleGrid at the location passed into x, y.
MouseDrag | The MouseDrag event is fired when a mouse drag event is generated within the control.
MouseExit | This event is fired when the mouse leaves the control.
MouseMove | This event is fired when the mouse is hovering over the control.
MouseUp | The mouse button was released inside the StyleGrid at the location passed into x, y.
MouseWheel | The mouse wheel has been moved.
OnEditCell | This event is fired when a cell is supposed to go in edit mode.
OnHScoll | This event is fired when the value of the Horizontal scrollbar changes.
OnVScoll | This event is fired when the value of the Vertical scrollbar changes.
RenderCornerBtn | This event is posted to give applications chance to custom render the content of the CornerButton.
SelectionChanged | The selection changed. This can be triggered by clicking a cell, removing rows and in many other ways.

#### Supported Platforms:

- MacOS X PPC - (Mach-O)
- MacOS X Universal Binary (Mach-O)
- MacOS X Cocoa Universal Binary (Mach-O)
- Win32 - Windows
- Linux x86

  #### Unsupported Platforms: