FXTable insert/delete row
Hi all,
I'm just starting studing FOX-1.6.36 and I have a question regarding FXTable.
In particular, it's not really clear to me the "insert row"/"delete row" behaviour.
Please consider this change in the example code table.c:
// Deleted
long TableWindow::onTableDeleted(FXObject*,FXSelector,void* ptr)
{
FXTableRange *tr=(FXTableRange*)ptr;
FXTRACE((10,"SEL_DELETED fm.row=%d, fm.col=%d to.row=%d, to.col=%d\n",tr->fm.row,tr->fm.col,tr->to.row,tr->to.col));
FXint r,c,nr,nc;
nr=table->getNumRows();
nc=table->getNumColumns();
for(r=0; r<nr; r++)
{
for(c=0; c<nc; c++)
{
table->setItemText(r,c,"r_ridim:"+FXStringVal(r+1)+" c_ridim:"+FXStringVal(c+1));
}
}
return 1;
}
what happens is that execution of the code above is done before row deletion while the same code in the insert row code is (correctly to me) done after row insertion.
for example if I delete row 4 I got traces:
[2176] SEL_DELETED fm.row=4, fm.col=0 to.row=4, to.col=6
[2176] delete item r_ridim:5 c_ridim:1
[2176] delete item r_ridim:5 c_ridim:2
[2176] delete item r_ridim:5 c_ridim:3
[2176] delete item r_ridim:5 c_ridim:4
[2176] delete item r_ridim:5 c_ridim:5
[2176] delete item r_ridim:5 c_ridim:6
[2176] delete item r_ridim:5 c_ridim:7
so I got a table switching from element r_ridim:4 c_ridim:1 to element r_ridim:6 c_ridim:1 that is not what I want.
Where I'm wrong?
Thanks and regards,
Mad Max