Check-in Number:
|
3871 | |
Date: |
2002-Dec-13 19:06:10 (local)
2002-Dec-13 18:06:10 (UTC) |
User: | ms |
Branch: | |
Comment: |
Fix tab and shift tab edit in place advance logic. |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/as/as-gui/as_table.cpp 1.10 -> 1.11
--- as_table.cpp 2002/12/13 17:44:42 1.10
+++ as_table.cpp 2002/12/13 18:06:10 1.11
@@ -46,7 +46,9 @@
else if (pEvent->type() == QEvent::KeyPress) {
if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) { // Handle tab key
if (this->getEdition() >= 0) {
- int nColadvance = ((currentColumn() + 1) % TITRAQ_IDXTAIL);
+ int nIter = 0; // To skip invisible columns
+ while (columnWidth((currentColumn() + ++nIter) % TITRAQ_IDXTAIL) <= 0); // Skip invisibles
+ int nColadvance = ((currentColumn() + nIter) % TITRAQ_IDXTAIL);
if (nColadvance == 0) // Advance the column and possibly the row too
this->setCurrentCell(currentRow() + 1, nColadvance);
else
@@ -60,7 +62,9 @@
}
else if (((QKeyEvent *)pEvent)->key() == Qt::Key_Backtab) { // Handle shift tab key
if (this->getEdition() >= 0) {
- int nColadvance = ((currentColumn() - 1) % TITRAQ_IDXTAIL);
+ int nIter = 0; // To skip invisible columns
+ while (columnWidth((currentColumn() - ++nIter) % TITRAQ_IDXTAIL) <= 0); // Skip invisibles
+ int nColadvance = ((currentColumn() - nIter) % TITRAQ_IDXTAIL);
if (nColadvance == 0) // Advance the column and possibly the row too
this->setCurrentCell(currentRow() - 1, nColadvance);
else
|
|