OSSP CVS Repository

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

Check-in Number: 3818
Date: 2002-Dec-03 18:05:11 (local)
2002-Dec-03 17:05:11 (UTC)
User:ms
Branch:
Comment: Added TiTable object to MOC Mapping, added normal view menu again, added ugly edition state member flag, fixed double click table header resize bug, added auto advance in place edit feature.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/Makefile.in      1.22 -> 1.23     2 inserted, 2 deleted
ossp-pkg/as/as-gui/TODO      1.24 -> 1.25     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.38 -> 1.39     3 inserted, 1 deleted
ossp-pkg/as/as-gui/as_const.h      1.9 -> 1.10     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_gui.h      1.36 -> 1.37     5 inserted, 6 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.30 -> 1.31     17 inserted, 4 deleted
ossp-pkg/as/as-gui/as_table.cpp      1.4 -> 1.5     25 inserted, 4 deleted
ossp-pkg/as/as-gui/as_table.h      1.3 -> 1.4     15 inserted, 4 deleted

ossp-pkg/as/as-gui/Makefile.in 1.22 -> 1.23

--- Makefile.in  2002/12/02 18:10:19     1.22
+++ Makefile.in  2002/12/03 17:05:11     1.23
@@ -73,8 +73,8 @@
 GRAFX           = gfx/ossplogo.xpm
 
 # Qt meta object compiler (MOC) generated
-MOC_OUT         = moc_as_gui.cpp
-MOC_OBJ         = moc_as_gui.o
+MOC_OUT         = moc_as_gui.cpp moc_as_table.cpp
+MOC_OBJ         = moc_as_gui.o moc_as_table.o
 
 .SUFFIXES:
 .SUFFIXES: .c .cc .cpp .cxx .o


ossp-pkg/as/as-gui/TODO 1.24 -> 1.25

--- TODO 2002/11/28 20:53:15     1.24
+++ TODO 2002/12/03 17:05:11     1.25
@@ -31,6 +31,7 @@
 Reduce dependence to STL by removing cout to QTextStream
 Ausblendbare Spalten
 Add install and uninstall targets to makefile
+Check all identifiers for undeutig unique scope
 
 Beim Editmodus
 ---------------


ossp-pkg/as/as-gui/as_assist.cpp 1.38 -> 1.39

--- as_assist.cpp        2002/12/02 13:25:36     1.38
+++ as_assist.cpp        2002/12/03 17:05:11     1.39
@@ -294,7 +294,9 @@
 
     // Populate the view menu with subitems
     m_pMenubar->insertItem(trUtf8("&View"), m_pViewpopup);
-    m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
+    m_pViewpopup->insertItem(trUtf8("&Normal"), this, SLOT(normalView()));
+    nMenuid = m_pViewpopup->insertItem(trUtf8("&Editing"), this, SLOT(editingView()));
+    m_pViewpopup->setItemEnabled(nMenuid, false);
     nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
     m_pViewpopup->setItemEnabled(nMenuid, false);
     m_pViewpopup->insertSeparator();


ossp-pkg/as/as-gui/as_const.h 1.9 -> 1.10

--- as_const.h   2002/12/02 13:25:36     1.9
+++ as_const.h   2002/12/03 17:05:11     1.10
@@ -55,6 +55,7 @@
 #define TITRAQ_IDXAMOUNT        3
 #define TITRAQ_IDXTASK          4
 #define TITRAQ_IDXREMARK        5
+#define TITRAQ_IDXEND           6
 
 // Indexes of popup menu submenus
 #define TITRAQ_IDXFILEBAR       1


ossp-pkg/as/as-gui/as_gui.h 1.36 -> 1.37

--- as_gui.h     2002/12/02 13:25:36     1.36
+++ as_gui.h     2002/12/03 17:05:11     1.37
@@ -80,6 +80,10 @@
     Titraqform(QWidget *pParent = 0, const char *kszName = 0, WFlags Flags = 0);
     ~Titraqform(void);
 
+    // Accessor methods
+    const bool isDirty(void) {return m_bDirt;};     // Check for changed state danger
+    void setDirty(bool bDirty = true) {m_bDirt = bDirty;};      // Clean or dirty
+
     // Top level members
     Preferences *m_pPrefs;
 
@@ -125,6 +129,7 @@
     void updSizes(int, int, int);       // Update edit sizes
     void confirmEdit(void);             // Confirm whole row edition
     void configPrefs(void);             // Edit menu configure preferences
+    void normalView(void);              // View menu normal
     void editingView(void);             // View menu editing
     void timingView(void);              // View menu timing
     void showFilebar(void);             // View menu show file toolbar
@@ -167,12 +172,6 @@
     // Standard members
     bool        m_bDirt;                    // To track dirty and clean states
 
-    // Standard methods
-    bool isDirty(void) {return m_bDirt;};    // Check for changed state danger
-
-    // Accessor methods
-    void setDirty(bool bDirty = true) {m_bDirt = bDirty;};  // Clean or dirty
-
     // Constructor helpers
     void setupPrefs(void);              // Preferences
     void setupActions(void);            // Actions


ossp-pkg/as/as-gui/as_slot.cpp 1.30 -> 1.31

--- as_slot.cpp  2002/12/02 18:10:19     1.30
+++ as_slot.cpp  2002/12/03 17:05:11     1.31
@@ -229,6 +229,7 @@
 {
     m_pMaintable->setReadOnly(false);
     m_pMaintable->editCell(nRow, nCol);
+    m_pMaintable->setEdition(nCol);
     m_pMaintable->setReadOnly(true);
 }
 
@@ -285,6 +286,9 @@
     QString Texttask(m_pMaintable->text(nRow, TITRAQ_IDXTASK));
     QString Textremark(m_pMaintable->text(nRow, TITRAQ_IDXREMARK));
 
+    // Reset the edition state member
+    m_pMaintable->setEdition();
+
     if (!Textdate.isEmpty())
         m_pDateedit->setDate(QDate::fromString(Textdate, Qt::ISODate));
     else
@@ -333,12 +337,21 @@
 }
 
 //
+// View menu normal
+//
+void Titraqform::normalView(void)
+{
+    // All view types except normal are disabled until implemention, so
+    // this body can remain empty, causing nothing to happen on selection.
+}
+
+//
 // View menu editing
 //
 void Titraqform::editingView(void)
 {
-    // All other view types are disabled until implemention, so this
-    // body can remain empty, causing nothing to happen on selection.
+    // All view types except normal are disabled until implemention, so
+    // this body can remain empty, causing nothing to happen on selection.
 }
 
 //
@@ -346,8 +359,8 @@
 //
 void Titraqform::timingView(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // All view types except normal are disabled until implemention, so
+    // this body can remain empty, causing nothing to happen on selection.
 }
 
 //


ossp-pkg/as/as-gui/as_table.cpp 1.4 -> 1.5

--- as_table.cpp 2002/12/02 13:25:36     1.4
+++ as_table.cpp 2002/12/03 17:05:11     1.5
@@ -37,8 +37,29 @@
 // Implements an event filter for catching header double click events
 bool TiTable::eventFilter(QObject *pObject, QEvent *pEvent)
 {
-    if (pObject == horizontalHeader())
-        return false;
-    else
-        return QTable::eventFilter(pObject, pEvent);    // Pass the event onwards
+    if (pObject == horizontalHeader() && pEvent->type() == QEvent::MouseButtonDblClick)
+        return true;
+    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_IDXEND);
+                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);
+            }
+            return true;    // Handled the tab key event and cancel its progress
+        }
+        else if (((QKeyEvent *)pEvent)->key() == Qt::Key_Escape)    // Handle escape key
+            this->setEdition();
+
+        // Forward incompletely handled key events
+        return QTable::eventFilter(pObject, pEvent);
+    }
+    else                    // Default behaviour is to pass the event onwards
+        return QTable::eventFilter(pObject, pEvent);
 }


ossp-pkg/as/as-gui/as_table.h 1.3 -> 1.4

--- as_table.h   2002/11/28 20:44:36     1.3
+++ as_table.h   2002/12/03 17:05:11     1.4
@@ -37,16 +37,27 @@
 
 class TiTable : public QTable
 {
+    Q_OBJECT
 public:
     // Try to match QTable's default constructor with an initializer list
-    TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) {horizontalHeader()->installEventFilter(this);};
+    TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName)
+    {
+        horizontalHeader()->installEventFilter(this);
+        setEdition();   // Reset edition state
+    };
+
+    bool eventFilter(QObject *, QEvent *);
+
+    // Standard members
+    int m_nEdit;    // To track edition state
+
+    // Accessor methods
+    const int getEdition(void) {return m_nEdit;};   // Which edited column was confirmed
+    void setEdition(const int nEdit = -1) {m_nEdit = nEdit;};   // Set edition status
 
     // Deny a cell special handling of the focus rectangle
     // by overriding class QTable's paintFocus method
     void paintFocus(QPainter *, const QRect &) {};
-
-private:
-    bool eventFilter(QObject *, QEvent *);
 };
 
 #endif // TITABLE_H

CVSTrac 2.0.1