Sammenligner filerne vdfgraph.utl og VDFGRAPH.NEW ***** vdfgraph.utl // See GrphPaint procedure for changes (Chris Stammen) // // Tue 15-02-2005 - Added new mechanism for setting background color (and // making sure it is ignored when printed via VPE). // - Updated grdemo.src a bit. // // Tue 15-03-2005 - Changed procedure draw_background (Chris Stammen) // ***** VDFGRAPH.NEW // See GrphPaint procedure for changes (Chris Stammen) // - Added new mechanism for setting background color (and // making sure it is ignored when printed via VPE). (Sture) // - Updated grdemo.src a bit. (Sture // - Changed procedure draw_background (Chris Stammen) // // Mon 29-08-2005 - Fixed a leak in the Compatible DeviceContext cleanup (Chris Stammen) // This leak caused crashes in Win98 systems. (worked fine on >Win2000) // ***** ***** vdfgraph.utl Define SRCCOPY For |CI$00CC0020 //* dest = source */ ***** VDFGRAPH.NEW Define SRCCOPY For |CI$00CC0020 //* dest = source */ External_Function32 GrphCloseHandle "CloseHandle" kernel32.dll Handle hObject Returns Integer ***** ***** vdfgraph.utl Procedure WMSG_GrphEraseBkGnd dWord wParam dWord lParam handle hDC# hPen# hBrush# // This msg is sent if the fErase member of tPAINTSTRUCT is TRUE integer iSize# // during the WM_PAINT/BeginPaint() phase. This will be set Move wParam To hDC# // automatically by Windows, or explicitly by InvalidateRect() with Get guiSize To iSize# // TRUE as its 3rd arg get pBackColor to gr$BackColor Move (GetStockObject(NULL_PEN)) To hPen# // we don't want an outline Move (CreateSolidBrush(gr$BackColor)) To hBrush# Move (SelectObject(hDC#,hPen#)) To gr$Void // select into Device Context Move (SelectObject(hDC#,hBrush#)) To gr$Void // Use a rectangle to draw-over entire window. Note the addition of // one to both X & Y end-points, this is because Windows' Rectangle() // function excludes the end-points in its drawing //Move (Rectangle(hDC#,0,0,Low(iSize#)+1,Hi(iSize#)+1)) To gr$Void // we must delete any GDI objects we create. Note, we don't delete the // hPen object because it is a Windows' StockObject. Move (DeleteObject(hBrush#)) To gr$Void graph_res$showln ("DeleteObject 3 "+string(gr$Void)) move 1 to gr$PenDirty move 1 to gr$BrushDirty set pbNeverBeenPainted to DFTRUE End_Procedure ***** VDFGRAPH.NEW Procedure WMSG_GrphEraseBkGnd dWord wParam dWord lParam End_Procedure ***** ***** vdfgraph.utl move (BeginPaint(hWnd#, lpStruc#)) to gr$hCurrentDC //Double buffered actions: Get GuiSize to cxyValue ***** VDFGRAPH.NEW move (BeginPaint(hWnd#, lpStruc#)) to gr$hCurrentDC //Double buffered actions: Get GuiSize to cxyValue ***** ***** vdfgraph.utl //make a compatible copy for offscreen processing: move (GrphCreateCompatibleDC(hDC#)) to hdcMem# ***** VDFGRAPH.NEW //make a compatible copy for offscreen processing: move (GrphCreateCompatibleDC(hDC#)) to hdcMem# ***** ***** vdfgraph.utl //fill it with nice white space: move (CreateSolidBrush(clWhite)) to hBrush# ***** VDFGRAPH.NEW //fill it with nice white space: move (CreateSolidBrush(clWhite)) to hBrush# ***** ***** vdfgraph.utl move hdcMem# to gr$hCurrentDC // The hDC returned by BeginPaint(), will have its 'Clipping-Region' ***** VDFGRAPH.NEW move hdcMem# to gr$hCurrentDC // The hDC returned by BeginPaint(), will have its 'Clipping-Region' ***** ***** vdfgraph.utl // Delete GDI objects: move (DeleteObject(hbmMem#)) to gr$Void //for offscreen ***** VDFGRAPH.NEW // The following line was missing and caused Win98 systems to crash after a while (leak of hbmOld#) move (SelectObject(hdcMem#,hbmOld#)) to hbmMem# // Delete GDI objects: move (DeleteObject(hbmMem#)) to gr$Void //for offscreen ***** ***** vdfgraph.utl move (ReleaseDC(hWnd#, hDC#)) to gr$Void //for offscreen ***** VDFGRAPH.NEW move (ReleaseDC(hWnd#, hDC#)) to gr$Void //for offscreen move (DeleteObject(hbmOld#)) to gr$Void //new 29.08.05 ***** ***** vdfgraph.utl Procedure Release_All_Content //set pbIncrementalPaint to DFFALSE //handle hDC# //Move (Rectangle(hDC#,0,0,Low(iSize#)+1,Hi(iSize#)+1)) To gr$Void Move 0 to gr$CPU$PC ***** VDFGRAPH.NEW Procedure Release_All_Content Move 0 to gr$CPU$PC *****