Index: ossp-pkg/as/as-gui/as_table.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v' 2>/dev/null --- as_table.cpp 2002/12/17 16:47:30 1.15 +++ as_table.cpp 2002/12/17 16:55:08 1.16 @@ -124,6 +124,7 @@ this->setText(nIter, TITRAQ_IDXLINE, QString::number(nIter).rightJustify(4, QChar('0'))); } +// Overriden member to render edge rows differently according to a sort key void TiTable::paintCell(QPainter *pPainter, int nRow, int nCol, const QRect &Recto, bool bSelect, const QColorGroup &Colgroup) { QColorGroup Cgroup(Colgroup); @@ -140,3 +141,23 @@ QTable::paintCell(pPainter, nRow, nCol, Recto, bSelect, Cgroup); }; + +// Blah +void TiTable::activateNextCell(void) +{ + int nIter = 1; // Logic to skip invisible or read only columns + while (columnWidth((currentColumn() + nIter) % TITRAQ_IDXTAIL) <= 0 + || isColumnReadOnly((currentColumn() + nIter) % TITRAQ_IDXTAIL)) + nIter++; + + // Advance the column or both row and column possibly + int nColadvance = ((currentColumn() + nIter) % TITRAQ_IDXTAIL); + if ((currentColumn() + nIter) >= TITRAQ_IDXTAIL) + this->setCurrentCell(currentRow() + 1, nColadvance); + else + this->setCurrentCell(currentRow(), nColadvance); + this->setReadOnly(false); + this->editCell(currentRow(), currentColumn()); + this->setEdition(currentColumn()); + this->setReadOnly(true); +} Index: ossp-pkg/as/as-gui/as_table.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v' 2>/dev/null --- as_table.h 2002/12/17 16:47:30 1.11 +++ as_table.h 2002/12/17 16:55:08 1.12 @@ -74,6 +74,9 @@ // Override for special linewise shading according to sort key virtual void paintCell(QPainter *, int, int, const QRect &, bool, const QColorGroup &); + // For special focus handling on return key in edit mode + virtual void activateNextCell(void); + signals: void textEdited(void); // A cell was edited and data was modified };