OSSP CVS Repository

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

Check-in Number: 3856
Date: 2002-Dec-11 18:15:35 (local)
2002-Dec-11 17:15:35 (UTC)
User:ms
Branch:
Comment: Fix bottom control layout by detecting first viewable column and adjusting control size accordingly.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_gui.h      1.46 -> 1.47     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.47 -> 1.48     88 inserted, 25 deleted

ossp-pkg/as/as-gui/as_gui.h 1.46 -> 1.47

--- as_gui.h     2002/12/11 16:00:47     1.46
+++ as_gui.h     2002/12/11 17:15:35     1.47
@@ -84,6 +84,7 @@
     void setDirty(bool bDirty = true) {m_bDirt = bDirty;};  // Clean or dirty
     const QString getRowdata(void) const;                   // Get a whole row of data
     void setRowdata(QString &) const;                       // Set a whole row of data
+    const int getFirstcol(void) const;                      // Learn which col is first
 
     // Top level members
     Preferences *m_pPrefs;


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