head 1.19; access; symbols AS_AFTER_RESTRUCTURING:1.3; locks; strict; comment @ * @; 1.19 date 2004.08.24.21.48.29; author ms; state Exp; branches; next 1.18; 1.18 date 2004.05.27.21.48.41; author ms; state Exp; branches; next 1.17; 1.17 date 2004.05.27.21.42.26; author ms; state Exp; branches; next 1.16; 1.16 date 2003.11.20.11.31.20; author ms; state Exp; branches; next 1.15; 1.15 date 2003.02.21.10.12.02; author ms; state Exp; branches; next 1.14; 1.14 date 2002.12.20.17.42.10; author ms; state Exp; branches; next 1.13; 1.13 date 2002.12.18.14.50.58; author ms; state Exp; branches; next 1.12; 1.12 date 2002.12.17.16.55.08; author ms; state Exp; branches; next 1.11; 1.11 date 2002.12.17.16.47.30; author ms; state Exp; branches; next 1.10; 1.10 date 2002.12.16.17.13.17; author ms; state Exp; branches; next 1.9; 1.9 date 2002.12.16.16.05.57; author ms; state Exp; branches; next 1.8; 1.8 date 2002.12.12.16.20.15; author ms; state Exp; branches; next 1.7; 1.7 date 2002.12.05.14.51.29; author ms; state Exp; branches; next 1.6; 1.6 date 2002.12.04.20.30.54; author ms; state Exp; branches; next 1.5; 1.5 date 2002.12.04.17.31.20; author ms; state Exp; branches; next 1.4; 1.4 date 2002.12.03.17.05.11; author ms; state Exp; branches; next 1.3; 1.3 date 2002.11.28.20.44.36; author ms; state Exp; branches; next 1.2; 1.2 date 2002.11.27.22.44.48; author ms; state Exp; branches; next 1.1; 1.1 date 2002.11.27.17.13.13; author ms; state Exp; branches; next ; desc @@ 1.19 log @Add new overriden QTable::endEdit() method to properly deactivate in place edition when finished. @ text @// // OSSP asgui - Accounting system graphical user interface // Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) // Copyright (c) 2002-2004 Ralf S. Engelschall // Copyright (c) 2002-2004 Michael Schloh von Bennewitz // Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH // // This file is part of OSSP asgui, an accounting system graphical user // interface which can be found at http://www.ossp.org/pkg/tool/asgui/. // // Permission to use, copy, modify, and distribute this software for // any purpose with or without fee is hereby granted, provided that // the above copyright notice and this permission notice appear in all // copies. // // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // as_table.h: ISO C++ interface // #ifndef TITABLE_H #define TITABLE_H #include #include "as_pref.h" class TiTable : public QTable { Q_OBJECT private: int m_nSortcol; // To track current sort column int m_bSortdir; // To track current sort direction bool m_bDirt; // To track dirty and clean states Preferences *m_pTiprefs; // To read current color values public: // Try to match QTable's default constructor with an initializer list TiTable(Preferences *pPrefs, QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) { this->setSortcol(0); this->setSortdir(true); this->setDirty(false); this->setEdition(); // Reset edition state m_pTiprefs = pPrefs; horizontalHeader()->installEventFilter(this); }; bool eventFilter(QObject *, QEvent *); // Standard members int m_nEdit; // To track edition state // 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 const int getEdition(void) {return m_nEdit;}; // Which edited column was confirmed void setEdition(const int nEdit = -1) {m_nEdit = nEdit;}; // Set edition status const int getSortcol(void) {return m_nSortcol;}; void setSortcol(const int nColin) {m_nSortcol = nColin;}; const bool getSortdir(void) {return m_bSortdir;}; void setSortdir(const bool bDirection) {m_bSortdir = bDirection;}; // Overridden accessors void setText(int, int, const QString &); void sortColumn(int nCol, bool bAscend = true, bool bWhole = true); // virtual QTableItem *item(int nRow, int nCol) const {return QTable::item(nRow, nCol);}; // Deny a cell special handling of the focus rectangle // by overriding class QTable's paintFocus method virtual void paintFocus(QPainter *, const QRect &) {}; // Override for special linewise shading according to sort key virtual void paintCell(QPainter *, int, int, const QRect &, bool, const QColorGroup &); // Override to properly handle read only attribute during edition virtual void endEdit(int, int, bool, bool); // For special focus handling on return key in edit mode virtual void activateNextCell(void); signals: void textEdited(int, int); // A cell was edited and data was modified }; #endif // TITABLE_H @ 1.18 log @Modernize copyright text in source and graphic headers. @ text @d80 1 a80 1 // virtual QTableItem *item(int nRow, int nCol) const {QTable::item(nRow, nCol);}; d89 3 @ 1.17 log @Correct file names in source headers. @ text @d3 4 a6 4 // Copyright (c) 2002-2003 The OSSP Project (http://www.ossp.org/) // Copyright (c) 2002-2003 Ralf S. Engelschall // Copyright (c) 2002-2003 Michael Schloh von Bennewitz // Copyright (c) 2002-2003 Cable & Wireless Telecommunications Services GmbH @ 1.16 log @Handle the time consuming bureaucracy of changing a company name. @ text @d29 1 a29 1 // titable.h: ISO C++ interface @ 1.15 log @Reluctantly added Preferences class coupling, because we need to read the row shading colour dynamically. @ text @a3 1 // Copyright (c) 2002-2003 Cable & Wireless Deutschland (http://www.cw.com/de/) d6 1 @ 1.14 log @Fixed sorting and added sort direction handling. @ text @d37 2 d48 1 d52 1 a52 1 TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) d58 1 @ 1.13 log @Fixed row shade logic and moved dirty flag to TiTable class. @ text @d44 1 d52 1 d70 2 @ 1.12 log @Correct cell edition and focus handling on return key in edit mode. @ text @d43 2 a44 1 int m_nSortcol; d50 3 a52 1 m_nSortcol = 0; a53 1 this->setEdition(); // Reset edition state d62 3 a64 1 const int getEdition(void) {return m_nEdit;}; // Which edited column was confirmed d85 1 a85 1 void textEdited(void); // A cell was edited and data was modified @ 1.11 log @Implement rudimentary row shading on sort key, and add GUID and APPID. @ text @d77 3 @ 1.10 log @Preserve user preferred sort order and don't set dirty flag on renumber ops. @ text @d74 3 @ 1.9 log @Implemented joined column sorting. Implemented refreshDisplay, and add action to appropriate edit and view menus. @ text @d41 4 d49 1 d62 2 d67 1 a67 1 void sortColumn(int nCol, bool bAscend, bool bWhole = true) {QTable::sortColumn(nCol, bAscend, true);}; @ 1.8 log @Fix closure on clean state bug in a better way. @ text @d60 1 @ 1.7 log @Flush dirty state saving changes without considering broken build. @ text @d58 2 a59 1 // // Overridden accessors d65 3 @ 1.6 log @Various edition repairs and improvements. @ text @d45 1 a45 1 this->installEventFilter(this); @ 1.5 log @Fix event handling problem with TiTable, and explicitly state scope of method calls in TiTable. @ text @d58 3 d63 1 a63 1 void paintFocus(QPainter *, const QRect &) {}; @ 1.4 log @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. @ text @d45 2 a46 2 horizontalHeader()->installEventFilter(this); setEdition(); // Reset edition state @ 1.3 log @Massive build configuration preparation, added boilerplate header text, and cleaned up whitespace. @ text @d40 1 d43 14 a56 1 TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) {horizontalHeader()->installEventFilter(this);}; a60 3 private: bool eventFilter(QObject *, QEvent *); @ 1.2 log @Added eventhandler to catch illegal double clicks, minimized layout of edition controls, changes to slot arrangement. @ text @d1 31 @ 1.1 log @Really add the class this time, and fix a syntax error. @ text @d10 2 a11 1 TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) {}; d15 4 a18 1 void TiTable::paintFocus(QPainter *, const QRect &) {}; @