dlangui.widgets.grid

This module contains implementation of grid widgets

More...

Members

Classes

GridWidgetBase
class GridWidgetBase

Abstract grid widget

StringGridAdapter
class StringGridAdapter
StringGridWidget
class StringGridWidget

Grid view with string data shown. All rows are of the same height

StringGridWidgetBase
class StringGridWidgetBase
Undocumented in source.

Enums

GridActions
enum GridActions

grid control action codes

Interfaces

CellActivatedHandler
interface CellActivatedHandler

Callback for handling of cell double click or Enter key press

CellPopupMenuHandler
interface CellPopupMenuHandler

cellPopupMenu signal handler interface

CellSelectedHandler
interface CellSelectedHandler

Callback for handling of cell selection

CustomGridCellAdapter
interface CustomGridCellAdapter

Adapter for custom drawing of some cells in grid widgets

GridAdapter
interface GridAdapter

Data provider for GridWidget.

GridModelAdapter
interface GridModelAdapter
Undocumented in source.
HeaderCellClickHandler
interface HeaderCellClickHandler

Callback for handling of grid header cell click

ViewScrolledHandler
interface ViewScrolledHandler

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

Detailed Description

GridWidgetBase - abstract grid widget

StringGridWidget - grid of strings

Synopsis:

import dlangui.widgets.grid;

StringGridWidget grid = new StringGridWidget("GRID1");
grid.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
grid.showColHeaders = true;
grid.showRowHeaders = true;
grid.resize(30, 50);
grid.fixedCols = 3;
grid.fixedRows = 2;
//grid.rowSelect = true; // testing full row selection
grid.selectCell(4, 6, false);
// create sample grid content
for (int y = 0; y < grid.rows; y++) {
    for (int x = 0; x < grid.cols; x++) {
        grid.setCellText(x, y, "cell("d ~ to!dstring(x + 1) ~ ","d ~ to!dstring(y + 1) ~ ")"d);
    }
    grid.setRowTitle(y, to!dstring(y + 1));
}
for (int x = 0; x < grid.cols; x++) {
    int col = x + 1;
    dstring res;
    int n1 = col / 26;
    int n2 = col % 26;
    if (n1)
        res ~= n1 + 'A';
    res ~= n2 + 'A';
    grid.setColTitle(x, res);
}
grid.autoFit();

Meta

License

Boost License 1.0

Authors

Vadim Lopatin, coolreader.org@gmail.com