Index: ossp-pkg/as/as-gui/as_gui.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2002/11/13 08:41:09 1.4 +++ as_gui.cpp 2002/11/13 12:38:25 1.5 @@ -1,7 +1,5 @@ // System interface -#include #include -#include #include #include #include @@ -10,17 +8,18 @@ // User interface #include "titraq.h" // Main classes +#include "generic.h" // Generic classes #include "gfx/ossplogo.xpm" // OSSP logo: static const char *ossplogo_xpm[] // Used in initialization of the application -void Titraqform::init() +void Titraqform::init(void) { - pAddbutton->setPaletteBackgroundColor(QColor(196, 196, 176)); - pDeletebutton->setPaletteBackgroundColor(QColor(196, 196, 176)); - pWritebutton->setPaletteBackgroundColor(QColor(196, 196, 176)); - pQuitbutton->setPaletteBackgroundColor(QColor(196, 196, 176)); - pMaintable->setCurrentCell(0, 0); // Set the initial focus - pMaintable->setFocus(); // Focus on the table + m_pAddbutton->setPaletteBackgroundColor(QColor(196, 196, 176)); + m_pDeletebutton->setPaletteBackgroundColor(QColor(196, 196, 176)); + m_pWritebutton->setPaletteBackgroundColor(QColor(196, 196, 176)); + m_pQuitbutton->setPaletteBackgroundColor(QColor(196, 196, 176)); + m_pMaintable->setCurrentCell(0, 0); // Set the initial focus + m_pMaintable->setFocus(); // Focus on the table } // @@ -30,100 +29,101 @@ Titraqform::Titraqform(QWidget *pParent, const char *kszName, WFlags Flags) : QMainWindow(pParent, kszName, Flags) { - if (!kszName) - setName(trUtf8("Titraqform")); + // Initial widget manipulations resize(600, 480); setCaption(trUtf8("OSSP Titraq")); + if (!kszName) + setName(trUtf8("Titraqform")); // Create a central frame and associated layout for QMainWindow - QFrame *pCenframe = new QFrame(this); - this->setCentralWidget(pCenframe); + m_pCenframe = new QFrame(this); + setCentralWidget(m_pCenframe); // Control layouts for form, table, and status line - pTitraqformlayout = new QVBoxLayout(pCenframe, 11, 6, "pTitraqformlayout"); - pMainlayout = new QVBoxLayout(0, 0, 6, "pMainlayout"); // For layouts - pPackagelayout = new QVBoxLayout(0, 0, 6, "pPackagelayout"); // For table + m_pTitraqformlayout = new QVBoxLayout(m_pCenframe, 11, 6, "pTitraqformlayout"); + m_pMainlayout = new QVBoxLayout(0, 0, 6, "pMainlayout"); // For layouts + m_pPackagelayout = new QVBoxLayout(0, 0, 6, "pPackagelayout"); // For table // The table itself - pMaintable = new QTable(this, "pMaintable"); - pMaintable->setNumRows(knRows); - pMaintable->setNumCols(knCols); - pMaintable->setReadOnly(false); // Not read only - pMaintable->setColumnMovingEnabled(true); // Ctrl-drag of headers - 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); + m_pMaintable = new QTable(this, "pMaintable"); + m_pMaintable->setNumRows(g_knRows); + m_pMaintable->setNumCols(g_knCols); + m_pMaintable->setReadOnly(false); // Not read only + m_pMaintable->setColumnMovingEnabled(true); // Ctrl-drag of headers + m_pMaintable->setSelectionMode(QTable::MultiRow); // Multi row selection + m_pMaintable->setLeftMargin(0); // Get rid of the vertical header + m_pMaintable->verticalHeader()->hide(); // by hiding it with a margin of 0 + m_pMaintable->horizontalHeader()->setResizeEnabled(false); + m_pMaintable->setColumnStretchable(5, true); // Table header row - pTablehead = pMaintable->horizontalHeader(); - pTablehead->setLabel(0, QObject::trUtf8("Date"), 96); - pTablehead->setLabel(1, QObject::trUtf8("Begin"), 80); - pTablehead->setLabel(2, QObject::trUtf8("End"), 80); - pTablehead->setLabel(3, QObject::trUtf8("Amount"), 52); - pTablehead->setLabel(4, QObject::trUtf8("Task"), 70); - pTablehead->setLabel(5, QObject::trUtf8("Remark")); - pTablehead->setMovingEnabled(true); + m_pTablehead = m_pMaintable->horizontalHeader(); + m_pTablehead->setLabel(0, QObject::trUtf8("Date"), 96); + m_pTablehead->setLabel(1, QObject::trUtf8("Begin"), 80); + m_pTablehead->setLabel(2, QObject::trUtf8("End"), 80); + m_pTablehead->setLabel(3, QObject::trUtf8("Amount"), 52); + m_pTablehead->setLabel(4, QObject::trUtf8("Task"), 70); + m_pTablehead->setLabel(5, QObject::trUtf8("Remark")); + m_pTablehead->setMovingEnabled(true); // Icon image items - pIconimage = new QImage(ossplogo_xpm); - pIconpixmap = new QPixmap(pIconimage->scaleHeight(pMaintable->rowHeight(6))); - pMaintable->setItem(0, 0, new QTableItem(pMaintable, QTableItem::Never, "OSSP trac")); - pMaintable->setPixmap(0, 0, *pIconpixmap); + m_pIconimage = new QImage(ossplogo_xpm); + m_pIconpixmap = new QPixmap(m_pIconimage->scaleHeight(m_pMaintable->rowHeight(6))); + m_pMaintable->setItem(0, 0, new QTableItem(m_pMaintable, QTableItem::Never, "OSSP trac")); + m_pMaintable->setPixmap(0, 0, *m_pIconpixmap); // // Make a generic table item for all rows // for (int i = 1; i < knRows; ++i) -// pMaintable->setItem(i, 0, new QTableItem(pMaintable, QTableItem::Always, ("Enter"))); +// m_pMaintable->setItem(i, 0, new QTableItem(m_pMaintable, QTableItem::Always, ("Enter"))); // Make the date selector for all rows - for (int i = 1; i < knRows; ++i) { + for (int i = 1; i < g_knRows; ++i) { QDate *pSylvestre = new QDate(2002, 12, 31); - QDateEdit *pDateEdit = new QDateEdit(*pSylvestre, pMaintable, "Date"); - pMaintable->setCellWidget(i, 0, pDateEdit); + QDateEdit *pDateEdit = new QDateEdit(*pSylvestre, m_pMaintable, "Date"); + m_pMaintable->setCellWidget(i, 0, pDateEdit); } // Make the time start selector for all rows - for (int i = 0; i < knRows; ++i) { - QTimeEdit *pStart = new QTimeEdit(QTime::currentTime(), pMaintable, "Start"); - pMaintable->setCellWidget(i, 1, pStart); + for (int i = 0; i < g_knRows; ++i) { + QTimeEdit *pStart = new QTimeEdit(QTime::currentTime(), m_pMaintable, "Start"); + m_pMaintable->setCellWidget(i, 1, pStart); } // Make the time end selector for all rows - for (int i = 0; i < knRows; ++i) { - QTimeEdit *pEnd = new QTimeEdit(QTime::currentTime(), pMaintable, "End"); - pMaintable->setCellWidget(i, 2, pEnd); + for (int i = 0; i < g_knRows; ++i) { + QTimeEdit *pEnd = new QTimeEdit(QTime::currentTime(), m_pMaintable, "End"); + m_pMaintable->setCellWidget(i, 2, pEnd); } // Make the amount selector for all rows - for (int i = 0; i < knRows; ++i) { - QSpinBox *pAmount = new QSpinBox(pMaintable, "Amount"); - pMaintable->setCellWidget(i, 3, pAmount); + for (int i = 0; i < g_knRows; ++i) { + QSpinBox *pAmount = new QSpinBox(m_pMaintable, "Amount"); + m_pMaintable->setCellWidget(i, 3, pAmount); } // Populate the task stringlist - pTaskentries = new QStringList; - *pTaskentries << trUtf8("titraq") << trUtf8("opgui") << trUtf8("email") << trUtf8("admin") << trUtf8("pmod") << trUtf8("psod") << trUtf8("meeting") << trUtf8("training"); + m_pTaskentries = new QStringList; + *m_pTaskentries << trUtf8("titraq") << trUtf8("opgui") << trUtf8("email") << trUtf8("admin") << trUtf8("pmod") << trUtf8("psod") << trUtf8("meeting") << trUtf8("training"); // Make the combobox items for all rows - for (int i = 0; i < knRows; ++i) { - QComboBox *pTasks = new QComboBox(true, pMaintable, "Tasks"); - pTasks->insertStringList(*pTaskentries); + for (int i = 0; i < g_knRows; ++i) { + QComboBox *pTasks = new QComboBox(true, m_pMaintable, "Tasks"); + pTasks->insertStringList(*m_pTaskentries); pTasks->setCurrentText(NULL); pTasks->setAutoCompletion(true); - pMaintable->setCellWidget(i, 4, pTasks); + m_pMaintable->setCellWidget(i, 4, pTasks); } // // Make the listbox for all rows // for (int i = 0; i < knRows; ++i) { -// QListBox *pTasks = new QListBox(pMaintable, "Tasks"); +// QListBox *pTasks = new QListBox(m_pMaintable, "Tasks"); // pTasks->insertStringList(*pTaskentries); // pTasks->setCurrentItem(i % 8); -// pMaintable->setCellWidget(i, 4, pTasks); +// m_pMaintable->setCellWidget(i, 4, pTasks); // } // // Populate a listbox for the task combobox -// QListBox *pListasks = new QListBox(pMaintable); +// QListBox *pListasks = new QListBox(m_pMaintable); // pListasks->insertItem("titraq"); // pListasks->insertItem("opgui"); // pListasks->insertItem("email"); @@ -135,68 +135,70 @@ // // Make the combobox items for all rows // for (int i = 0; i < knRows; ++i) { -// QComboTableItem *pTasks = new QComboTableItem(pMaintable, *pTaskentries, false); +// QComboTableItem *pTasks = new QComboTableItem(m_pMaintable, *m_pTaskentries, false); // pTasks->setCurrentItem(i % 8); -// pMaintable->setItem(i, 4, pTasks); +// m_pMaintable->setItem(i, 4, pTasks); // } - pPackagelayout->addWidget(pMaintable); // Finally add the table widget + m_pPackagelayout->addWidget(m_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); - QToolTip::add(pStatus, trUtf8("Status Line")); - pPackagelayout->addWidget(pStatus); - pMainlayout->addLayout(pPackagelayout); + m_pStatus = new QLineEdit(this, "pStatus"); + m_pStatus->setFrameShape(QLineEdit::LineEditPanel); + m_pStatus->setFrameShadow(QLineEdit::Sunken); + m_pStatus->setFrame(true); + m_pStatus->setReadOnly(true); + QToolTip::add(m_pStatus, trUtf8("Status Line")); + m_pPackagelayout->addWidget(m_pStatus); + m_pMainlayout->addLayout(m_pPackagelayout); // Control layout for push buttons - pControllayout = new QHBoxLayout(0, 0, 6, "pControllayout"); // For buttons + m_pControllayout = new QHBoxLayout(0, 0, 6, "pControllayout"); // For buttons // Tuple push button add - pAddbutton = new QPushButton(this, "AddButton"); - pAddbutton->setCursor(QCursor(13)); - pAddbutton->setText(trUtf8("&Add")); - QToolTip::add(pAddbutton, trUtf8("Add Entry")); - connect(pAddbutton, SIGNAL(clicked()), this, SLOT(addEntry())); - pControllayout->addWidget(pAddbutton); + m_pAddbutton = new QPushButton(this, "AddButton"); + m_pAddbutton->setCursor(QCursor(13)); + m_pAddbutton->setText(trUtf8("&Add")); + QToolTip::add(m_pAddbutton, trUtf8("Add Entry")); + connect(m_pAddbutton, SIGNAL(clicked()), this, SLOT(addEntry())); + m_pControllayout->addWidget(m_pAddbutton); // Tuple push button delete - pDeletebutton = new QPushButton(this, "pDeletebutton"); - pDeletebutton->setCursor(QCursor(13)); - pDeletebutton->setText(trUtf8("&Delete")); - pDeletebutton->setFlat(false); - QToolTip::add(pDeletebutton, trUtf8("Delete Entry")); - connect(pDeletebutton, SIGNAL(clicked()), this, SLOT(delEntry())); - pControllayout->addWidget(pDeletebutton); + m_pDeletebutton = new QPushButton(this, "pDeletebutton"); + m_pDeletebutton->setCursor(QCursor(13)); + m_pDeletebutton->setText(trUtf8("&Delete")); + m_pDeletebutton->setFlat(false); + QToolTip::add(m_pDeletebutton, trUtf8("Delete Entry")); + connect(m_pDeletebutton, SIGNAL(clicked()), this, SLOT(delEntry())); + m_pControllayout->addWidget(m_pDeletebutton); // Tuple push button write - pWritebutton = new QPushButton(this, "pWritebutton"); - pWritebutton->setCursor(QCursor(13)); - pWritebutton->setText(trUtf8("&Write")); - QToolTip::add(pWritebutton, trUtf8("Write Entry")); - connect(pWritebutton, SIGNAL(clicked()), this, SLOT(writeEntry())); - pControllayout->addWidget(pWritebutton); + m_pWritebutton = new QPushButton(this, "pWritebutton"); + m_pWritebutton->setCursor(QCursor(13)); + m_pWritebutton->setText(trUtf8("&Write")); + QToolTip::add(m_pWritebutton, trUtf8("Write Entry")); + connect(m_pWritebutton, SIGNAL(clicked()), this, SLOT(writeEntry())); + m_pControllayout->addWidget(m_pWritebutton); // Tuple push button quit - pQuitbutton = new QPushButton(this, "pQuitbutton"); - pQuitbutton->setCursor(QCursor(13)); - pQuitbutton->setText(trUtf8("&Quit")); - pQuitbutton->setFlat(false); - QToolTip::add(pQuitbutton, trUtf8("Quit")); - connect(pQuitbutton, SIGNAL(clicked()), qApp, SLOT(quit())); - pControllayout->addWidget(pQuitbutton); + m_pQuitbutton = new QPushButton(this, "pQuitbutton"); + m_pQuitbutton->setCursor(QCursor(13)); + m_pQuitbutton->setText(trUtf8("&Quit")); + m_pQuitbutton->setFlat(false); + QToolTip::add(m_pQuitbutton, trUtf8("Quit titraq")); + connect(m_pQuitbutton, SIGNAL(clicked()), qApp, SLOT(quit())); + m_pControllayout->addWidget(m_pQuitbutton); - pMainlayout->addLayout(pControllayout); - pTitraqformlayout->addLayout(pMainlayout); + m_pMainlayout->addLayout(m_pControllayout); + m_pTitraqformlayout->addLayout(m_pMainlayout); init(); // Initialize signal and slot connections } -void Titraqform::addEntry() +void Titraqform::addEntry(void) { + Prototype Unimp; + Unimp.doMbox(); // if (!pTable->text().isEmpty()) { // QTableRow *pRow = new QTableRow; // pRow->setText(0, NULL); @@ -206,18 +208,22 @@ // } } -void Titraqform::delEntry() +void Titraqform::delEntry(void) { + Prototype Unimp; + Unimp.doMbox(); } -void Titraqform::writeEntry() +void Titraqform::writeEntry(void) { + Prototype Unimp; + Unimp.doMbox(); } // // Destroy the object and free any allocated resources // -Titraqform::~Titraqform() +Titraqform::~Titraqform(void) { // Qt deletes child widgets for us } 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.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2002/11/12 19:16:00 1.3 +++ as_gui.h 2002/11/13 12:38:25 1.4 @@ -1,19 +1,18 @@ -#ifndef OPKGFORM_H -#define OPKGFORM_H +#ifndef TITRAQMWIN_H +#define TITRAQMWIN_H +#include #include #include -#include #include -#include #include #include #include // Main table size -const int knRows = 18; -const int knCols = 6; +const int g_knRows = 18; +const int g_knCols = 6; // Main application form window class Titraqform : public QMainWindow @@ -25,34 +24,35 @@ ~Titraqform(); // Table, cells, and entries in package layout - QTable *pMaintable; - QHeader *pTablehead; - QImage *pIconimage; - QPixmap *pIconpixmap; - QStringList *pTaskentries; + QTable *m_pMaintable; + QHeader *m_pTablehead; + QImage *m_pIconimage; + QPixmap *m_pIconpixmap; + QStringList *m_pTaskentries; // Push buttons in control layout - QPushButton *pAddbutton; - QPushButton *pDeletebutton; - QPushButton *pWritebutton; - QPushButton *pQuitbutton; + QPushButton *m_pAddbutton; + QPushButton *m_pDeletebutton; + QPushButton *m_pWritebutton; + QPushButton *m_pQuitbutton; // Line edit for status - QLineEdit *pStatus; + QLineEdit *m_pStatus; protected slots: - virtual void init(); // Override init to include custom controls - void addEntry(); - void delEntry(); - void writeEntry(); + virtual void init(void); // Override init to include custom controls + void addEntry(void); // Add a task entry to the list + void delEntry(void); // Delete a task entry from the list + void writeEntry(void); // Write the task list to a filedescriptor protected: - QVBoxLayout *pTitraqformlayout; // Main form layout - QVBoxLayout *pMainlayout; // Package and control layouts - QVBoxLayout *pPackagelayout; // Main table control - QHBoxLayout *pControllayout; // Lower control buttons + QFrame *m_pCenframe; // Central frame + QVBoxLayout *m_pTitraqformlayout; // Main form layout + QVBoxLayout *m_pMainlayout; // Package and control layouts + QVBoxLayout *m_pPackagelayout; // Main table control + QHBoxLayout *m_pControllayout; // Lower control buttons private: }; -#endif // OPKGFORM_H +#endif // TITRAQMWIN_H Index: ossp-pkg/as/as-gui/as_main.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v' 2>/dev/null --- as_main.cpp 2002/11/11 21:39:08 1.4 +++ as_main.cpp 2002/11/13 12:38:25 1.5 @@ -1,4 +1,3 @@ -#include #include #include "titraq.h"