OSSP CVS Repository

ossp - Check-in [3892]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3892
Date: 2002-Dec-17 17:55:08 (local)
2002-Dec-17 16:55:08 (UTC)
User:ms
Branch:
Comment: Correct cell edition and focus handling on return key in edit mode.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_table.cpp      1.15 -> 1.16     21 inserted, 0 deleted
ossp-pkg/as/as-gui/as_table.h      1.11 -> 1.12     3 inserted, 0 deleted

ossp-pkg/as/as-gui/as_table.cpp 1.15 -> 1.16

--- 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);
+}


ossp-pkg/as/as-gui/as_table.h 1.11 -> 1.12

--- 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
 };

CVSTrac 2.0.1