OSSP CVS Repository

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

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

--- as_slot.cpp  2002/12/11 16:00:47     1.47
+++ as_slot.cpp  2002/12/11 17:15:35     1.48
@@ -396,21 +396,33 @@
 {
     switch (nSection) {
     case TITRAQ_IDXALLCTRLS:
-        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);
-        m_pDateedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXDATE) - TITRAQ_SPACING);
-        m_pStarttime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTART) - TITRAQ_SPACING);
-        m_pEndtime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXFINISH) - TITRAQ_SPACING);
-        m_pAmount->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXAMOUNT) - TITRAQ_SPACING);
-        m_pTasks->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXTASK) - TITRAQ_SPACING);
-//        m_pRemark->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXREMARK) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTATCOL)))
+            m_pStatusedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTATUS) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXLCOL)))
+            m_pLineedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXLINE) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXUCOL)))
+            m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXGCOL)))
+            m_pGuidedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXGUID) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXCCOL)))
+            m_pCrcedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXCRC) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXREVCOL)))
+            m_pRevedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXREV) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXDCOL)))
+            m_pDateedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXDATE) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL)))
+            m_pStarttime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTART) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXFCOL)))
+            m_pEndtime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXFINISH) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXACOL)))
+            m_pAmount->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXAMOUNT) - TITRAQ_SPACING);
+        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXTCOL)))
+            m_pTasks->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXTASK) - TITRAQ_SPACING);
+//        if (m_pColspopup->isItemChecked(m_pColspopup->idAt(TITRAQ_IDXRCOL)))
+//            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);
+        m_pStatusedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTATUS) - TITRAQ_SPACING);
         break;
     case TITRAQ_IDXLINE:
         m_pLineedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXLINE) - TITRAQ_SPACING);
@@ -449,6 +461,45 @@
         throw Genexcept("Unrecognized main window column header.");
         break;
     }
+
+    // As a last and redundant step, adjust size of first visible control
+    switch(this->getFirstcol()) {
+    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 + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXUSER:
+        m_pUseredit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXUSER) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXGUID:
+        m_pGuidedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXGUID) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXCRC:
+        m_pCrcedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXCRC) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXREV:
+        m_pRevedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXREV) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXDATE:
+        m_pDateedit->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXDATE) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXSTART:
+        m_pStarttime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXSTART) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXFINISH:
+        m_pEndtime->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXFINISH) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXAMOUNT:
+        m_pAmount->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXAMOUNT) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    case TITRAQ_IDXTASK:
+        m_pTasks->setFixedWidth(m_pMaintable->horizontalHeader()->sectionSize(TITRAQ_IDXTASK) - TITRAQ_SPACING + TITRAQ_SPACING / 2);
+        break;
+    default:    // Probably no columns are visible?
+        break;
+    }
 }
 
 //
@@ -673,8 +724,9 @@
         m_pStatusedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXSTATCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -694,8 +746,9 @@
         m_pLineedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXLCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -715,7 +768,8 @@
         m_pUseredit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXUCOL));
 }
 
@@ -736,8 +790,9 @@
         m_pGuidedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXGCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -757,8 +812,9 @@
         m_pCrcedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXCCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -778,8 +834,9 @@
         m_pRevedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXREVCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -799,8 +856,9 @@
         m_pDateedit->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXDCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -820,8 +878,9 @@
         m_pStarttime->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXSTARTCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -841,8 +900,9 @@
         m_pEndtime->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXFCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -862,8 +922,9 @@
         m_pAmount->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXACOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -883,8 +944,9 @@
         m_pTasks->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXTCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //
@@ -904,8 +966,9 @@
         m_pRemark->show();
     }
 
-    // Make sure switch take place right away
+    // Make sure switch take place right away and sizes are handled
     m_pColspopup->updateItem(m_pColspopup->idAt(TITRAQ_IDXREMCOL));
+    this->updSizes(TITRAQ_IDXALLCTRLS, 0, 0); // Update size of this and next
 }
 
 //

CVSTrac 2.0.1