OSSP CVS Repository

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

ossp-pkg/as/as-gui/as_slot.cpp 1.46 -> 1.47

--- as_slot.cpp  2002/12/10 14:23:58     1.46
+++ as_slot.cpp  2002/12/11 16:00:47     1.47
@@ -34,6 +34,7 @@
 #include <qcombobox.h>
 #include <qregexp.h>
 #include <qclipboard.h>
+#include <qmenudata.h>
 
 // User interface
 #include "as_gui.h"             // Main classes
@@ -395,7 +396,9 @@
 {
     switch (nSection) {
     case TITRAQ_IDXALLCTRLS:
-        m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        m_pStatusedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTATUS) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        m_pLineedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXLINE) - TITRAQ_SPACING);
+        m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING);
         m_pGuidedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXGUID) - TITRAQ_SPACING);
         m_pCrcedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXCRC) - TITRAQ_SPACING);
         m_pRevedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXREV) - TITRAQ_SPACING);
@@ -406,8 +409,14 @@
         m_pTasks->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXTASK) - TITRAQ_SPACING);
 //        m_pRemark->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXREMARK) - TITRAQ_SPACING);
         break;
+    case TITRAQ_IDXSTATUS:
+        m_pStatusedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTATUS) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXLINE:
+        m_pLineedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXLINE) - TITRAQ_SPACING);
+        break;
     case TITRAQ_IDXUSER:
-        m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING);
         break;
     case TITRAQ_IDXGUID:
         m_pGuidedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXGUID) - TITRAQ_SPACING);
@@ -652,8 +661,20 @@
 //
 void Titraqform::showStatcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTATCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXSTATUS);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTATCOL), false);
+        m_pStatusedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXSTATUS);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTATCOL), true);
+        m_pStatusedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXSTATCOL));
 }
 
 //
@@ -661,8 +682,20 @@
 //
 void Titraqform::showLinecol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXLCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXLINE);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXLCOL), false);
+        m_pLineedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXLINE);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXLCOL), true);
+        m_pLineedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXLCOL));
 }
 
 //
@@ -670,8 +703,20 @@
 //
 void Titraqform::showUsercol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXUCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXUSER);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXUCOL), false);
+        m_pUseredit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXUSER);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXUCOL), true);
+        m_pUseredit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXUCOL));
 }
 
 //
@@ -679,8 +724,20 @@
 //
 void Titraqform::showGuidcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXGCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXGUID);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXGCOL), false);
+        m_pGuidedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXGUID);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXGCOL), true);
+        m_pGuidedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXGCOL));
 }
 
 //
@@ -688,8 +745,20 @@
 //
 void Titraqform::showCrccol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXCCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXCRC);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXCCOL), false);
+        m_pCrcedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXCRC);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXCCOL), true);
+        m_pCrcedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXCCOL));
 }
 
 //
@@ -697,8 +766,20 @@
 //
 void Titraqform::showRevcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXREVCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXREV);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXREVCOL), false);
+        m_pRevedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXREV);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXREVCOL), true);
+        m_pRevedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXREVCOL));
 }
 
 //
@@ -706,8 +787,20 @@
 //
 void Titraqform::showDatecol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXDCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXDATE);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXDCOL), false);
+        m_pDateedit->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXDATE);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXDCOL), true);
+        m_pDateedit->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXDCOL));
 }
 
 //
@@ -715,8 +808,20 @@
 //
 void Titraqform::showStartcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXSTART);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL), false);
+        m_pStarttime->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXSTART);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL), true);
+        m_pStarttime->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL));
 }
 
 //
@@ -724,8 +829,20 @@
 //
 void Titraqform::showFinishcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXFCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXFINISH);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXFCOL), false);
+        m_pEndtime->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXFINISH);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXFCOL), true);
+        m_pEndtime->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXFCOL));
 }
 
 //
@@ -733,8 +850,20 @@
 //
 void Titraqform::showAmountcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXACOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXAMOUNT);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXACOL), false);
+        m_pAmount->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXAMOUNT);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXACOL), true);
+        m_pAmount->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXACOL));
 }
 
 //
@@ -742,8 +871,20 @@
 //
 void Titraqform::showTaskcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXTCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXTASK);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXTCOL), false);
+        m_pTasks->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXTASK);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXTCOL), true);
+        m_pTasks->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXTCOL));
 }
 
 //
@@ -751,8 +892,20 @@
 //
 void Titraqform::showRemarkcol(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    // Test if column is currently shown, conditionally show or hide it
+    if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXREMCOL))) {
+        m_pMaintable->hideColumn(TITRAQ_IDXREMARK);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXREMCOL), false);
+        m_pRemark->hide();
+    }
+    else {
+        m_pMaintable->showColumn(TITRAQ_IDXREMARK);
+        m_pColspopup->setItemChecked(m_pColspopup->idAt(TITRAQ_IDXREMCOL), true);
+        m_pRemark->show();
+    }
+
+    // Make sure switch take place right away
+    m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXREMCOL));
 }
 
 //

CVSTrac 2.0.1