Index: ossp-pkg/as/as-gui/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v rcsdiff -q -kk '-r1.22' '-r1.23' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/Makefile.in,v' 2>/dev/null --- 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 Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.24' '-r1.25' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- 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 --------------- Index: ossp-pkg/as/as-gui/as_assist.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v rcsdiff -q -kk '-r1.38' '-r1.39' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- 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(); Index: ossp-pkg/as/as-gui/as_const.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v' 2>/dev/null --- 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 Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.36' '-r1.37' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- 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 Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.30' '-r1.31' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- 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. } // Index: ossp-pkg/as/as-gui/as_table.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v' 2>/dev/null --- 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); } Index: ossp-pkg/as/as-gui/as_table.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v' 2>/dev/null --- 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