// ********************************************************************** // Use VpeBase3 // // Version: 1.0 // // Create: // Update: 25/09/1998 - Implemented changes in procedures OpenDoc and // SetupPrinter. (Suggested by Peter Starkner, Nordteam) // 16/09/1998 - Fixed text vertical alignment. // 06/01/1999 - Changed vertical alignment. // 12/05/2000 - Updated to use VPE 3.x and changed name to VpeBase3. // Remove the AuxDoc in the process (uses rendering now). // All 3.x changes by Jakob Kruse. // 07/02/2002 - Compatibility with StarZen's VPE4VDF classes: // Commented out Procedure Vpe_Print (Peter van Mil). // 12/02/2002 - Uncommented Procedure Vpe_Print (Sture). // 27/02/2004 - Renamed procedure Vpe_Print to Vpe_Print_Print // 02/08/2004 - VpeWriteRTF error fixed // *********************************************************************** #IFDEF FORCE_VPE_2 Use VpeBase // #ELSE Use VPE3X Use VPE3X.CFG Use Files.utl // Utilities for handling file related stuff Use WinUser.nui // User_Windows_User_Name function Use FList.nui // A lot of FLIST- procedures and functions #IFDEF VPE_USE_EMBEDDED_PREVIEW Use Embedpre.vw Use ErrorHnd.nui // cErrorHandlerRedirector class and oErrorHandlerQuiet object (No User Interface) #ENDIF #IFDEF glMainClientId# #ELSE Use Macros.utl // Various macros (FOR_EX...) desktop_section Integer glMainClientId# Move 0 to glMainClientId# Procedure Set iGlobal_MainClient_Id Integer obj# Move obj# to glMainClientId# End_Procedure Function iGlobal_MainClient_Id Returns Integer Integer Self# ifnot glMainClientId# Begin Move Self to Self# Move (client_id(Self#)) to glMainClientId# End Function_Return glMainClientId# End_Function end_desktop_section #ENDIF Class cVPE is An Array Procedure construct_object Forward Send construct_object Set delegation_mode to delegate_to_parent Property DWord phDoc Public 0 // Document handle Property String pTitle Public "Preview" Property String pCurFont public "Arial" Property Integer pCurFontSize public 12 Property Integer pCurTopMargin public 200 Property Integer pCurBottomMargin public 200 Property Integer pCurLeftMargin public 200 Property Integer pCurRightMargin public 200 Property String pFont public "Arial" Property Integer pFontSize public 12 Property Integer pLeftMargin public 200 Property Integer pRightMargin public 200 Property Integer pTopMargin public 200 Property Integer pBottomMargin public 200 Property Integer pPageWidth public VPAPER_A4 // VPAPER_LETTER Property Integer pPageLength public 0 Property DWord pOpenOptions public 0 Property Integer pBold public 0 Property Integer pUnderLine public 0 Property Integer pItalics public 0 Property Integer pLandscape public 0 // The property pNewPageOnNextLine is tested and set by the following // three procedure: NewPage, Write and WriteLn. It was introduced to // handle continuos Write/WriteLn across more pages. Property Integer pNewPageOnNextLine public 0 End_Procedure Function sDefaultSetupFileName Returns String Integer lbCreateError liChannel String lsUserName lsFolder Get User_Windows_User_Name to lsUserName Get FLIST_CurrentFileListFolder to lsFolder Get Files_AppendPath lsFolder "VpeSetup" to lsFolder If (SEQ_FileExists(lsFolder)=SEQIT_NONE) Begin Get wvaWin32_CreateDirectory (ToAnsi(lsFolder)) to lbCreateError If lbCreateError Function_Return "c:\vpe3.set" Get SEQ_DirectOutput (Files_AppendPath(lsFolder,"readme.txt")) to liChannel If (liChannel>=0) Begin Writeln Channel liChannel "This folder was created automatically to store setup files for the" Writeln "Virtual Print Engine (VPE)." Writeln "" Writeln "These files contain information about the currently selected printer." Send SEQ_CloseOutput liChannel End End Get Files_AppendPath lsFolder (lsUserName+".set") to lsUserName // overload Function_Return lsUserName End_Function Function Vpe_GetDevice Returns String local DWord hdoc# local Pointer lpDevice local String lsDevice local Integer liGrb Move (Pad("",255)) to lsDevice GetAddress of lsDevice to lpDevice Send OpenDoc Get phDoc to hdoc# Move (VpeGetDevice(hdoc#,lpDevice,255)) to liGrb Send vpe_CloseDoc Function_Return (CString(lsDevice)) End_Function Function IsLandscape Returns DWord Integer rval# Get Vpe_GetPageOrientation to rval# Function_Return (rval# = VORIENTATION_LANDSCAPE) End_Function Procedure vpe_SelectFont String Font# Integer FontSize# DWord hdoc# Get phDoc to hdoc# Move (VpeSetFont(hdoc#,Font#,FontSize#)) to Vpe$ReturnGrb# Set pCurFont to Font# Set pCurFontSize to FontSize# End_Procedure Procedure ExportCurMargins Integer Left# Right# top# bottom# Width# Length# DWord hdoc# Get phDoc to hdoc# Get pPageWidth to Width# Get pPageLength to Length# // If landscape: switch length and width: If (IsLandscape(Self)) Begin Move Width# to Left# // Overload! Move Length# to Width# Move Left# to Length# // End overload! End Get pCurLeftMargin to Left# Get pCurRightMargin to Right# Get pCurTopMargin to Top# Get pCurBottomMargin to Bottom# Move (VpeSet(hdoc#,VLEFTMARGIN, Left#)) to Vpe$ReturnGrb# Move (VpeSet(hdoc#,VRIGHTMARGIN, Width#-Right#)) to Vpe$ReturnGrb# Move (VpeSet(hdoc#,VTOPMARGIN, Top#)) to Vpe$ReturnGrb# Move (VpeSet(hdoc#,VBOTTOMMARGIN,Length#-Bottom#)) to Vpe$ReturnGrb# End_Procedure Procedure SetMargins Integer Left# Integer Right# Integer top# Integer bottom# Set pCurLeftMargin to Left# Set pCurRightMargin to Right# Set pCurTopMargin to Top# Set pCurBottomMargin to Bottom# Send ExportCurMargins End_Procedure Procedure vpe_Set Integer what# Integer val# // Same as SetCoord DWord hdoc# Get phDoc to hdoc# Move (VpeSet(hdoc#,what#,val#)) to Vpe$ReturnGrb# End_Procedure Procedure SetCoord Integer what# Integer val# DWord hdoc# Get phDoc to hdoc# Move (VpeSet(hdoc#,what#,val#)) to Vpe$ReturnGrb# End_Procedure Function GetCoord Integer what# Returns Integer DWord hdoc# Get phDoc to hdoc# Function_Return (VpeGet(hdoc#,what#)) End_Function Function vpe_Get Integer what# Returns Integer // Same as GetCoord DWord hdoc# Get phDoc to hdoc# Function_Return (VpeGet(hdoc#,what#)) End_Function Procedure vpe_OpenDoc Handle parent# String title# DWord flags# DWord hdoc# Integer target# main_client# String bypass# Get VPE_OemToChar title# to title# #IFDEF VPE_USE_EMBEDDED_PREVIEW Get iGlobal_MainClient_Id to main_client# Move "" to bypass# Get_Profile_String "VEJMAN_SETUP" "OLD_PREVIEW" to bypass# If (bypass# = "") Begin Create_Object_Group OG_VpePreview PARENT main_client# (pTitle(Self)) Send ErrorHnd_Quiet_Activate Send Popup to OG_Current_Object# Send ErrorHnd_Quiet_Deactivate Send Make_Invisible to OG_Current_Object# Get Target of OG_Current_Object# to target# Move (VpeOpenDoc(target#,title#,flags# ior VPE_EMBEDDED ior VPE_NO_USER_CLOSE)) to hdoc# Set phDoc of OG_Current_Object# to hdoc# End Else Move (VpeOpenDoc(parent#,title#,flags#)) to hdoc# #ELSE Move (VpeOpenDoc(parent#,title#,flags#)) to hdoc# #ENDIF Move (VpeLicense(hdoc#,VPE_SERIAL_CODE1,VPE_SERIAL_CODE2)) to Vpe$ReturnGrb# Set phDoc to hdoc# If (pLandscape(Self)) Begin Send Vpe_SetDevOrientation VORIENTATION_LANDSCAPE Send Vpe_SetPageOrientation VORIENTATION_LANDSCAPE End End_Procedure Procedure OpenDoc String tmpTitle# String tmpSetupFile# DWord hdoc# String title# SetupFile# Integer Length# width# Integer target# main_client# String bypass# If num_arguments gt 0 Move tmpTitle# to title# Else Get pTitle to title# If num_arguments gt 1 Move tmpSetupFile# to SetupFile# Else Get sDefaultSetupFileName to SetupFile# // "c:\vpe3.set" If (SetupFile# = "") Get sDefaultSetupFileName to SetupFile# // "c:\vpe3.set" Get VPE_OemToChar title# to title# Get pPageWidth to Width# Get pPageLength to Length# If (width# = VPAPER_A4) Begin Move 2100 to Width# Move 2970 to Length# End If (width# = VPAPER_LETTER) Begin Move 2159 to Width# Move 2794 to Length# End Set pPageWidth to Width# Set pPageLength to Length# // width and length are no longer passed as params to opendoc // we might have to set paper size diffently #IFDEF VPE_USE_EMBEDDED_PREVIEW Get iGlobal_MainClient_Id to main_client# Move "" to bypass# Get_Profile_String "VEJMAN_SETUP" "OLD_PREVIEW" to bypass# If (bypass# = "") Begin Create_Object_Group OG_VpePreview PARENT main_client# (pTitle(Self)) Send ErrorHnd_Quiet_Activate Send Popup to OG_Current_Object# Send ErrorHnd_Quiet_Deactivate Send Make_Invisible to OG_Current_Object# Get Target of OG_Current_Object# to target# Move (VpeOpenDoc(target#,title#,pOpenOptions(Self) ior VPE_EMBEDDED ior VPE_NO_USER_CLOSE)) to hdoc# Set phDoc of OG_Current_Object# to hdoc# End Else Move (VpeOpenDoc(0,title#,pOpenOptions(Self))) to hdoc# #ELSE Move (VpeOpenDoc(0,title#,pOpenOptions(Self))) to hdoc# #ENDIF Move (VpeLicense(hdoc#,VPE_SERIAL_CODE1,VPE_SERIAL_CODE2)) to Vpe$ReturnGrb# Move (VpeLicense(hdoc#,PDF_SERIAL_CODE1,PDF_SERIAL_CODE2)) to Vpe$ReturnGrb# Set phDoc to hdoc# If (pLandscape(Self)) Begin Send Vpe_SetDevOrientation VORIENTATION_LANDSCAPE Send Vpe_SetPageOrientation VORIENTATION_LANDSCAPE End Move (VpeSetupPrinter(hdoc#,SetupFile#,PRINTDLG_ONFAIL)) to Vpe$ReturnGrb# If (Vpe$ReturnGrb# = 1) Begin // User pressed cancel Send vpe_CloseDoc End Else Begin Send SetMargins (pLeftMargin(Self)) (pRightMargin(Self)) (pTopMargin(Self)) (pBottomMargin(Self)) Send vpe_SelectFont (pFont(Self)) (pFontSize(Self)) Set pBold to False Set pUnderLine to False Set pItalics to False Set pNewPageOnNextLine to 0 End End_Procedure Procedure vpe_CloseDoc DWord hdoc# Get phDoc to hdoc# Move (VpeCloseDoc(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_PreviewDoc DWord hdoc# String bypass# Get phDoc to hdoc# Move (VpeSetPaperView(hdoc#,1)) to Vpe$ReturnGrb# // Display paper size Move (VpePreviewDoc(hdoc#, VPE_NULL, VPE_SHOW_MAXIMIZED)) to Vpe$ReturnGrb# #IFDEF VPE_USE_EMBEDDED_PREVIEW Move "" to bypass# Get_Profile_String "VEJMAN_SETUP" "OLD_PREVIEW" to bypass# If (bypass# = "") Send Make_Visible to OG_Current_Object# #ENDIF End_Procedure Procedure PreviewDoc DWord hdoc# Get phDoc to hdoc# //JK (2000.04.11): VpeGotoPage replaced with VpeGotoVisualPage //Move (VpeGotoPage(hdoc#,1)) to Vpe$ReturnGrb# Move (VpeGotoVisualPage(hdoc#,1)) to Vpe$ReturnGrb# Send vpe_PreviewDoc End_Procedure //JK (2000.04.11): Updates an open preview when the document has changed // Warning: if the user closes the preview, the document will also be closed, // and DispatchAllMessages will then return true. // At that point you immediately have to end all printing activites or // the program will crash!!! Function DispatchAllMessages Returns Integer DWord hdoc# Integer bClosed Get phDoc to hdoc# Move (VpeDispatchAllMessages(hdoc#)) to bClosed Function_Return bClosed End_Function Procedure vpe_PrintDoc DWord hdoc# Get phDoc to hdoc# Move (VpePrintDoc(hdoc#, VPE_FALSE)) to Vpe$ReturnGrb# End_Procedure Procedure PrintDoc DWord hdoc# Get phDoc to hdoc# Move (VpePrintDoc(hdoc#, VPE_FALSE)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetupPrinter String File# Integer Mode# DWord hdoc# Get phDoc to hdoc# Move (VpeSetupPrinter(hdoc#,File#,Mode#)) to Vpe$ReturnGrb# End_Procedure //JK: Writes current document to specified file Procedure vpe_WriteDoc String File# DWord hdoc# Get phDoc to hdoc# Move (VpeWriteDoc(hdoc#,File#)) to Vpe$ReturnGrb# End_Procedure //JK: Reads specified file into current document Procedure vpe_ReadDoc String File# DWord hdoc# Get phDoc to hdoc# Move (VpeReadDoc(hdoc#,File#)) to Vpe$ReturnGrb# End_Procedure Function iTextHeight.is Integer width# String str# Returns Integer DWord hDoc# Integer rval# Get phDoc to hDoc# Get VPE_OemToChar str# to str# Move (VpeRenderWrite(hDoc#,100,100,(100+width#),VFREE,str#)) to Vpe$ReturnGrb# // Vpe$ReturnGrb# now contains info on whether autobreak occured Move (VpeGet(hDoc#,VRENDERHEIGHT)) to rval# Function_Return rval# End_Function Procedure Vpe_SetDevOrientation Integer orient# DWord hdoc# Get phDoc to hdoc# Move (VpeSetDevOrientation(hdoc#,orient#)) to Vpe$ReturnGrb# End_Procedure Function Vpe_GetDevOrientation Returns Integer DWord hdoc# Get phDoc to hdoc# Function_Return (VpeGetDevOrientation(hdoc#)) End_Function Procedure Vpe_SetPageOrientation Integer orient# DWord hdoc# Get phDoc to hdoc# Move (VpeSetPageOrientation(hdoc#,orient#)) to Vpe$ReturnGrb# End_Procedure Function Vpe_GetPageOrientation Returns Integer DWord hdoc# Get phDoc to hdoc# Function_Return (VpeGetPageOrientation(hdoc#)) End_Function Procedure SetupPrinter String tmpSetupFile# DWord hdoc# String SetupFile# If num_arguments gt 0 Move tmpSetupFile# to SetupFile# Else Get sDefaultSetupFileName to SetupFile# If SetupFile# eq "" Get sDefaultSetupFileName to SetupFile# Send OpenDoc Get phDoc to hdoc# Move (VpeSetupPrinter(hdoc#,SetupFile#,PRINTDLG_ALWAYS)) to Vpe$ReturnGrb# Send vpe_CloseDoc End_Procedure // The procedures Write and WriteLn simulates the good old way of // outputting to the printer. Function AttributeString Returns String Function_Return ("["+If(pBold(Self),"B ","BO ")+If(pUnderLine(Self),"U ","UO ")+If(pItalics(Self),"I ","IO ")+"]") End_Function Function AttributeString.iii Integer lbBold Integer lbItalics Integer lbUnderline Returns String Function_Return ("["+If(lbBold,"B ","BO ")+If(lbUnderline,"U ","UO ")+If(lbItalics,"I","IO")+"]") End_Function // When something has been printed that is known to be one line, this // function will tell you how many more lines may printed on the current // page. In general the function will tell you how many more of the // previous objects may be printed on the current page. Function RemainingLines Returns Integer Integer wy1 wy2 wy3 DWord hdoc# Get phDoc to hdoc# Move (VpeGet(hdoc#,VTOP)) to wy1 Move (VpeGet(hdoc#,VBOTTOM)) to wy2 Move (VpeGet(hdoc#,VBOTTOMMARGIN)) to wy3 If (wy1=wy2) Function_Return 999 // No lines have been written yet Function_Return (wy3-wy2/Number(wy2-wy1)) End_Function Function LinesPerPage Returns Integer Integer wy1 wy2 wy3 wy4 DWord hdoc# Get phDoc to hdoc# Move (VpeGet(hdoc#,VTOP)) to wy1 Move (VpeGet(hdoc#,VBOTTOM)) to wy2 Move (VpeGet(hdoc#,VBOTTOMMARGIN)) to wy3 Move (VpeGet(hdoc#,VTOPMARGIN)) to wy4 If (wy1=wy2) Function_Return 999 // No lines have been written yet Function_Return (wy3-wy4/Number(wy2-wy1)-1) End_Function Function CheckPage Integer Lins# Returns Integer Function_Return (Lins#>RemainingLines(Self)) End_Function Procedure vpe_PageBreak DWord hdoc# Get phDoc to hdoc# Move (VpePageBreak(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure NewPage DWord hdoc# Get phDoc to hdoc# Move (VpePageBreak(hdoc#)) to Vpe$ReturnGrb# Send ExportCurMargins Set pNewPageOnNextLine to 0 End_Procedure Procedure Write String str# DWord hdoc# Get phDoc to hdoc# Get VPE_OemToChar str# to str# If (pNewPageOnNextLine(Self)=2) Send NewPage If (CheckPage(Self,1)) Set pNewPageOnNextLine to 1 If (VpeGet(hdoc#,VBOTTOM)=VpeGet(hdoc#,VTOP)) ; Move (VpePrint(hdoc#,pCurLeftMargin(Self),pCurTopMargin(Self),AttributeString(Self)+str#)) to Vpe$ReturnGrb# //JK: hmm... shouldn't it be VpeGet(VRIGHT) and VpeGet(VTOP) ?!? Else Move (VpePrint(hdoc#,VRIGHT,VTOP,AttributeString(Self)+str#)) to Vpe$ReturnGrb# End_Procedure Procedure Writeln String str# DWord hdoc# Integer VTOP# VBOTTOM# Get phDoc to hdoc# Send Write str# Move (VpeGet(hdoc#,VTOP)) to VTOP# Move (VpeGet(hdoc#,VBOTTOM)) to VBOTTOM# Move (VpeSet(hdoc#,VTOP,VTOP#+VBOTTOM#-VTOP#)) to Vpe$ReturnGrb# // These two lines are not equivalent ??? //Move (VpeSet(hdoc#,VTOP, VBOTTOM# )) To Vpe$ReturnGrb# Move (VpeSet(hdoc#,VBOTTOM,VBOTTOM#+VBOTTOM#-VTOP#)) to Vpe$ReturnGrb# Move (VpeSet(hdoc#,VRIGHT,pCurLeftMargin(Self))) to Vpe$ReturnGrb# If (pNewPageOnNextLine(Self)=1) Set pNewPageOnNextLine to 2 End_Procedure Procedure vpe_Write Integer x1# Integer y1# Integer x2# Integer y2# String str# DWord hdoc# Get phDoc to hdoc# Get VPE_OemToChar str# to str# Move (VpeWrite(hdoc#,x1#,y1#,x2#,y2#,str#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_WriteRTF Integer x1# Integer y1# Integer x2# Integer y2# String str# #IFSAME _VPEDLL_ VPEP32.DLL VPEE32.DLL VPEP3235.DLL VPEE3235.DLL VPEP3236.DLL DWord hdoc# Get phDoc to hdoc# //Get VPE_OemToChar str# To str# Move (VpeWriteRTF(hdoc#,x1#,y1#,x2#,y2#,str#)) to Vpe$ReturnGrb# #ELSE Showln "RTF functions can not be used with this version of VPE!" #ENDIF End_Procedure Procedure GenericWrite Integer x1# Integer y1# Integer x2# Integer y2# String str# Showln "GenericWrite should be vpe_Write" End_Procedure Procedure vpe_Line Integer x1# Integer y1# Integer x2# Integer y2# DWord hdoc# Get phDoc to hdoc# Move (VpeLine(hdoc#,x1#,y1#,x2#,y2#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_HorizontalLineKeepPos Integer tmpleft# Integer tmpright# Integer Left# Right# DWord hdoc# If num_arguments gt 0 Move tmpleft# to Left# Else Move VLEFTMARGIN to Left# If num_arguments gt 1 Move tmpright# to Right# Else Move VRIGHTMARGIN to Right# Get phDoc to hdoc# Move (VpeStorePos(hdoc#)) to Vpe$ReturnGrb# Send vpe_Line Left# VBOTTOM Right# VBOTTOM Move (VpeRestorePos(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure WriteLine Integer tmpleft# Integer tmpright# Integer Left# Right# DWord hdoc# If num_arguments gt 0 Move tmpleft# to Left# Else Move VLEFTMARGIN to Left# If num_arguments gt 1 Move tmpright# to Right# Else Move VRIGHTMARGIN to Right# Get phDoc to hdoc# Move (VpeStorePos(hdoc#)) to Vpe$ReturnGrb# Send vpe_Line Left# VTOP Right# VTOP Move (VpeRestorePos(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_Box Integer x1# Integer y1# Integer x2# Integer y2# DWord hdoc# If (x1# > x2#) Begin // Coordinates MUST be upper left, lower right. Move x1# to hdoc# // Otherwise errors in pre-viewer. Move x2# to x1# Move hdoc# to x2# End If (y1# > y2#) Begin Move y1# to hdoc# Move y2# to y1# Move hdoc# to y2# End Get phDoc to hdoc# Move (VpeBox(hdoc#,x1#,y1#,x2#,y2#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_Ellipse Integer x1# Integer y1# Integer x2# Integer y2# DWord hdoc# Get phDoc to hdoc# Move (VpeEllipse(hdoc#,x1#,y1#,x2#,y2#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetTransparentMode Integer onoff# DWord hdoc# Get phDoc to hdoc# Move (VpeSetTransparentMode(hdoc#,onoff#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetBkgColor Integer color# DWord hdoc# Get phDoc to hdoc# Move (VpeSetBkgColor(hdoc#,color#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetHatchStyle Integer hatch# DWord hdoc# Get phDoc to hdoc# Move (VpeSetHatchStyle(hdoc#,hatch#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetHatchColor Integer color# DWord hdoc# Get phDoc to hdoc# Move (VpeSetHatchColor(hdoc#,color#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_Print_Print Integer x1# Integer y1# String str# DWord hdoc# Get phDoc to hdoc# Get VPE_OemToChar str# to str# Move (VpePrint(hdoc#,x1#,y1#,str#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_PrintBox Integer x1# Integer y1# String str# DWord hdoc# Get phDoc to hdoc# Get VPE_OemToChar str# to str# Move (VpePrintBox(hdoc#,x1#,y1#,str#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_WriteBox Integer x1# Integer y1# Integer x2# Integer y2# String str# DWord hdoc# Get phDoc to hdoc# Get VPE_OemToChar str# to str# Move (VpeWriteBox(hdoc#,x1#,y1#,x2#,y2#,str#)) to Vpe$ReturnGrb# End_Procedure Procedure Vpe_Polygon Integer arrayhandle# Integer Length# DWord hdoc# Get phDoc to hdoc# Move (VpePolygon(hdoc#,arrayhandle#,Length#)) to Vpe$ReturnGrb# End_Procedure Procedure Vpe_Polyline Integer arrayhandle# Integer Length# DWord hdoc# Get phDoc to hdoc# Move (VpePolyline(hdoc#,arrayhandle#,Length#)) to Vpe$ReturnGrb# End_Procedure //External_Function32 VpePolyLine "VpePolyLine" Dword hdoc# Dword array# integer size# returns dword# //// long EXPO VpePolygon(long hDoc, POINT *pt, unsigned int size); //External_Function32 VpePolyLine "VpePolyLine" Dword hdoc# Dword array# integer size# returns dword# Procedure vpe_SetAlign Integer attr# DWord hdoc# Get phDoc to hdoc# Move (VpeSetAlign(hdoc#,attr#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetPen Integer size# Integer style# Integer color# DWord hdoc# Get phDoc to hdoc# Move (VpeSetPen(hdoc#,size#,style#,color#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_Picture Integer x1# Integer y1# Integer x2# Integer y2# String bmpstr# Integer flags# DWord hdoc# String path# Get phDoc to hdoc# //JK - 2000.06.26: // Check if bitmap really exists // If it doesn't, don't try top print it. // If it does, convert to full path/filename. If (Pos(SysConf(SYSCONF_DIR_SEPARATOR),bmpstr#) > 0) Begin // File has path already If (not(SEQ_FileExists(bmpstr#))) Procedure_Return End Else Begin // File has no path, so we search along dfpath Move (SEQ_FindFileAlongDFPath(bmpstr#)) to path# If (path# = "") Procedure_Return Move (path# + SysConf(SYSCONF_DIR_SEPARATOR) + bmpstr#) to bmpstr# End //JK - 2000.06.08: // Dirty hack to always save bitmaps in the generated document Move (flags# ior PIC_IN_FILE) to flags# Move (VpePicture(hdoc#,x1#,y1#,x2#,y2#,bmpstr#,flags#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_PictureKeepPos Integer x1# Integer y1# Integer x2# Integer y2# String bmpstr# Integer flags# DWord hdoc# Get phDoc to hdoc# Move (VpeStorePos(hdoc#)) to Vpe$ReturnGrb# Send vpe_Picture x1# y1# x2# y2# bmpstr# flags# Move (VpeRestorePos(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_StorePos DWord hdoc# Get phDoc to hdoc# Move (VpeStorePos(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_RestorePos DWord hdoc# Get phDoc to hdoc# Move (VpeRestorePos(hdoc#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_DefineHeader Integer x1# Integer y1# Integer x2# Integer y2# String text# DWord hdoc# Get phDoc to hdoc# Move (VpeDefineHeader(hdoc#,x1#,y1#,x2#,y2#,text#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_DefineFooter Integer x1# Integer y1# Integer x2# Integer y2# String text# DWord hdoc# Get phDoc to hdoc# Move (VpeDefineFooter(hdoc#,x1#,y1#,x2#,y2#,text#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetTextColor DWord color# DWord hdoc# Get phDoc to hdoc# Move (VpeSetTextColor(hdoc#,color#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_SetDefOutRectSP Integer Left# Integer top# Integer Right# Integer bottom# DWord hdoc# Get phDoc to hdoc# Move (VpeSetDefOutRectSP(hdoc#,Left#,top#,Right#,bottom#)) to Vpe$ReturnGrb# End_Procedure Function vpe_GetCurrentPage Returns Integer DWord hdoc# Get phDoc to hdoc# Function_Return (VpeGetCurrentPage(hdoc#)) End_Function Procedure vpe_GotoPage Integer page# DWord hdoc# Get phDoc to hdoc# Move (VpeGotoPage(hdoc#,page#)) to Vpe$ReturnGrb# End_Procedure Procedure vpe_Addbookmark Integer parent# String title# DWord hdoc# Get phDoc to hdoc# // Move (VpeAddBookmark(hdoc#,parent#,title#)) to Vpe$ReturnGrb# End_Procedure End_Class // cVPE Integer oVPE# Object oVPE is a cVPE Procedure display_previous_object Showln ("Left/Right/Top/Bottom:"+String(GetCoord(oVPE#,VLeft))*String(GetCoord(oVPE#,VRight))*String(GetCoord(oVPE#,VTop))*String(GetCoord(oVPE#,VBottom))) End_Procedure Procedure display_stuff Showln "****vpe_get*******************************************" Showln ("Text: Left/Right/Top/Bottom:"+String(GetCoord(oVPE#,VLeft))*String(GetCoord(oVPE#,VRight))*String(GetCoord(oVPE#,VTop))*String(GetCoord(oVPE#,VBottom))) Showln ("Marg: Left/Right/Top/Bottom:"+String(GetCoord(oVPE#,VLeftMargin))*String(GetCoord(oVPE#,VRightMargin))*String(GetCoord(oVPE#,VTopMargin))*String(GetCoord(oVPE#,VBottomMargin))) End_Procedure Move Self to oVPE# End_Object #ENDIF