Module dcanvas.widgets.grid

Implementation of grid widgets

GridWidgetBase - abstract grid widget

StringGridWidget - grid of strings

Synopsis

import dcanvas.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();

Interfaces

NameDescription
CellActivatedHandler Callback for handling of cell double click or Enter key press
CellPopupMenuHandler cellPopupMenu signal handler interface
CellSelectedHandler Callback for handling of cell selection
CustomGridCellAdapter Adapter for custom drawing of some cells in grid widgets
GridAdapter Data provider for GridWidget.
GridModelAdapter
HeaderCellClickHandler Callback for handling of grid header cell click
ViewScrolledHandler Callback for handling of view scroll (top left visible cell change)

Classes

NameDescription
GridWidgetBase Abstract grid widget
StringGridAdapter
StringGridWidget Grid view with string data shown. All rows are of the same height
StringGridWidgetBase

Enums

NameDescription
GridActions grid control action codes