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

AreaSelectionTo enable or disable area selection.
CancelEventActionTo cancel a internal handling of a event then set the CancelEventAction property to true from within a event.
CellEvenColorTo set or get the back color of even numbered cells use the CellEvenColor property.
CellOddColorTo set or get the back color of odd numbered cells use the CellOddColor property.
ColsTo set or get the column count.
CornerBtnEnabledTo determine if the cornerbutton should be enabled or not.
DataPtrTo set or get the data container of the StyleGrid.
DefaultColumnWidthTo set or get the default column width of the StyleGrid.
DefaultRowHeightTo set or get the default row height.
EvenBackColorSets or gets the color for even numbered out of bounds cells.
FreezeColsSets the number of columns to freeze to the left.
GetFocusOnClickSet this property to true if the control should get focus when its clicked.
GridLineColorTo set or get the grid line color.
HasBackColorThis property is used to determine if the StyleGrid should use other than its default BackColor.
HasCellGridLineColorThis property is used to determine if the StyleGrid should use other than its default CellGridLineColor.
HasHeaderIf the control should have a header then set this property to true.
HasInactiveSelectionColorThis property is used to determine if the StyleGrid should use other than its default InactiveSelectionColor.
HasOutOfBoundsGridLineColorThis property is used to determine if the StyleGrid should use other than its default CellOutOfBoundsGridLineColor.
HasSelectedTextColorIf 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.
HasSelectionColorThis property is used to determine if the StyleGrid should use other than its default SelectionColor.
HorizontalGridTo determine if the horizontal grid lines should be visible or not.
HorizontalScrollbarTo determine if an horizontal scrollbar should be visible or not.
HotTrackLets rows be hot tracked when mouse hovers over them on Windows systems.
HScrollValueTo set or get the horizontal scrollbar value.
InactiveSelectionColorTo set or get the selection color when the grid is deactivated.
LiveScrollTo enable LiveScroll then check this property in the property browser.
LockDrawingTo set or get LockDrawing value.
OddBackColorSets or gets the color for odd numbered out of bounds cells.
OutOfBoundsGridLineColorTo set or get the grid line color for out of bounds non existing cells.
PopupMenuCellFullSensitivityIf 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.
RenderSortOrderThis property is used to determine if the sort order icon should be rendered in the corner button.
RowsTo set or get the row count.
SelectEntireRowTo set the selection mode to Row or to Single cell.
SelectedTextColorSets 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.
SelectionColorTo set or get the selection color.
ShadeSelectionLets selected row be shaded with platform gradients using Quartz shading on MacOS X Cocoa, GDI plus on Windows and Cairo on Linux systems.
ShowResizeGlyphTo determine if a space should be available for the Grow button or not.
SortedBackwardsFlagUse 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.
SortIndicatorColumnThis property is used to set or get the number of the column which should display a sort indicator.
StartupCocoaFontUse this property to set the initial font name on MacOS Cocoa Target platform for the default Style.
StartupLinuxFontUse this property to set the initial font name on Linux Target platforms for the default Style.
StartupLinuxFontSizeUse this property to set the initial font size on Linux Target platforms for the default Style.
StartupMacFontUse this property to set the initial font name on MacOS Target platforms for the default Style.
StartupMacFontSizeUse this property to set the initial font size on MacOS Target platforms for the default Style.
StartupWin32FontUse this property to set the initial font name on Win32 Target platforms for the default Style.
StartupWin32FontSizeUse this property to set the initial font size on Win32 Target platforms for the default Style.
UseFocusRingThis property is used to determine if the StyleGrid should show a focus ring or not.
VerticalGridThis property is used to determine if the vertical grid should be visible or not.
VerticalScrollbarTo determine if an vertical scrollbar should be visible or not.
VScrollValueTo set or get the vertical scrollbar value.

Methods

AppendRowAppends a pre created row at the end of the StyleGrid.
AppendRowCreates a row and appends it at the end of the StyleGrid.
CellThis setter/getter function is used to access the data of a cell in read mode.
CellBoundsReturns the bounds of a specified cell.
CellFromPointFinds 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.
CellFromPointFinds a cell from a point inside the StyleGrid control.
CellTextTo set or get the text of a cell.
ColumnTo get a specific column from the grid use the Column function.
DrawCellThis method is used to redraw one cell only.
EditCellTo manually put a cell in edit mode.
GetDefaultCellThis property is used to access the data from the StyleGrid Default Cell object.
GetDefaultStyleThis function is used to access the default style object that all cells that have no style assigned to them use.
GetHeaderDefaultStyleThis function is used to access the default style object that all headers that have no style assigned to them use.
GetMeasureRetrieves a measurement from a given measurement constant from the StyleGrid.
InsertColTo insert a column.
InsertRowCreates a row and inserts it to a requested location.
InsertRowInserts a pre created row to a requested location.
MoveSelectionDownThis method is used to move the selection cursor down.
MoveSelectionLeftThis method is used to move the selection cursor to left.
MoveSelectionRightThis method is used to move the selection cursor to left.
MoveSelectionUpThis method is used to move the selection cursor up.
RemoveColTo remove a column from the StyleGrid.
RemoveRowRemoves one row from the Grid.
RemoveRowRemoves multiple rows from the Grid.
RowThis property is used to access the data of a row.
RowHeightTo set or get the height, in pixels, of a row.
RowsOnScreenThis function returns the count of rows that are fully visible vertically on the screen.
SelectionReturns a instance of the StyleGridSelection class which represents the state of the selection in the Grid control.
SwapRowsAllows to very quickly exchange two rows by directly accessing the index vector.
WritableCellThis setter/getter function is used to access data of a cell.

Events

AfterMouseDownThis event if fired after a MouseDown event. When this event is fired then all internal MouseDown handling has been completed.
CellActionThis event is fired when a action is performed on a special cell.
CellDblClickThe user has double-clicked on a cell.
ColumnHeaderClickThe user has pressed the mouse button in a column header.
ControlCreatedThis event is fired when the control has been safely created.
ControlResizedThis event is fired when the control is getting Resized.
CornerBtnClickThe user has clicked the Corner button, usually to define the sort order.
EnableMenuItemsFires when user has clicked in the menu bar or pressed a keyboard shortcut assigned to one of the menu items.
GotFocusThis event is generated when the grid gets the keyboard focus.
KeyDownThis event is fired when a keyboard key is hit when the Grid has the focus.
LostFocusThis event is generated when the grid looses keyboard focus.
MouseDownThe mouse button was pressed inside the StyleGrid at the location passed into x, y.
MouseDragThe MouseDrag event is fired when a mouse drag event is generated within the control.
MouseExitThis event is fired when the mouse leaves the control.
MouseMoveThis event is fired when the mouse is hovering over the control.
MouseUpThe mouse button was released inside the StyleGrid at the location passed into x, y.
MouseWheelThe mouse wheel has been moved.
OnEditCellThis event is fired when a cell is supposed to go in edit mode.
OnHScollThis event is fired when the value of the Horizontal scrollbar changes.
OnVScollThis event is fired when the value of the Vertical scrollbar changes.
RenderCornerBtnThis event is posted to give applications chance to custom render the content of the CornerButton.
SelectionChangedThe 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: