OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_table.cpp versions 1.9 and 1.10
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_table.cpp 1.9 -> 1.10

--- as_table.cpp 2002/12/12 16:20:15     1.9
+++ as_table.cpp 2002/12/13 17:44:42     1.10
@@ -44,7 +44,7 @@
         ((QMouseEvent *)pEvent)->button() == QMouseEvent::MidButton)
         return true;
     else if (pEvent->type() == QEvent::KeyPress) {
-        if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) {          // Handle tab key
+        if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) { // Handle tab key
             if (this->getEdition() >= 0) {
                 int nColadvance = ((currentColumn() + 1) % TITRAQ_IDXTAIL);
                 if (nColadvance == 0)   // Advance the column and possibly the row too
@@ -52,6 +52,20 @@
                 else
                     this->setCurrentCell(currentRow(), nColadvance);
                 this->setReadOnly(false);
+                this->editCell(currentRow(), currentColumn());
+                this->setEdition(currentColumn());
+                this->setReadOnly(true);
+            }
+            return true;    // Handled the tab key event and cancel its progress
+        }
+        else if (((QKeyEvent *)pEvent)->key() == Qt::Key_Backtab) { // Handle shift tab key
+            if (this->getEdition() >= 0) {
+                int nColadvance = ((currentColumn() - 1) % TITRAQ_IDXTAIL);
+                if (nColadvance == 0)   // Advance the column and possibly the row too
+                    this->setCurrentCell(currentRow() - 1, nColadvance);
+                else
+                    this->setCurrentCell(currentRow(), nColadvance);
+                this->setReadOnly(false);
                 this->editCell(currentRow(), currentColumn());
                 this->setEdition(currentColumn());
                 this->setReadOnly(true);

CVSTrac 2.0.1