| 2754 | // the program to draw or do action with a particular chart type. |
| 2755 | |
| 2756 | flag API FRedraw(void) |
| 2757 | { |
| 2758 | // Local variables used in drawing on the screen. |
| 2759 | PAINTSTRUCT ps; |
| 2760 | HDC hdcWin; |
| 2761 | HCURSOR hcurPrev = NULL; |
| 2762 | HBITMAP hbmpOld; |
| 2763 | HFONT hfontOld = NULL; |
| 2764 | char szFile[cchSzDef]; |
| 2765 | int nScrollRow, i; |
| 2766 | flag fSmartText = fFalse, fAnsiColor, fAnsiChar, fSmartHTML = fFalse, |
| 2767 | fInverse; |
| 2768 | |
| 2769 | // Local variables used for copying to the Windows clipboard. |
| 2770 | HFILE hfile; |
| 2771 | LONG lSize, l; |
| 2772 | HGLOBAL hglobal, hmfp; |
| 2773 | byte *hpb; |
| 2774 | METAFILEPICT mfp; |
| 2775 | HMETAFILE hmf; |
| 2776 | int cfid; |
| 2777 | char *pch; |
| 2778 | |
| 2779 | if (us.fSmartSave && (wi.wCmd == cmdSaveText || wi.wCmd == cmdCopyText)) { |
| 2780 | if (!us.fTextHTML) |
| 2781 | fSmartText = fTrue; |
| 2782 | else |
| 2783 | fSmartHTML = fTrue; |
| 2784 | } |
| 2785 | HourglassOn; |
| 2786 | ClearB((pbyte)&ps, sizeof(PAINTSTRUCT)); |
| 2787 | |
| 2788 | wi.fSmoothZoom = fFalse; |
| 2789 | if (wi.hdcPrint != hdcNil) |
| 2790 | wi.hdc = wi.hdcPrint; |
| 2791 | else { |
| 2792 | hdcWin = BeginPaint(wi.hwnd, &ps); |
| 2793 | if (wi.fBuffer) { |
| 2794 | if (gs.fAntialias && wi.nAntialias > 1 && us.fGraphics && |
| 2795 | gs.ft == ftNone) |
| 2796 | wi.fSmoothZoom = fTrue; |
| 2797 | wi.hdc = CreateCompatibleDC(hdcWin); |
| 2798 | if (!wi.fSmoothZoom) { |
| 2799 | wi.hbmp = CreateCompatibleBitmap(hdcWin, wi.xClient, wi.yClient); |
| 2800 | hbmpOld = (HBITMAP)SelectObject(wi.hdc, wi.hbmp); |
| 2801 | if (gs.fJetTrail) |
| 2802 | BitBlt(wi.hdc, 0, 0, wi.xClient, wi.yClient, hdcWin, 0, 0, SRCCOPY); |
| 2803 | } else { |
| 2804 | wi.hbmp = CreateCompatibleBitmap(hdcWin, |
| 2805 | wi.xClient*wi.nAntialias, wi.yClient*wi.nAntialias); |
| 2806 | hbmpOld = (HBITMAP)SelectObject(wi.hdc, wi.hbmp); |
| 2807 | } |
| 2808 | } else |
| 2809 | wi.hdc = hdcWin; |
| 2810 | } |
| 2811 | |
| 2812 | if (us.fGraphics) { |
| 2813 | // Set up a graphics chart. |
no test coverage detected