OSSP CVS Repository

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

Check-in Number: 3883
Date: 2002-Dec-16 17:05:57 (local)
2002-Dec-16 16:05:57 (UTC)
User:ms
Branch:
Comment: Implemented joined column sorting. Implemented refreshDisplay, and add action to appropriate edit and view menus.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.46 -> 1.47     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.71 -> 1.72     31 inserted, 2 deleted
ossp-pkg/as/as-gui/as_const.h      1.26 -> 1.27     4 inserted, 1 deleted
ossp-pkg/as/as-gui/as_gfx/refresh.xpm      added-> 1.1
ossp-pkg/as/as-gui/as_gui.h      1.55 -> 1.56     4 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.62 -> 1.63     32 inserted, 0 deleted
ossp-pkg/as/as-gui/as_table.h      1.8 -> 1.9     1 inserted, 0 deleted

ossp-pkg/as/as-gui/TODO 1.46 -> 1.47

--- TODO 2002/12/16 14:07:59     1.46
+++ TODO 2002/12/16 16:05:57     1.47
@@ -37,6 +37,7 @@
 Make edit control window optional through preferences
 Add customizable column ordering by click and drag
 Vor darueberknallen ein Datei, gib mal ne Warning
+Method refreshDisplay is too expensive to process
 
 Preferences
 -----------


ossp-pkg/as/as-gui/as_assist.cpp 1.71 -> 1.72

--- as_assist.cpp        2002/12/16 14:07:59     1.71
+++ as_assist.cpp        2002/12/16 16:05:57     1.72
@@ -73,6 +73,7 @@
 #include "as_gfx/staterr.xpm"   // static const char *s_kpcStaterror_xpm[]
 #include "as_gfx/statwrn.xpm"   // static const char *s_kpcStatwarn_xpm[]
 #include "as_gfx/statvoid.xpm"  // static const char *s_kpcStatvoid_xpm[]
+#include "as_gfx/refresh.xpm"   // static const char *s_kpcRefresh_xpm[]
 
 
 //
@@ -132,7 +133,8 @@
         m_pPrefs->setString(TITRAQ_PREFLOCALLOG, TITRAQ_DEFLOCALLOG);
         m_pPrefs->flush();  // Write the new conf file
         QTextStream cerr(stderr, IO_WriteOnly);
-        cerr << trUtf8("Created new preferences file ") << Homedir + QChar('/') + QString::fromLocal8Bit(TITRAQ_PREFNAME) << endl;
+        cerr << trUtf8("Created new preferences file ") << Homedir << QChar('/')
+             << QString::fromLocal8Bit(TITRAQ_PREFNAME) << endl;
     }
 
     // Use the preferred configuration values to initialize titraq
@@ -176,6 +178,7 @@
     QMimeSourceFactory::defaultFactory()->setPixmap("paste", QPixmap(s_kpcPaste_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("rowadd", QPixmap(s_kpcRowadd_xpm));
     QMimeSourceFactory::defaultFactory()->setPixmap("rowdel", QPixmap(s_kpcRowdel_xpm));
+    QMimeSourceFactory::defaultFactory()->setPixmap("refresh", QPixmap(s_kpcRefresh_xpm));
 
     // File new action
     m_pFilenewact = new QAction(trUtf8("New File"), QPixmap(s_kpcFilenew_xpm), trUtf8("&New..."), CTRL+Key_N, this, "New");
@@ -287,6 +290,17 @@
                                    "You can also select the <b>Delete</b> command "
                                    "from the <b>Edit</b> menu.</p>";
     m_pDelrowact->setWhatsThis(kszDelrowtext);
+
+    // Refresh data display action
+    m_pRefreshact = new QAction(trUtf8("Refresh Display"), QPixmap(s_kpcRefresh_xpm), trUtf8("&Refresh display"), CTRL+Key_R, this, "Refresh");
+    if (m_pRefreshact == NULL)      // Sanity check
+        throw Genexcept("Main window refresh action creation failed.");
+    connect(m_pRefreshact, SIGNAL(activated()), this, SLOT(refreshDisplay()));
+    const char *kszRefreshtext = "<p><img source=\"refresh\"> "
+                                 "Click this button to <em>refresh the display</em>. "
+                                 "You can also select the <b>Refresh</b> command "
+                                 "from the <b>View</b> menu.</p>";
+    m_pRefreshact->setWhatsThis(kszRefreshtext);
 }
 
 //
@@ -356,6 +370,8 @@
     nMenuid = m_pViewpopup->insertItem(trUtf8("&Timing"), this, SLOT(timingView()));
     m_pViewpopup->setItemEnabled(nMenuid, false);
     m_pViewpopup->insertSeparator();
+    m_pRefreshact->addTo(m_pViewpopup); // Refresh action
+    m_pViewpopup->insertSeparator();
     m_pViewpopup->insertItem(trUtf8("&Toolbars"), m_pTbarspopup);
     nMenuid = m_pTbarspopup->insertItem(trUtf8("&File"), this, SLOT(showFilebar()));
     m_pTbarspopup->setItemChecked(nMenuid, true);
@@ -438,6 +454,15 @@
     m_pAddrowact->addTo(m_pEdittools);
     m_pDelrowact->addTo(m_pEdittools);
 
+    // Construct and populate the view tool bar
+    m_pViewtools = new QToolBar("Toolview", this, DockTop);
+    if (m_pViewtools == NULL)                   // Sanity check
+        throw Genexcept("View tool bar creation failed.");
+    m_pViewtools->setLabel(trUtf8("View Ops"));
+    m_pViewtools->setOpaqueMoving(false);
+    m_pViewtools->setCloseMode(QDockWindow::Never);
+    m_pRefreshact->addTo(m_pViewtools);
+
     // Construct and populate the lonely whatsthis tool bar
     m_pWhatstools = new QToolBar("Toolwhats", this, DockTop);
     if (m_pWhatstools == NULL)                  // Sanity check
@@ -507,7 +532,7 @@
     m_pMaintable->horizontalHeader()->setClickEnabled(true); // Allow click signals
     m_pMaintable->horizontalHeader()->setTracking(false); // No continuous tracking
     m_pMaintable->setColumnStretchable(TITRAQ_IDXTAIL - 1, true);
-    m_pMaintable->setSorting(false);
+    m_pMaintable->setSorting(true);
 
     // Table header row
     m_pTablehead = m_pMaintable->horizontalHeader();
@@ -852,6 +877,10 @@
         m_pEdittools->hide();
         m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXEDITBAR), false);
     }
+    if (!m_pPrefs->getBool(TITRAQ_PREFVIEWBAR, TITRAQ_DEFVIEWBAR)) {
+        m_pViewtools->hide();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXVIEWBAR), false);
+    }
     if (!m_pPrefs->getBool(TITRAQ_PREFWHATBAR, TITRAQ_DEFWHATBAR)) {
         m_pWhatstools->hide();
         m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXWHATBAR), false);


ossp-pkg/as/as-gui/as_const.h 1.26 -> 1.27

--- as_const.h   2002/12/16 14:07:59     1.26
+++ as_const.h   2002/12/16 16:05:57     1.27
@@ -116,6 +116,8 @@
 #define TITRAQ_DEFFILEBAR       true
 #define TITRAQ_PREFEDITBAR      "edittoolbar"
 #define TITRAQ_DEFEDITBAR       true
+#define TITRAQ_PREFVIEWBAR      "viewtoolbar"
+#define TITRAQ_DEFVIEWBAR       true
 #define TITRAQ_PREFWHATBAR      "whattoolbar"
 #define TITRAQ_DEFWHATBAR       true
 
@@ -157,7 +159,8 @@
 // Indexes of popup menu submenus
 #define TITRAQ_IDXFILEBAR       1
 #define TITRAQ_IDXEDITBAR       2
-#define TITRAQ_IDXWHATBAR       3
+#define TITRAQ_IDXVIEWBAR       3
+#define TITRAQ_IDXWHATBAR       4
 
 // Values
 #define TITRAQ_MARGIN           10          // Default layout margin


ossp-pkg/as/as-gui/as_gfx/refresh.xpm -> 1.1

*** /dev/null    Sat Nov 23 06:05:15 2024
--- -    Sat Nov 23 06:05:31 2024
***************
*** 0 ****
--- 1,93 ----
+ /* XPM */
+ static const char *s_kpcRefresh_xpm[] = {
+ "22 22 68 1",
+ "      c None",
+ ".     c #000000",
+ "+     c #624F1D",
+ "@     c #A7852B",
+ "#     c #997514",
+ "$     c #906C0D",
+ "%     c #4B3704",
+ "&     c #0F0C04",
+ "*     c #BE9A38",
+ "=     c #A87E0E",
+ "-     c #9B7100",
+ ";     c #956C00",
+ ">     c #8D6600",
+ ",     c #7F5C00",
+ "'     c #090600",
+ ")     c #A38128",
+ "!     c #B6870A",
+ "~     c #AB7C00",
+ "{     c #A37700",
+ "]     c #906900",
+ "^     c #594100",
+ "/     c #271C00",
+ "(     c #7E5C00",
+ "_     c #201806",
+ ":     c #1F1808",
+ "<     c #D5AA36",
+ "[     c #C4920D",
+ "}     c #B98700",
+ "|     c #B28200",
+ "1     c #A47700",
+ "2     c #5C4300",
+ "3     c #9B791E",
+ "4     c #342500",
+ "5     c #C99917",
+ "6     c #C19828",
+ "7     c #D39C07",
+ "8     c #C99200",
+ "9     c #C18C00",
+ "0     c #AA7C00",
+ "a     c #674B00",
+ "b     c #100B00",
+ "c     c #433000",
+ "d     c #EEB315",
+ "e     c #E9AD0B",
+ "f     c #E1A70A",
+ "g     c #D89D00",
+ "h     c #D19800",
+ "i     c #BC8900",
+ "j     c #362700",
+ "k     c #F3B715",
+ "l     c #EDAD00",
+ "m     c #E6A800",
+ "n     c #DFA200",
+ "o     c #C38E00",
+ "p     c #745400",
+ "q     c #0D0900",
+ "r     c #F8BA15",
+ "s     c #F2B000",
+ "t     c #FDBE15",
+ "u     c #F8B500",
+ "v     c #EEAD00",
+ "w     c #D99E00",
+ "x     c #4F3900",
+ "y     c #513B00",
+ "z     c #523B00",
+ "A     c #543D00",
+ "B     c #563E00",
+ "C     c #705100",
+ "                      ",
+ "         ...          ",
+ "       .+@#$%.        ",
+ "      &*=-;>,'        ",
+ " .   .)!~{]^/(.       ",
+ " ._ :<[}|12. 34       ",
+ " .5.67890ab   c       ",
+ " .defghia.    j       ",
+ " .klmnopq     .       ",
+ " .rslm(.              ",
+ " .tusvw.     .xyzABC. ",
+ " .CBAzyx.      .wvsut ",
+ "               .(mlsr ",
+ "        .     qponmlk ",
+ "        j    .aihgfed ",
+ "        c   ba09876.5 ",
+ "        43 .21|}[<: _ ",
+ "        .(/^]{~!).    ",
+ "         ',>;-=*&     ",
+ "         .%$#@+.      ",
+ "           ...        ",
+ "                      "};


ossp-pkg/as/as-gui/as_gui.h 1.55 -> 1.56

--- as_gui.h     2002/12/16 12:11:40     1.55
+++ as_gui.h     2002/12/16 16:05:57     1.56
@@ -95,6 +95,7 @@
     QAction     *m_pFilesaveact,  *m_pFilesaveasact;
     QAction     *m_pFilecloseact, *m_pFilequitact;
     QAction     *m_pAddrowact,    *m_pDelrowact;
+    QAction     *m_pRefreshact;
     QAction     *m_pCutact,       *m_pCopyact;
     QAction     *m_pPasteact,     *m_pWritedataact;
 
@@ -124,6 +125,7 @@
     void pasteEntry(void);              // Paste task entries to the list
     void addEntry(int nRows= -1);       // Add task entries to the list
     void delEntry(int nRows= -1);       // Delete task entries from the list
+    void refreshDisplay(void);          // Refresh the display of all data items
     void newDoc(void);                  // Make and display a new document window
     void openDoc(void);                 // Open and display an existing document
     void saveFile(void);                // Serialize to the current file
@@ -156,6 +158,7 @@
     void timingView(void);              // View menu timing
     void showFilebar(void);             // View menu show file toolbar
     void showEditbar(void);             // View menu show edit toolbar
+    void showViewbar(void);             // View menu show view toolbar
     void showWhatsbar(void);            // View menu show whats this toolbar
     void showStatcol(void);             // View menu show status column
     void showLinecol(void);             // View menu show line numbers column
@@ -192,6 +195,7 @@
     // Belong to us
     QToolBar    *m_pFiletools;
     QToolBar    *m_pEdittools;
+    QToolBar    *m_pViewtools;
     QToolBar    *m_pWhatstools;
     QString     *m_szFilename;
 


ossp-pkg/as/as-gui/as_slot.cpp 1.62 -> 1.63

--- as_slot.cpp  2002/12/16 10:45:25     1.62
+++ as_slot.cpp  2002/12/16 16:05:57     1.63
@@ -212,6 +212,23 @@
 }
 
 //
+// Refresh the display of all data items
+//
+void Titraqform::refreshDisplay(void)
+{
+    int nIter = m_pMaintable->numRows(); // Iterate through total rows
+
+    // Sweep through matrix validating linewise
+    // data and updating line numbers for all rows
+    while (--nIter >= 0) {
+        this->validateData(nIter, 0);
+        m_pMaintable->setText(nIter, TITRAQ_IDXLINE, QString::number(nIter).rightJustify(4, QChar('0')));
+    }
+
+    this->repaint(); // Do a general repaint of viewable area
+}
+
+//
 // Make and display a new document window
 //
 void Titraqform::newDoc(void)
@@ -893,6 +910,21 @@
     }
 }
 
+//
+// View menu show view toolbar
+//
+void Titraqform::showViewbar(void)
+{
+    if (m_pViewtools->isVisible()) {
+        m_pViewtools->hide();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXVIEWBAR), false);
+    }
+    else {
+        m_pViewtools->show();
+        m_pTbarspopup->setItemChecked(m_pTbarspopup->idAt(TITRAQ_IDXVIEWBAR), true);
+    }
+}
+
 //
 // View menu show whats this toolbar
 //


ossp-pkg/as/as-gui/as_table.h 1.8 -> 1.9

--- as_table.h   2002/12/12 16:20:15     1.8
+++ as_table.h   2002/12/16 16:05:57     1.9
@@ -57,6 +57,7 @@
 
     // Overridden accessors
     void setText(int, int, const QString &);
+    void sortColumn(int nCol, bool bAscend, bool bWhole = true) {QTable::sortColumn(nCol, bAscend, true);};
 //    virtual QTableItem *item(int nRow, int nCol) const {QTable::item(nRow, nCol);};
 
     // Deny a cell special handling of the focus rectangle

CVSTrac 2.0.1