X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwevalgraph.c;h=3f1f07644849c018370fed2316b85a2567b857ef;hb=HEAD;hp=ee71b609e81a53d0c335db4e4536c80dbdda79c0;hpb=c37d45adc7d98a702a7459ccdc0ac23df01a476e;p=xboard.git diff --git a/winboard/wevalgraph.c b/winboard/wevalgraph.c index ee71b60..3f1f076 100644 --- a/winboard/wevalgraph.c +++ b/winboard/wevalgraph.c @@ -5,7 +5,8 @@ * * Copyright 2005 Alessandro Scotti * - * Enhancements Copyright 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + * Enhancements Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, + * 2016 Free Software Foundation, Inc. * * ------------------------------------------------------------------------ * @@ -51,7 +52,7 @@ static COLORREF crBlack = RGB( 0xAD, 0x5D, 0x3D ); static HDC hdcPB = NULL; static HBITMAP hbmPB = NULL; -static HPEN pens[6]; // [HGM] put all pens in one array +static HPEN pens[PEN_ANY+1]; // [HGM] put all pens in one array static HBRUSH hbrHist[3] = { NULL, NULL, NULL }; Boolean EvalGraphIsUp() @@ -156,7 +157,7 @@ static VOID DisplayEvalGraph( HWND hWnd, HDC hDC ) // back-end painting; calls back front-end primitives for lines, rectangles and text PaintEvalGraph(); - SetWindowText(hWnd, MakeEvalTitle(T_("Evaluation Graph"))); + SetWindowText(hWnd, MakeEvalTitle(differentialView ? T_("Blunder Graph") : T_("Evaluation Graph"))); /* Copy bitmap into destination DC */ BitBlt( hDC, 0, 0, nWidthPB, nHeightPB, hdcPB, 0, 0, SRCCOPY ); @@ -208,7 +209,14 @@ LRESULT CALLBACK EvalGraphProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM l EndPaint( hDlg, &stPS ); break; + case WM_MOUSEWHEEL: + if((short)HIWORD(wParam) < 0) appData.zoom++; + if((short)HIWORD(wParam) > 0 && appData.zoom > 1) appData.zoom--; + goto paint; + case WM_RBUTTONDOWN: + differentialView = !differentialView; case WM_REFRESH_GRAPH: + paint: hDC = GetDC( hDlg ); DisplayEvalGraph( hDlg, hDC ); ReleaseDC( hDlg, hDC );