OSSP CVS Repository

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

Check-in Number: 2896
Date: 2002-Nov-26 20:09:58 (local)
2002-Nov-26 19:09:58 (UTC)
User:ms
Branch:
Comment: Corrected add entry logic, and implemented remove entry logic.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_assist.cpp      1.20 -> 1.21     1 inserted, 1 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.16 -> 1.17     20 inserted, 6 deleted
ossp-pkg/titraq/titassist.cpp      1.20 -> 1.21     1 inserted, 1 deleted
ossp-pkg/titraq/titslot.cpp      1.16 -> 1.17     20 inserted, 6 deleted

ossp-pkg/as/as-gui/as_assist.cpp 1.20 -> 1.21

--- as_assist.cpp        2002/11/26 17:23:51     1.20
+++ as_assist.cpp        2002/11/26 19:09:58     1.21
@@ -408,7 +408,7 @@
     m_pMaintable->setNumCols(g_knCols);
     m_pMaintable->setReadOnly(true);                    // Table is read only
     m_pMaintable->setColumnMovingEnabled(false);        // Ctrl-drag disabled
-    m_pMaintable->setSelectionMode(QTable::MultiRow);   // Multi row selection
+    m_pMaintable->setSelectionMode(QTable::SingleRow);  // Multi row selection
     m_pMaintable->setFocusStyle(QTable::FollowStyle);   // How cells are drawn
     m_pMaintable->setLeftMargin(0);             // Get rid of the vertical header
     m_pMaintable->verticalHeader()->hide();     // by hiding it with a margin of 0


ossp-pkg/as/as-gui/as_slot.cpp 1.16 -> 1.17

--- as_slot.cpp  2002/11/26 17:34:02     1.16
+++ as_slot.cpp  2002/11/26 19:09:58     1.17
@@ -13,7 +13,6 @@
 #include "gfx/cwlogo.xpm"       // static const char *s_kpcCwlogo_xpm[]
 #include "gfx/ossplogo.xpm"     // static const char *s_kpcOssplogo_xpm[]
 
-
 //
 // Cut an entry
 //
@@ -46,9 +45,19 @@
 //
 void Titraqform::addEntry(void)
 {
-    // Adds a new row to end of table and focuses to it
-    m_pMaintable->setNumRows(m_pMaintable->numRows() + 1);
-    m_pMaintable->setCurrentCell(m_pMaintable->numRows(), 0);
+//    // Add a row to end of table and focuses to it
+//    m_pMaintable->setNumRows(m_pMaintable->numRows() + 1);
+//    m_pMaintable->setCurrentCell(m_pMaintable->numRows(), 0);
+
+    // Add a row after selection and focus to the new row
+    if (m_pMaintable->currentRow() + 1 != m_pMaintable->numRows()) {
+        m_pMaintable->insertRows(m_pMaintable->currentRow());
+        m_pMaintable->setCurrentCell(m_pMaintable->currentRow() - 3, m_pMaintable->currentColumn());
+    }
+    else // Special case to handle adding an only row or last row
+        m_pMaintable->insertRows(m_pMaintable->currentRow() + 1); {
+        m_pMaintable->setCurrentCell(m_pMaintable->currentRow() + 1, m_pMaintable->currentColumn());
+    }
 }
 
 //
@@ -56,8 +65,13 @@
 //
 void Titraqform::delEntry(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Remove the row at selection and focus to the next row
+    if (m_pMaintable->currentRow() + 1 != m_pMaintable->numRows()) {
+        m_pMaintable->setCurrentCell(m_pMaintable->currentRow() + 1, m_pMaintable->currentColumn());
+        m_pMaintable->removeRow(m_pMaintable->currentRow() - 1);
+    }
+    else // Special case to handle removing of only row or last row
+        m_pMaintable->removeRow(m_pMaintable->currentRow());
 }
 
 //



CVSTrac 2.0.1