/* Envelope.pgen Copyright Gold Disk Inc. January, 1992 */ cr = '0a'x call SafeEndEdit.rexx() units = getclip(ppgenie_units) if units = 1 then esize = "9 x 4 inches"cr"Custom"cr"9.5 x 4.125 inches"cr"8 x 3.875 inches"cr"12 x 9 inches" else if units = 2 then esize = "22.05 x 9.8 CM"cr"Custom"cr"23.275 x 10.2 CM"cr"19.6 x 9.5 CM"cr"29.4 x 22.05 CM" else esize = "54 x 24 Pica"cr"Custom"cr"57 x 24.9 Pica"cr"48 x 23.3 Pica"cr"72 x 54 Pica" esize = ppm_SelectFromList("Enter size of Envelope", 30, 6, 0, esize) if esize = '' then exit_msg() page = ppm_CreatePage(ppm_CurrentPage() + 1, 1, 0, 0, 0) call ppm_SetMagMode(50) if esize = "Custom" then do size = ppm_GetForm("Enter envelope dimensions", 8, "Width"cr"Height") if size = '' then exit_msg() parse var size width '0a'x height if datatype(width ) ~= 'NUM' | datatype(height) ~= 'NUM' then exit_msg("Invalid entry") end else do width = word(esize, 1) height = word(esize, 3) end call ppm_SetUnits(1) width = ppm_ConvertUnits(units, 1, width) height = ppm_ConvertUnits(units, 1, height) call ppm_SetPageSize(page, width, height) call ppm_UpdateScreen() tfacelist = ppm_GetTypeFaceList() tfacelist = substr(tfacelist, pos('0a'x, tfacelist) + 1) auto = ppm_Inform(2,"Would you like to have your company name and address inserted automatically?", "No", "Yes") if auto = 1 then do string = getclip(ppuser_name) if name = '' then leave posn = ppm_GetClickPosition("Click at position to place return address") box = ppm_CreateBox(word(posn, 1), word(posn, 2), 2, 2,0,) string = string||cr||getclip(ppuser_company)||cr||getclip(ppuser_address) string = string||cr||getclip(ppuser_city)", "getclip(ppuser_state) string = string||cr||getclip(ppuser_country)", "getclip(ppuser_zipcode) call SafeSetEdit.rexx(box) call ppm_SelectBoxText() call ppm_InsertText(string) size = ppm_GetSize() call ppm_SelectAllText() font = ppm_SelectFromList("Select font for return address..", 30, 8, 0, tfacelist) if font ~= '' then call ppm_SetFont(font) do forever call ppm_SelectAllText() size = ppm_GetForm("Enter point size of return address..", 8, "Size:"size) if size = '' | ~datatype(size,n) then leave call ppm_SetSize(size) call ppm_SelectAllText() if ~ppm_TextOverFlow() then leave end call SafeEndEdit.rexx() end addleft = width / 4 addtop = height / 2 addressee = ppm_CreateBox(addleft, addtop, width / 2, height / 2,0,) exit_msg() exit_msg: procedure expose units do arg message if message ~= '' then call ppm_Inform(1,message,) call ppm_SetUnits(units) call ppm_AutoUpdate(1) exit end