OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_assist.cpp versions 1.32 and 1.33
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_assist.cpp 1.32 -> 1.33

--- as_assist.cpp        2002/11/27 18:40:15     1.32
+++ as_assist.cpp        2002/11/27 22:44:48     1.33
@@ -272,7 +272,7 @@
     m_pTbarspopup->setItemChecked(nMenuid, true);
     nMenuid = m_pTbarspopup->insertItem(trUtf8("&Edit"), this, SLOT(showEditbar()));
     m_pTbarspopup->setItemChecked(nMenuid, true);
-    nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats this"), this, SLOT(showWhatsbar()));
+    nMenuid = m_pTbarspopup->insertItem(trUtf8("&Whats"), this, SLOT(showWhatsbar()));
     m_pTbarspopup->setItemChecked(nMenuid, true);
     m_pViewpopup->insertSeparator();
     m_pViewpopup->insertItem(trUtf8("&Columns"), m_pColspopup);
@@ -366,10 +366,10 @@
     setCentralWidget(m_pCenframe);
 
     // Layout controls for table, editing widgets
-    m_pMainlayout = new QVBoxLayout(m_pCenframe, 10, 6, "Mainlayout");  // For layouts
-    m_pPackagelayout = new QVBoxLayout(0, 0, 6, "Packagelayout");       // For table
-    m_pDatelayout = new QHBoxLayout(0, 0, 6, "Datelayout");             // For dates
-    m_pTasklayout = new QHBoxLayout(0, 0, 6, "Tasklayout");             // For tasks
+    m_pMainlayout = new QVBoxLayout(m_pCenframe, TITRAQ_MARGIN, TITRAQ_SPACING, "Mainlayout");  // For layouts
+    m_pPackagelayout = new QVBoxLayout(0, 0, TITRAQ_SPACING, "Packagelayout");  // For table
+    m_pDatelayout = new QHBoxLayout(0, 0, TITRAQ_SPACING, "Datelayout");        // For dates
+    m_pTasklayout = new QHBoxLayout(0, 0, TITRAQ_SPACING, "Tasklayout");        // For tasks
 
     // Major sanity check wrapped in one call
     if (!(m_pMainlayout && m_pPackagelayout && m_pDatelayout && m_pTasklayout))
@@ -403,12 +403,14 @@
     m_pMaintable->setNumCols(g_knCols);
     m_pMaintable->setReadOnly(true);                    // Table is read only
     m_pMaintable->setColumnMovingEnabled(false);        // Ctrl-drag disabled
-    m_pMaintable->setSelectionMode(QTable::SingleRow);  // Multi row selection
+    m_pMaintable->setSelectionMode(QTable::MultiRow);   // Multi row selection
     m_pMaintable->setCurrentCell(-1, 0);                // Initial row value -1
     m_pMaintable->setFocusStyle(QTable::FollowStyle);   // How cells are drawn
     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(true);
+    m_pMaintable->horizontalHeader()->setClickEnabled(true); // No click signals
+    m_pMaintable->horizontalHeader()->setTracking(false); // No continuous tracking
     m_pMaintable->setColumnStretchable(g_knCols - 1, true);
     m_pMaintable->setSorting(false);
 
@@ -427,6 +429,7 @@
     // Table update signals
     connect(m_pMaintable, SIGNAL(currentChanged(int, int)), this, SLOT(updEdit(int, int)));
     connect(m_pMaintable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), this, SLOT(inplaceEdit(int, int, int, const QPoint&)));
+    connect(m_pMaintable->horizontalHeader(), SIGNAL(sizeChange(int, int, int)), this, SLOT(updSizes(int, int, int)));
 //    connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(tableChanged(int, int)));
 }
 
@@ -435,6 +438,9 @@
 //
 void Titraqform::setupEditlay(void)
 {
+//    QSpacerItem Pad(TITRAQ_SPACING / 2, 0, QSizePolicy::Fixed);
+//    m_pDatelayout->addWidget(&Pad); // Padd left side of control layout
+
     // Make the date selector
     m_pDateedit = new QDateEdit(m_pCenframe, "Date");
     m_pDatezero = new QDate(m_pDateedit->date());                   // Hack to store empty date
@@ -505,10 +511,12 @@
                             "value with the arrow buttons.";
     QWhatsThis::add(m_pAmount, kszAmount);
 
-    // Populate the stringlist with fresh tasks
+    // Construct a stringlist just to hold task values
     m_pTaskentries = new QStringList;
     if (m_pTaskentries == NULL) // Sanity check
         throw Genexcept("Main window task entries creation failed.");
+
+    // Populate the stringlist with fresh tasks
     *m_pTaskentries << trUtf8("titraq")         << trUtf8("opgui")
                     << trUtf8("email")          << trUtf8("admin")
                     << trUtf8("pmod")           << trUtf8("psod")
@@ -527,17 +535,16 @@
     m_pTasks->setCurrentText(NULL);
     m_pTasks->setAutoCompletion(true);
 
-    // Fix the minimum width, and add an auto scroll bar to it
-    if (m_pTasks->listBox()) {  // Motif style has no list box
+    // Add an auto scroll bar if possible under current GUI style
+    if (m_pTasks->listBox())    // Motif style has no list box
         m_pTasks->listBox()->setHScrollBarMode(QScrollView::Auto);
-        m_pTasks->setMinimumWidth(m_pTasks->listBox()->maxItemWidth());
-    }
+//        m_pTasks->setMinimumWidth(m_pTasks->listBox()->maxItemWidth());
 
     // Whatsthis info for the remark line
     const char *kszTasktext = "Choose a <em>task account</em> by clicking on "
                               "this box, and choosing whichever item most "
                               "closely resembles your task.";
-    m_pTasklayout->addWidget(m_pTasks); // Finally add the task edit
+    m_pDatelayout->addWidget(m_pTasks); // Finally add the task edit
 
     // Make the Remark line
     m_pRemark = new QLineEdit(m_pCenframe, "Remark");
@@ -549,7 +556,7 @@
     m_pRemark->setFrame(true);
     m_pRemark->setReadOnly(false);
     QToolTip::add(m_pRemark, trUtf8("Remark Line"));
-    m_pTasklayout->addWidget(m_pRemark);    // Finally add the remark line
+    m_pDatelayout->addWidget(m_pRemark);    // Finally add the remark line
 
     // Whatsthis info for the remark line
     const char *kszRemarktext = "Edit the <em>task remarks</em> by clicking on "
@@ -557,21 +564,8 @@
                                 "have about the task.";
     QWhatsThis::add(m_pRemark, kszRemarktext);
 
-    // Tuple push button confirm
-    m_pConfirmbutton = new QPushButton(m_pCenframe, "Confirmbutton");
-    if (m_pConfirmbutton == NULL)   // Sanity check
-        throw Genexcept("Main window confirm button creation failed.");
-    m_pConfirmbutton->setCursor(QCursor(13));
-    m_pConfirmbutton->setPaletteBackgroundColor(QColor(206, 192, 176));
-    m_pConfirmbutton->setText(trUtf8("&Confirm"));
-    QToolTip::add(m_pConfirmbutton, trUtf8("Confirm Editing"));
-    connect(m_pConfirmbutton, SIGNAL(clicked()), this, SLOT(confirmEdit()));
-    m_pTasklayout->addWidget(m_pConfirmbutton); // Finally add the confirm button
-
-    // Whatsthis info for the confirm button
-    const char *kszConfirmtext = "Confirm any <em>row edition</em> by "
-                                 "finally clicking on this button.";
-    QWhatsThis::add(m_pConfirmbutton, kszConfirmtext);
+    // Start edit controls off at right size
+    this->updSizes(TITRAQ_IDXALLCTRLS, -1, -1);
 
 //    // Signals
 //    connect(m_pDateedit, SIGNAL(valueChanged(const QDate &date)), this, SLOT(updateDate()));

CVSTrac 2.0.1