Fixes to performance page resizing and font.bmp updated.
authorRobert Dickenson <robd@reactos.org>
Tue, 2 Jul 2002 15:43:04 +0000 (15:43 +0000)
committerRobert Dickenson <robd@reactos.org>
Tue, 2 Jul 2002 15:43:04 +0000 (15:43 +0000)
svn path=/trunk/; revision=3169

rosapps/taskmgr/GraphCtrl.cpp
rosapps/taskmgr/PerformancePage.cpp
rosapps/taskmgr/font.bmp
rosapps/taskmgr/graph.cpp

index d4f217e..4395a71 100644 (file)
@@ -649,6 +649,24 @@ LRESULT CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
        case WM_SYSKEYDOWN:
        case WM_SYSKEYUP:
                return 0;
+
+       case WM_NCCALCSIZE:
+               return 0;
+
+       case WM_SIZE:
+//        pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
+//        if (pGraphCtrl) pGraphCtrl->Resize(wParam, HIWORD(lParam), LOWORD(lParam));
+        if (hWnd == hPerformancePageMemUsageHistoryGraph) {
+            PerformancePageMemUsageHistoryGraph.Resize();
+            PerformancePageMemUsageHistoryGraph.InvalidateCtrl();
+        }
+        if (hWnd == hPerformancePageCpuUsageHistoryGraph) {
+            PerformancePageCpuUsageHistoryGraph.Resize();
+            PerformancePageCpuUsageHistoryGraph.InvalidateCtrl();
+        }
+        return 0;
+        break;
+
        case WM_PAINT:
                hdc = BeginPaint(hWnd, &ps);
 //        pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
@@ -662,31 +680,6 @@ LRESULT CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
         }
                EndPaint(hWnd, &ps);
                return 0;
-/*
-               WindowId = GetWindowLong(hWnd, GWL_ID);
-               switch (WindowId) {
-               case IDC_CPU_USAGE_GRAPH:
-                       Graph_DrawCpuUsageGraph(hdc, hWnd);
-                       break;
-               case IDC_MEM_USAGE_GRAPH:
-                       Graph_DrawMemUsageGraph(hdc, hWnd);
-                       break;
-               case IDC_MEM_USAGE_HISTORY_GRAPH:
-                       Graph_DrawMemUsageHistoryGraph(hdc, hWnd);
-                       break;
-               }
- */
-
-       case WM_SIZE:
-//        pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
-//        if (pGraphCtrl) pGraphCtrl->Resize(wParam, HIWORD(lParam), LOWORD(lParam));
-        if (hWnd == hPerformancePageMemUsageHistoryGraph) {
-            PerformancePageMemUsageHistoryGraph.Resize();
-        }
-        if (hWnd == hPerformancePageCpuUsageHistoryGraph) {
-            PerformancePageCpuUsageHistoryGraph.Resize();
-        }
-               return 0;
        }
        
        //
index 341931d..5ecc285 100644 (file)
@@ -89,6 +89,7 @@ void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference,
 {
     RECT       rc;
        int             cx, cy, sx, sy;
+
     GetClientRect(hCntrl, &rc);
     MapWindowPoints(hCntrl, hDlg, (LPPOINT)(&rc), (sizeof(RECT)/sizeof(POINT)));
     if (pos) {
@@ -102,11 +103,11 @@ void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference,
             cy += nYDifference / 2;
             break;
         case 3:
-            sx += nXDifference / 2;
+            sx += nXDifference;
             break;
         case 4:
             cy += nYDifference / 2;
-            sx += nXDifference / 2;
+            sx += nXDifference;
             break;
         }
         sy = rc.bottom - rc.top + nYDifference / 2;
@@ -214,13 +215,8 @@ LRESULT CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam,
                //
         OldGraphWndProc = SetWindowLong(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
         SetWindowLong(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
-//        SetWindowLong(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
-               
-//             OldGraphCtrlWndProc = SetWindowLong(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
-//             SetWindowLong(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
                OldGraphCtrlWndProc = SetWindowLong(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
                SetWindowLong(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
-
                return TRUE;
 
        case WM_COMMAND:
@@ -228,23 +224,22 @@ LRESULT CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam,
 #if 0
     case WM_NCPAINT:
         hdc = GetDC(hDlg);
-        //GetClientRect(hDlg, &rc);
-        //Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
+        GetClientRect(hDlg, &rc);
+        Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
         ReleaseDC(hDlg, hdc);
         break;
 
     case WM_PAINT:
         hdc = BeginPaint(hDlg, &ps);
-        
-        //GetClientRect(hDlg, &rc);
-        //Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
+        GetClientRect(hDlg, &rc);
+        Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
         EndPaint(hDlg, &ps);
         break;
 #endif
        case WM_SIZE:
                int             cx, cy;
 
-               if (wParam == SIZE_MINIMIZED)
+               if (wParam == SIZE_MINIMIZED)
                        return 0;
 
                cx = LOWORD(lParam);
@@ -253,8 +248,6 @@ LRESULT CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam,
                nYDifference = cy - nPerformancePageHeight;
                nPerformancePageWidth = cx;
                nPerformancePageHeight = cy;
-//             SetWindowPos(hPerformancePageMemUsageHistoryGraph, NULL, 0, 0, cx, cy, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
-//             SetWindowPos(hPerformancePageCpuUsageHistoryGraph, NULL, 0, 0, cx, cy, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
 
                // Reposition the performance page's controls
         AdjustFrameSize(hPerformancePageTotalsFrame, hDlg, 0, nYDifference, 0);
@@ -287,42 +280,39 @@ LRESULT CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam,
         AdjustControlPostion(hPerformancePageTotalsProcessCountEdit, hDlg, 0, nYDifference);
         AdjustControlPostion(hPerformancePageTotalsThreadCountEdit, hDlg, 0, nYDifference);
 
-    static int lastX, lastY;
-
-    nXDifference += lastX; 
-    nYDifference += lastY; 
-    lastX = lastY = 0; 
-    if (nXDifference % 2) {
-        if (nXDifference > 0) {
-            nXDifference--;
-            lastX++;
-        } else {
-            nXDifference++;
-            lastX--;
-        }
-    }
-    if (nYDifference % 2) {
-        if (nYDifference > 0) {
-            nYDifference--;
-            lastY++;
-        } else {
-            nYDifference++;
-            lastY--;
-        }
-    }
+        static int lastX, lastY;
+
+        nXDifference += lastX; 
+        nYDifference += lastY; 
+        lastX = lastY = 0; 
+        if (nXDifference % 2) {
+            if (nXDifference > 0) {
+                nXDifference--;
+                lastX++;
+                       } else {
+                nXDifference++;
+                lastX--;
+                       }
+               }
+        if (nYDifference % 2) {
+            if (nYDifference > 0) {
+                nYDifference--;
+                lastY++;
+                       } else {
+                nYDifference++;
+                lastY--;
+                       }
+               }
         AdjustFrameSize(hPerformancePageCpuUsageFrame, hDlg, nXDifference, nYDifference, 1);
         AdjustFrameSize(hPerformancePageMemUsageFrame, hDlg, nXDifference, nYDifference, 2);
         AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame, hDlg, nXDifference, nYDifference, 3);
         AdjustFrameSize(hPerformancePageMemUsageHistoryFrame, hDlg, nXDifference, nYDifference, 4);
-/*
         AdjustFrameSize(hPerformancePageCpuUsageGraph, hDlg, nXDifference, nYDifference, 1);
         AdjustFrameSize(hPerformancePageMemUsageGraph, hDlg, nXDifference, nYDifference, 2);
-        AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
-        AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
- */
+        AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
+        AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
                break;
        }
-
     return 0;
 }
 
index 7de02b6..c1f8410 100644 (file)
Binary files a/rosapps/taskmgr/font.bmp and b/rosapps/taskmgr/font.bmp differ
index cdd31a4..109f7e1 100644 (file)
@@ -111,6 +111,7 @@ LRESULT CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
        case WM_SYSKEYDOWN:
        case WM_SYSKEYUP:
                        
+       case WM_NCCALCSIZE:
                return 0;
 
        case WM_PAINT: