Control Eval Graph with mouse
[xboard.git] / winboard / wevalgraph.c
index ee71b60..ca04343 100644 (file)
@@ -51,7 +51,7 @@ static COLORREF crBlack = RGB( 0xAD, 0x5D, 0x3D );
 \r
 static HDC hdcPB = NULL;\r
 static HBITMAP hbmPB = NULL;\r
-static HPEN pens[6]; // [HGM] put all pens in one array\r
+static HPEN pens[PEN_ANY+1]; // [HGM] put all pens in one array\r
 static HBRUSH hbrHist[3] = { NULL, NULL, NULL };\r
 \r
 Boolean EvalGraphIsUp()\r
@@ -156,7 +156,7 @@ static VOID DisplayEvalGraph( HWND hWnd, HDC hDC )
 \r
     // back-end painting; calls back front-end primitives for lines, rectangles and text\r
     PaintEvalGraph();\r
-    SetWindowText(hWnd, MakeEvalTitle(T_("Evaluation Graph")));\r
+    SetWindowText(hWnd, MakeEvalTitle(differentialView ? T_("Blunder Graph") : T_("Evaluation Graph")));\r
 \r
     /* Copy bitmap into destination DC */\r
     BitBlt( hDC, 0, 0, nWidthPB, nHeightPB, hdcPB, 0, 0, SRCCOPY );\r
@@ -208,7 +208,14 @@ LRESULT CALLBACK EvalGraphProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM l
         EndPaint( hDlg, &stPS );\r
         break;\r
 \r
+    case WM_MOUSEWHEEL:\r
+        if((short)HIWORD(wParam) < 0) appData.zoom++;\r
+        if((short)HIWORD(wParam) > 0 && appData.zoom > 1)  appData.zoom--;\r
+        goto paint;\r
+    case WM_RBUTTONDOWN:\r
+        differentialView = !differentialView;\r
     case WM_REFRESH_GRAPH:\r
+    paint:\r
         hDC = GetDC( hDlg );\r
         DisplayEvalGraph( hDlg, hDC );\r
         ReleaseDC( hDlg, hDC );\r