GridWidgetBase

Abstract grid widget

class GridWidgetBase : ScrollWidgetBase , GridModelAdapter , MenuItemActionHandler {}

Constructors

this
this(string ID, ScrollBarMode hscrollbarMode, ScrollBarMode vscrollbarMode)
Undocumented in source.

Members

Functions

activateCell
bool activateCell(int col, int row)

Select cell and call onCellActivated handler

autoFit
void autoFit()
Undocumented in source. Be warned that the author may not have intended to support it.
autoFitColumnWidth
void autoFitColumnWidth(int i)
Undocumented in source. Be warned that the author may not have intended to support it.
autoFitColumnWidths
void autoFitColumnWidths()
Undocumented in source. Be warned that the author may not have intended to support it.
autoFitRowHeight
void autoFitRowHeight(int i)
Undocumented in source. Be warned that the author may not have intended to support it.
autoFitRowHeights
void autoFitRowHeights()
Undocumented in source. Be warned that the author may not have intended to support it.
calcScrollableAreaPos
void calcScrollableAreaPos()

calculate scrollable area info

canShowPopupMenu
bool canShowPopupMenu(int x, int y)

returns true if widget can show popup menu (e.g. by mouse right click at point x,y)

cellRect
Rect cellRect(int x, int y)

returns cell rectangle relative to client area; row 0 is col headers row; col 0 is row headers column

cellRectNoScroll
Rect cellRectNoScroll(int x, int y)

get cell rectangle (relative to client area) not counting scroll position

cellRectScroll
Rect cellRectScroll(int x, int y)

get cell rectangle moved by scroll pixels (may overlap non-scroll cols!)

colByAbsoluteX
int colByAbsoluteX(int x)

column by X, ignoring scroll position

colVisible
bool colVisible(int x)

returns true if column is inside client area and not overlapped outside scroll area

colWidth
int colWidth(int col)

get column width, 0 is header column

correctScrollPos
void correctScrollPos()
Undocumented in source. Be warned that the author may not have intended to support it.
drawCell
void drawCell(DrawBuf buf, Rect rc, int col, int row)

draw data cell content

drawCellBackground
void drawCellBackground(DrawBuf buf, Rect rc, int col, int row)

draw data cell background

drawClient
void drawClient(DrawBuf buf)
Undocumented in source. Be warned that the author may not have intended to support it.
drawHeaderCell
void drawHeaderCell(DrawBuf buf, Rect rc, int col, int row)

draw header cell content

drawHeaderCellBackground
void drawHeaderCellBackground(DrawBuf buf, Rect rc, int col, int row)

draw header cell background

endColResize
void endColResize()
Undocumented in source. Be warned that the author may not have intended to support it.
fillColumnWidth
void fillColumnWidth(int colIndex)

extend specified column width to fit client area if grid width

fullContentSize
Point fullContentSize()

calculate full content size in pixels

getCellPopupMenu
MenuItem getCellPopupMenu(int col, int row)
Undocumented in source. Be warned that the author may not have intended to support it.
getCursorType
uint getCursorType(int x, int y)

returns mouse cursor type for widget

handleAction
bool handleAction(Action a)
Undocumented in source. Be warned that the author may not have intended to support it.
handleClientRectLayout
void handleClientRectLayout(Rect rc)

override to support modification of client rect after change, e.g. apply offset

isColumnResizingPoint
int isColumnResizingPoint(int x, int y)

return column index to resize if point is in column resize area in header row, -1 if outside resize area

lastScrollCol
int lastScrollCol()

returns last fully visible column in scroll area

lastScrollRow
int lastScrollRow()

returns last fully visible row in scroll area

makeCellVisible
void makeCellVisible(int col, int row)

ensure that cell is visible (scroll if necessary)

measureCell
Point measureCell(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
measureColWidth
int measureColWidth(int x)
Undocumented in source. Be warned that the author may not have intended to support it.
measureRowHeight
int measureRowHeight(int y)
Undocumented in source. Be warned that the author may not have intended to support it.
minimumVisibleContentSize
Point minimumVisibleContentSize()

calculate minimum size of widget

multiSelectCell
bool multiSelectCell(int col, int row, bool expandExisting)
Undocumented in source. Be warned that the author may not have intended to support it.
onHScroll
bool onHScroll(ScrollEvent event)

process horizontal scrollbar event

onMenuItemAction
bool onMenuItemAction(Action action)

handle popup menu action

onMouseEvent
bool onMouseEvent(MouseEvent event)

handle mouse wheel events

onVScroll
bool onVScroll(ScrollEvent event)

process vertical scrollbar event

pointToCell
bool pointToCell(int x, int y, int col, int row, Rect cellRect)

converts client rect relative coordinates to cell coordinates

processColResize
void processColResize(int x)
Undocumented in source. Be warned that the author may not have intended to support it.
resize
void resize(int c, int r)

set new size

rowByAbsoluteY
int rowByAbsoluteY(int y)

row by Y, ignoring scroll position

rowHeight
int rowHeight(int row)

get row height, 0 is header row

rowVisible
bool rowVisible(int y)

returns true if row is inside client area and not overlapped outside scroll area

scrollBy
bool scrollBy(int dx, int dy)

move scroll position horizontally by dx, and vertically by dy; returns true if scrolled

scrollCol
int scrollCol()

returns first fully visible column in scroll area

scrollRow
int scrollRow()

returns first fully visible row in scroll area

scrollTo
bool scrollTo(int x, int y, GridWidgetBase source, bool doNotify)

set scroll position to show specified cell as top left in scrollable area; col or row -1 value means no change

selectCell
bool selectCell(int col, int row, bool makeVisible, GridWidgetBase source, bool needNotification)

move selection to specified cell

setColWidth
void setColWidth(int x, int w)
Undocumented in source. Be warned that the author may not have intended to support it.
setRowHeight
void setRowHeight(int y, int w)
Undocumented in source. Be warned that the author may not have intended to support it.
showPopupMenu
void showPopupMenu(int xx, int yy)

shows popup menu at (x,y)

startColResize
void startColResize(int col, int x)
Undocumented in source. Be warned that the author may not have intended to support it.
updateCumulativeSizes
void updateCumulativeSizes()

recalculate colCumulativeWidths, rowCumulativeHeights after resizes

updateScrollBars
void updateScrollBars()

update scrollbar positions

Properties

allowColResizing
bool allowColResizing [@property getter]

get col resizing flag; when true, allow resizing of column with mouse

allowColResizing
bool allowColResizing [@property setter]

set col resizing flag; when true, allow resizing of column with mouse

col
int col [@property getter]

selected column

cols
int cols [@property setter]

set column count

cols
int cols [@property getter]

column count

customCellAdapter
CustomGridCellAdapter customCellAdapter [@property setter]

Set adapter to override drawing of some particular cells

customCellAdapter
CustomGridCellAdapter customCellAdapter [@property getter]

Get adapter to override drawing of some particular cells

defColumnWidth
int defColumnWidth [@property getter]

default column width - for newly added columns

defColumnWidth
int defColumnWidth [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
defRowHeight
int defRowHeight [@property getter]

default row height - for newly added rows

defRowHeight
int defRowHeight [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
fixedCols
int fixedCols [@property getter]

fixed (non-scrollable) data column count

fixedCols
int fixedCols [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
fixedRows
int fixedRows [@property getter]

fixed (non-scrollable) data row count

fixedRows
int fixedRows [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
fullAreaPixels
Point fullAreaPixels [@property getter]

return all (fixed + scrollable) cells size in pixels

fullColumnOnLeft
bool fullColumnOnLeft [@property getter]

Extends scroll area to show full column at left when scrolled to rightmost column

fullColumnOnLeft
bool fullColumnOnLeft [@property setter]

Extends scroll area to show full column at left when scrolled to rightmost column

fullRowOnTop
bool fullRowOnTop [@property getter]

Extends scroll area to show full row at top when scrolled to end row

fullRowOnTop
bool fullRowOnTop [@property setter]

Extends scroll area to show full row at top when scrolled to end row

gridModelAdapter
GridModelAdapter gridModelAdapter [@property setter]

Set adapter to hold grid model data

gridModelAdapter
GridModelAdapter gridModelAdapter [@property getter]

Get adapter to hold grid model data

headerCols
int headerCols [@property getter]

row header column count

headerCols
int headerCols [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
headerRows
int headerRows [@property getter]

col header row count

headerRows
int headerRows [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
minVisibleCols
int minVisibleCols [@property getter]

returns number of columns from 0 that are taken to measure minimum visible width

minVisibleCols
int minVisibleCols [@property setter]

sets number of columns from 0 that are taken to measure minimum visible width

minVisibleRows
int minVisibleRows [@property getter]

returns number of rows from 0 that are taken to measure minimum visible height

minVisibleRows
int minVisibleRows [@property setter]

sets number of rows from 0 that are taken to measure minimum visible height, if there are too little rows last row height is multiplied

multiSelect
bool multiSelect [@property getter]

when true, allows multi cell selection

multiSelect
bool multiSelect [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
nonScrollAreaPixels
Point nonScrollAreaPixels [@property getter]

non-scrollable area size in pixels

nonScrollCols
int nonScrollCols [@property getter]

count of non-scrollable columns (header + fixed)

nonScrollRows
int nonScrollRows [@property getter]

count of non-scrollable rows (header + fixed)

row
int row [@property getter]

selected row

rowSelect
bool rowSelect [@property getter]

when true, allows only select the whole row

rowSelect
bool rowSelect [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
rows
int rows [@property setter]

set row count

rows
int rows [@property getter]

row count

scrollAreaPixels
Point scrollAreaPixels [@property getter]

scrollable area size in pixels

selection
RedBlackTree!Point selection [@property getter]

selected cells when multiselect is enabled

showColHeaders
bool showColHeaders [@property getter]

flag to enable column headers

showColHeaders
bool showColHeaders [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
showRowHeaders
bool showRowHeaders [@property getter]

flag to enable row headers

showRowHeaders
bool showRowHeaders [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
smoothHScroll
bool smoothHScroll [@property setter]

Get smooth horizontal scroll flag - when true - scrolling by pixels, when false - by cells

smoothHScroll
bool smoothHScroll [@property getter]

Get smooth horizontal scroll flag - when true - scrolling by pixels, when false - by cells

smoothVScroll
bool smoothVScroll [@property setter]

Get smooth vertical scroll flag - when true - scrolling by pixels, when false - by cells

smoothVScroll
bool smoothVScroll [@property getter]

Get smooth vertical scroll flag - when true - scrolling by pixels, when false - by cells

Static functions

findPosIndex
int findPosIndex(int[] cumulativeSizes, int pos)

search for index of position inside cumulative sizes array

Variables

_allowColResizing
bool _allowColResizing;
Undocumented in source.
_cellBorderColor
uint _cellBorderColor;
Undocumented in source.
_cellHeaderBackgroundColor
uint _cellHeaderBackgroundColor;
Undocumented in source.
_cellHeaderBackgroundDrawable
DrawableRef _cellHeaderBackgroundDrawable;
Undocumented in source.
_cellHeaderBorderColor
uint _cellHeaderBorderColor;
Undocumented in source.
_cellHeaderSelectedBackgroundColor
uint _cellHeaderSelectedBackgroundColor;
Undocumented in source.
_cellHeaderSelectedBackgroundDrawable
DrawableRef _cellHeaderSelectedBackgroundDrawable;
Undocumented in source.
_cellRowHeaderBackgroundDrawable
DrawableRef _cellRowHeaderBackgroundDrawable;
Undocumented in source.
_cellRowHeaderSelectedBackgroundDrawable
DrawableRef _cellRowHeaderSelectedBackgroundDrawable;
Undocumented in source.
_changedSize
bool _changedSize;
Undocumented in source.
_col
int _col;

selected cell column

_colCumulativeWidths
int[] _colCumulativeWidths;

total width from first column to right of this

_colResizingIndex
int _colResizingIndex;
Undocumented in source.
_colResizingStartWidth
int _colResizingStartWidth;
Undocumented in source.
_colResizingStartX
int _colResizingStartX;
Undocumented in source.
_colWidths
int[] _colWidths;

column widths

_cols
int _cols;

column count (including header columns and fixed columns)

_customCellAdapter
CustomGridCellAdapter _customCellAdapter;
Undocumented in source.
_defColumnWidth
int _defColumnWidth;

default column width - for newly added columns

_defRowHeight
int _defRowHeight;

default row height - for newly added rows

_fixedCellBackgroundColor
uint _fixedCellBackgroundColor;
Undocumented in source.
_fixedCellBorderColor
uint _fixedCellBorderColor;
Undocumented in source.
_fixedCols
int _fixedCols;

number of fixed (non-scrollable) columns

_fixedRows
int _fixedRows;

number of fixed (non-scrollable) rows

_fullColumnOnLeft
bool _fullColumnOnLeft;
Undocumented in source.
_fullRowOnTop
bool _fullRowOnTop;
Undocumented in source.
_gridModelAdapter
GridModelAdapter _gridModelAdapter;
Undocumented in source.
_headerCols
int _headerCols;

number of header columns (e.g. like row number in excel; 0 for no header column)

_headerRows
int _headerRows;

number of header rows (e.g. like col name A, B, C... in excel; 0 for no header row)

_maxScrollCol
int _maxScrollCol;
Undocumented in source.
_maxScrollRow
int _maxScrollRow;
Undocumented in source.
_minVisibleCols
int _minVisibleCols;
Undocumented in source.
_minVisibleRows
int _minVisibleRows;
Undocumented in source.
_multiSelect
bool _multiSelect;

when true, allows multi cell selection

_row
int _row;

selected cell row

_rowCumulativeHeights
int[] _rowCumulativeHeights;

total height from first row to bottom of this

_rowHeights
int[] _rowHeights;

row heights

_rowSelect
bool _rowSelect;

when true, allows to select only whole row

_rows
int _rows;

row count (including header rows and fixed rows)

_scrollX
int _scrollX;

scroll X offset in pixels

_scrollY
int _scrollY;

scroll Y offset in pixels

_selection
RedBlackTree!Point _selection;

selected cells when multiselect is enabled

_selectionColor
uint _selectionColor;
Undocumented in source.
_selectionColorRowSelect
uint _selectionColorRowSelect;
Undocumented in source.
_showColHeaders
bool _showColHeaders;

when true, shows col headers row

_showRowHeaders
bool _showRowHeaders;

when true, shows row headers column

_smoothHScroll
bool _smoothHScroll;
Undocumented in source.
_smoothVScroll
bool _smoothVScroll;
Undocumented in source.
cellActivated
Listener!CellActivatedHandler cellActivated;

Callback to handle cell double click

cellPopupMenu
Signal!CellPopupMenuHandler cellPopupMenu;

cell popup menu

cellSelected
Listener!CellSelectedHandler cellSelected;

Callback to handle selection change

headerCellClicked
Listener!HeaderCellClickHandler headerCellClicked;

Callback for handling header cell click

menuItemAction
Signal!MenuItemActionHandler menuItemAction;

popup menu item action

viewScrolled
Listener!ViewScrolledHandler viewScrolled;

Callback for handling of view scroll (top left visible cell change)

Inherited Members

From ScrollWidgetBase

_vscrollbarMode
ScrollBarMode _vscrollbarMode;
Undocumented in source.
_hscrollbarMode
ScrollBarMode _hscrollbarMode;
Undocumented in source.
_vscrollbar
ScrollBar _vscrollbar;

vertical scrollbar control

_hscrollbar
ScrollBar _hscrollbar;

horizontal scrollbar control

_clientRect
Rect _clientRect;

inner area, excluding additional controls like scrollbars

_fullScrollableArea
Rect _fullScrollableArea;
Undocumented in source.
_visibleScrollableArea
Rect _visibleScrollableArea;
Undocumented in source.
vscrollbarMode
ScrollBarMode vscrollbarMode [@property getter]

vertical scrollbar mode

vscrollbarMode
ScrollBarMode vscrollbarMode [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
hscrollbarMode
ScrollBarMode hscrollbarMode [@property getter]

horizontal scrollbar mode

hscrollbarMode
ScrollBarMode hscrollbarMode [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
clientRect
Rect clientRect [@property getter]

returns client area rectangle

onHScroll
bool onHScroll(ScrollEvent event)

process horizontal scrollbar event

onVScroll
bool onVScroll(ScrollEvent event)

process vertical scrollbar event

onMouseEvent
bool onMouseEvent(MouseEvent event)

process mouse event; return true if event is processed by widget.

onScrollEvent
bool onScrollEvent(AbstractSlider source, ScrollEvent event)

handle scroll event

_insideChangeScrollbarVisibility
bool _insideChangeScrollbarVisibility;
Undocumented in source.
checkIfNeededToChangeScrollbarVisibility
void checkIfNeededToChangeScrollbarVisibility()
Undocumented in source. Be warned that the author may not have intended to support it.
updateScrollBars
void updateScrollBars()

update scrollbar positions

hscrollbar
ScrollBar hscrollbar [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
vscrollbar
ScrollBar vscrollbar [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
hscrollbar
ScrollBar hscrollbar [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
vscrollbar
ScrollBar vscrollbar [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
updateHScrollBar
void updateHScrollBar()

update horizontal scrollbar widget position

updateVScrollBar
void updateVScrollBar()

update verticat scrollbar widget position

drawClient
void drawClient(DrawBuf buf)
Undocumented in source. Be warned that the author may not have intended to support it.
drawExtendedArea
void drawExtendedArea(DrawBuf buf)
Undocumented in source. Be warned that the author may not have intended to support it.
onDraw
void onDraw(DrawBuf buf)

Draw widget at its position to buffer

fullContentSize
Point fullContentSize()

calculate full content size in pixels

fullContentSizeWithBorders
Point fullContentSizeWithBorders()

calculate full content size in pixels including widget borders / margins

minimumVisibleContentSize
Point minimumVisibleContentSize()
Undocumented in source. Be warned that the author may not have intended to support it.
measure
void measure(int parentWidth, int parentHeight)

Measure widget according to desired width and height constraints. (Step 1 of two phase layout).

handleClientRectLayout
void handleClientRectLayout(Rect rc)

override to support modification of client rect after change, e.g. apply offset

checkIfScrollbarsNeeded
void checkIfScrollbarsNeeded(bool needHScroll, bool needVScroll)

override to determine if scrollbars are needed or not

layout
void layout(Rect rc)

Set widget rectangle to specified value and layout widget contents. (Step 2 of two phase layout).

makeRectVisible
void makeRectVisible(Rect rc, bool alignHorizontally, bool alignVertically)
Undocumented in source. Be warned that the author may not have intended to support it.

From GridModelAdapter

fixedCols
int fixedCols [@property getter]
Undocumented in source.
fixedRows
int fixedRows [@property getter]
Undocumented in source.
fixedCols
int fixedCols [@property setter]
Undocumented in source.
fixedRows
int fixedRows [@property setter]
Undocumented in source.

From MenuItemActionHandler

onMenuItemAction
bool onMenuItemAction(Action action)
Undocumented in source.

Meta