static status appendTable(Table tab, TableCell cell, Int x, Int y) { int cspan = valInt(cell->col_span); int rspan = valInt(cell->row_span); int dy; if ( isDefault(x) ) x = tab->current->x; if ( isDefault(y) ) y = tab->current->y; if ( notNil(tab->device) && notNil(cell->image) ) send(tab->device, NAME_display, cell->image, EAV); assign(cell, layout_manager, tab); assign(cell, column, x); assign(cell, row, y); for(dy=0; dy<rspan; dy++) { Int cy = toInt(valInt(y)+dy); TableRow row = getRowTable(tab, cy, ON); int dx; for(dx=0; dx<cspan; dx++) { Int cx = toInt(valInt(x)+dx); cellTableRow(row, cx, cell); } } advance_table(tab); requestComputeLayoutManager((LayoutManager)tab, DEFAULT); return changedTable(tab); }
static status rowSpanTableCell(TableCell cell, Int span) { if ( cell->row_span != span ) { Table tab = table_of_cell(cell); if ( tab ) { int x,y; int fy = valInt(cell->row); int h = valInt(span); int oh = valInt(cell->row_span); int ty = max(h,oh)+fy; for(y=fy+1; y<ty; y++) { TableRow row = getRowTable(tab, toInt(y), ON); for(x=valInt(cell->column); x<valInt(cell->column)+valInt(cell->col_span); x++) { Any e; if ( y-fy < h ) e = cell; else e = NIL; cellTableRow(row, toInt(x), e); } } assign(cell, row_span, span); changedTable(tab); /* changed line-pattern */ requestComputeLayoutManager((LayoutManager)tab, DEFAULT); } else { assign(cell, row_span, span); } } succeed; }
static status colSpanTableCell(TableCell cell, Int span) { if ( cell->col_span != span ) { Table tab = table_of_cell(cell); if ( tab ) { int x,y; int fx = valInt(cell->column); int w = valInt(span); int ow = valInt(cell->col_span); int tx = max(w,ow)+fx; for(y=valInt(cell->row); y<valInt(cell->row)+valInt(cell->row_span); y++) { TableRow row = getRowTable(tab, toInt(y), ON); for(x=fx+1; x<tx; x++) { Any e; if ( x-fx < w ) e = cell; else e = NIL; cellTableRow(row, toInt(x), e); } } assign(cell, col_span, span); changedTable(tab); /* changed line-pattern */ requestComputeLayoutManager((LayoutManager)tab, DEFAULT); } else { assign(cell, col_span, span); } } succeed; }