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());
}
//
|
|