X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwevalgraph.c;h=3f1f07644849c018370fed2316b85a2567b857ef;hb=HEAD;hp=e438916e546f3bc36b9cc195b3bdcd8cc99e3b63;hpb=cb4cfa8ca5e717cb2c3d14988b6fc05e31bc1837;p=xboard.git diff --git a/winboard/wevalgraph.c b/winboard/wevalgraph.c index e438916..3f1f076 100644 --- a/winboard/wevalgraph.c +++ b/winboard/wevalgraph.c @@ -5,6 +5,9 @@ * * Copyright 2005 Alessandro Scotti * + * Enhancements Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, + * 2016 Free Software Foundation, Inc. + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -49,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() @@ -58,7 +61,7 @@ Boolean EvalGraphIsUp() } // [HGM] front-end, added as wrapper to avoid use of LineTo and MoveToEx in other routines (so they can be back-end) -void DrawSegment( int x, int y, int *lastX, int *lastY, enum PEN penType ) +void DrawSegment( int x, int y, int *lastX, int *lastY, int penType ) { POINT stPt; if(penType == PEN_NONE) MoveToEx( hdcPB, x, y, &stPt ); else { @@ -154,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 ); @@ -206,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 );