Fix multi-leg promotions
[xboard.git] / winboard / wevalgraph.c
index ee71b60..3f1f076 100644 (file)
@@ -5,7 +5,8 @@
  *\r
  * Copyright 2005 Alessandro Scotti\r
  *\r
- * Enhancements Copyright 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.\r
+ * Enhancements Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015,\r
+ * 2016 Free Software Foundation, Inc.\r
  *\r
  * ------------------------------------------------------------------------\r
  *\r
@@ -51,7 +52,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 +157,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 +209,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