OSSP CVS Repository

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

Check-in Number: 2811
Date: 2002-Nov-11 22:39:08 (local)
2002-Nov-11 21:39:08 (UTC)
User:ms
Branch:
Comment: Flush changes ending in a more complete application frame.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.3 -> 1.4     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_gui.cpp      1.1 -> 1.2     79 inserted, 50 deleted
ossp-pkg/as/as-gui/as_gui.h      1.1 -> 1.2     34 inserted, 19 deleted
ossp-pkg/as/as-gui/as_main.cpp      1.3 -> 1.4     7 inserted, 41 deleted
ossp-pkg/titraq/TODO      1.3 -> 1.4     2 inserted, 0 deleted
ossp-pkg/titraq/main.cpp      1.3 -> 1.4     7 inserted, 41 deleted
ossp-pkg/titraq/titraq.cpp      1.1 -> 1.2     79 inserted, 50 deleted
ossp-pkg/titraq/titraq.h      1.1 -> 1.2     34 inserted, 19 deleted

ossp-pkg/as/as-gui/TODO 1.3 -> 1.4

--- TODO 2002/11/08 12:21:34     1.3
+++ TODO 2002/11/11 21:39:08     1.4
@@ -9,6 +9,8 @@
 
 Must do
 -------
+Add GUID
+Add Ex_ID
 
 Dreams
 ------


ossp-pkg/as/as-gui/as_gui.cpp 1.1 -> 1.2

--- as_gui.cpp   2002/11/08 12:27:57     1.1
+++ as_gui.cpp   2002/11/11 21:39:08     1.2
@@ -1,16 +1,10 @@
-#include "titraq.h"
-
-#include <qvariant.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtable.h>
-#include <qmime.h>
-#include <qdragobject.h>
-#include <qlayout.h>
+// System interface
 #include <qtooltip.h>
 #include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
+
+// User interface
+#include "titraq.h"         // Main classes
+#include "gfx/ossplogo.xpm" // OSSP logo: static const char *ossplogo_xpm[]
 
 // Used in initialization of the application
 void Titraqform::init()
@@ -20,67 +14,102 @@
 }
 
 //
-// Construct a Titraqform which is a child of 'pParent', with the 
+// Construct a Titraqform which is a child of 'pParent', with the
 // name 'kszName' and widget flags set to 'Flags'
 //
-
 Titraqform::Titraqform(QWidget *pParent,  const char *kszName, bool bModal,
     WFlags Flags) : QDialog(pParent, kszName, bModal, Flags)
 {
     if (!kszName)
     setName("Titraqform");
-    resize(600, 480); 
-    setCaption(trUtf8("OpenPKG Friend"));
-    pTitraqformlayout = new QVBoxLayout(this, 11, 6, "pTitraqformlayout"); 
-
-    // Contains the package layout and control layout
-    pMainlayout = new QVBoxLayout(0, 0, 6, "pMainlayout"); 
+    resize(600, 480);
+    setCaption(trUtf8("OSSP Titraq"));
 
-    // Contains the table control and status line control
-    pPackagelayout = new QVBoxLayout(0, 0, 6, "pPackagelayout"); 
+    // Control layouts for form, table, and status line
+    pTitraqformlayout = new QVBoxLayout(this, 11, 6, "pTitraqformlayout");
+    pMainlayout = new QVBoxLayout(0, 0, 6, "pMainlayout");       // For layouts
+    pPackagelayout = new QVBoxLayout(0, 0, 6, "pPackagelayout"); // For table
 
+    // The table itself
     pMaintable = new QTable(this, "pMaintable");
-    pMaintable->setNumRows(10);
-    pMaintable->setNumCols(6);
-    pMaintable->setReadOnly(FALSE);
-    pPackagelayout->addWidget(pMaintable);
-
-    pStatusline = new QLineEdit(this, "pStatusline");
-    pStatusline->setFrameShape(QLineEdit::LineEditPanel);
-    pStatusline->setFrameShadow(QLineEdit::Sunken);
-    pStatusline->setFrame(TRUE);
-    pStatusline->setReadOnly(TRUE);
-    pPackagelayout->addWidget(pStatusline);
+    pMaintable->setNumRows(knRows);
+    pMaintable->setNumCols(knCols);
+    pMaintable->setReadOnly(false);                 // Not read only
+    pMaintable->setColumnMovingEnabled(true);
+    pMaintable->setSelectionMode(QTable::MultiRow); // Multi row selection
+    pMaintable->setLeftMargin(0);           // Get rid of the vertical header
+    pMaintable->verticalHeader()->hide();   // by hiding it with a margin of 0
+    pMaintable->horizontalHeader()->setResizeEnabled(false);
+    pMaintable->setColumnStretchable(5, true);
+
+    // Table header row
+    pTablehead = pMaintable->horizontalHeader();
+    pTablehead->setLabel(0, QObject::tr("Date"), 76);
+    pTablehead->setLabel(1, QObject::tr("Begin"));
+    pTablehead->setLabel(2, QObject::tr("End"));
+    pTablehead->setLabel(3, QObject::tr("Amount"), 52);
+    pTablehead->setLabel(4, QObject::tr("Task"), 60);
+    pTablehead->setLabel(5, QObject::tr("Remark"));
+    pTablehead->setMovingEnabled(true);
+
+    // Icon table items
+    pIconimage = new QImage(ossplogo_xpm);
+    pIconpixmap = new QPixmap(pIconimage->scaleHeight(pMaintable->rowHeight(6)));
+    pMaintable->setPixmap(3, 2, *pIconpixmap);
+    pMaintable->setText(3, 2, "OSSP Titraq");
+
+    // Set contents of a generic combobox
+    pComboentries = new QStringList;
+    *pComboentries << "uno" << "dos" << "tres" << "quatro";
+
+    // Make the combobox items for all rows
+    for (int i = 0; i < knRows; ++i) {
+        QComboTableItem *pComboitem = new QComboTableItem(pMaintable, *pComboentries, false);
+        pComboitem->setCurrentItem(i % 4);
+        pMaintable->setItem(i, 4, pComboitem);
+    }
+
+    // Make the checkbox items for all rows
+    for (int j = 0; j < knRows; ++j)
+        pMaintable->setItem(j, 1, new QCheckTableItem(pMaintable, "Checkung"));
+
+    pPackagelayout->addWidget(pMaintable); // Finally add the table widget
+
+    // Bottom output line
+    pStatus = new QLineEdit(this, "pStatus");
+    pStatus->setFrameShape(QLineEdit::LineEditPanel);
+    pStatus->setFrameShadow(QLineEdit::Sunken);
+    pStatus->setFrame(true);
+    pStatus->setReadOnly(true);
+    pPackagelayout->addWidget(pStatus);
     pMainlayout->addLayout(pPackagelayout);
 
-    // Contains all the push button controls
-    pControllayout = new QHBoxLayout(0, 0, 6, "pControllayout"); 
+    // Control layout for push buttons
+    pControllayout = new QHBoxLayout(0, 0, 6, "pControllayout"); // For buttons
 
-    pInstallbutton = new QPushButton(this, "pInstallbutton");
-    pInstallbutton->setCursor(QCursor(13));
-    pInstallbutton->setText(trUtf8("&Install"));
-    pInstallbutton->setFlat(FALSE);
-    pControllayout->addWidget(pInstallbutton);
+    // Tuple push button add
+    pAddbutton = new QPushButton(this, "AddButton");
+    pAddbutton->setCursor(QCursor(13));
+    pAddbutton->setText(trUtf8("&Add"));
+    pControllayout->addWidget(pAddbutton);
 
+    // Tuple push button delete
     pDeletebutton = new QPushButton(this, "pDeletebutton");
     pDeletebutton->setCursor(QCursor(13));
     pDeletebutton->setText(trUtf8("&Delete"));
+    pDeletebutton->setFlat(false);
     pControllayout->addWidget(pDeletebutton);
 
-    pVerifybutton = new QPushButton(this, "VerifyButton");
-    pVerifybutton->setCursor(QCursor(13));
-    pVerifybutton->setText(trUtf8("&Verify"));
-    pControllayout->addWidget(pVerifybutton);
-
-    pCommitbutton = new QPushButton(this, "pCommitbutton");
-    pCommitbutton->setPaletteBackgroundColor(QColor(186, 156, 144));
-    pCommitbutton->setCursor(QCursor(13));
-    pCommitbutton->setText(trUtf8("&Commit"));
-    pControllayout->addWidget(pCommitbutton);
+    // Tuple push button write
+    pWritebutton = new QPushButton(this, "pWritebutton");
+    pWritebutton->setPaletteBackgroundColor(QColor(186, 156, 144));
+    pWritebutton->setCursor(QCursor(13));
+    pWritebutton->setText(trUtf8("&Write"));
+    pControllayout->addWidget(pWritebutton);
     pMainlayout->addLayout(pControllayout);
     pTitraqformlayout->addLayout(pMainlayout);
 
-    init(); // signals and slots connections
+    init(); // Initialize signal and slot connections
 }
 
 //


ossp-pkg/as/as-gui/as_gui.h 1.1 -> 1.2

--- as_gui.h     2002/11/08 12:27:57     1.1
+++ as_gui.h     2002/11/11 21:39:08     1.2
@@ -1,39 +1,54 @@
 #ifndef OPKGFORM_H
 #define OPKGFORM_H
 
-#include <qvariant.h>
 #include <qdialog.h>
-class QVBoxLayout; 
-class QHBoxLayout; 
-class QGridLayout; 
-class QLineEdit;
-class QPushButton;
-class QTable;
+#include <qtable.h>
+#include <qheader.h>
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qstringlist.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qlayout.h>
 
+
+// Main table size
+const int knRows = 18;
+const int knCols = 6;
+
+// Main application form window
 class Titraqform : public QDialog
-{ 
-    Q_OBJECT
+{
+    Q_OBJECT    // Needed for MOC object model generation
 
 public:
     Titraqform(QWidget *pParent = 0, const char *kszName = 0,
-        bool bModal = FALSE, WFlags Flags = 0);
+        bool bModal = false, WFlags Flags = 0);
     ~Titraqform();
 
+    // Table, cells, and entries in package layout
     QTable *pMaintable;
-    QLineEdit *pStatusline;
-    QPushButton *pInstallbutton;
+    QHeader *pTablehead;
+    QImage *pIconimage;
+    QPixmap *pIconpixmap;
+    QStringList *pComboentries;
+
+    // Push buttons in control layout
+    QPushButton *pAddbutton;
     QPushButton *pDeletebutton;
-    QPushButton *pVerifybutton;
-    QPushButton *pCommitbutton;
+    QPushButton *pWritebutton;
+
+    // Line edit for status
+    QLineEdit *pStatus;
 
 protected slots:
-    virtual void init();
+    virtual void init();            // Override init to include custom controls
 
 protected:
-    QVBoxLayout *pTitraqformlayout;
-    QVBoxLayout *pMainlayout;
-    QVBoxLayout *pPackagelayout;
-    QHBoxLayout *pControllayout;
+    QVBoxLayout *pTitraqformlayout; // Main form layout
+    QVBoxLayout *pMainlayout;       // Package and control layouts
+    QVBoxLayout *pPackagelayout;    // Main table control
+    QHBoxLayout *pControllayout;    // Lower control buttons
 };
 
 #endif // OPKGFORM_H


ossp-pkg/as/as-gui/as_main.cpp 1.3 -> 1.4

--- as_main.cpp  2002/11/08 12:21:34     1.3
+++ as_main.cpp  2002/11/11 21:39:08     1.4
@@ -1,51 +1,17 @@
 #include <qapplication.h>
-#include <qtable.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qstringlist.h>
+#include <qcdestyle.h>
 
 #include "titraq.h"
 
-// OSSP logo: static const char *ossplogo_xpm[]
-#include "gfx/ossplogo.xpm"
-
-// Table size
-const int numRows = 10;
-const int numCols = 6;
-
 int main(int argc, char **argv)
 {
-    QApplication App(argc, argv);                       
-
-    QTable table(numRows, numCols);
-
-    QHeader *header = table.horizontalHeader();
-    header->setLabel(0, QObject::tr("Klein"), 40);
-    header->setLabel(1, QObject::tr("Krasse Checkung"));
-    header->setLabel(5, QObject::tr("Combo Buxen"));
-    header->setMovingEnabled(TRUE);
-
-    QImage img(ossplogo_xpm);
-    QPixmap pix = img.scaleHeight(table.rowHeight(3));
-    table.setPixmap(3, 2, pix);
-    table.setText(3, 2, "OSSP");
-
-    QStringList comboEntries;
-    comboEntries << "uno" << "dos" << "tres" << "quatro";
-
-    for (int i = 0; i < numRows; ++i){
-        QComboTableItem * item = new QComboTableItem(&table, comboEntries, FALSE);
-        item->setCurrentItem(i % 4);
-        table.setItem(i, 5, item);
-    }   
-    for (int j = 0; j < numRows; ++j)
-        table.setItem(j, 1, new QCheckTableItem(&table, "Checkung"));
+    QApplication App(argc, argv);
 
-//    Titraqform *pMainform = new Titraqform;
-//    App.setMainWidget(pMainform);
-//    pMainform->show();
+    // The main Titraq application window
+    Titraqform *pMainform = new Titraqform;
+    App.setMainWidget(pMainform);
+    App.setStyle(new QCDEStyle);    // Change style to CDE
+    pMainform->show();              // Finally start the show
 
-    App.setMainWidget(&table);
-    table.show();
     return App.exec();
 }





CVSTrac 2.0.1