home *** CD-ROM | disk | FTP | other *** search
Wrap
/* @BGroupSpace @P@ICopyright Gold Disk Inc., February, 1992 This Genie will reposition all the boxes in the current group. Boxes will be spaced out by a user-specified distance. Distance can be set between left, right, top, or bottom edges, box centers, or boxes. */ cr = '0a'x address command call SafeEndEdit.rexx() call ppm_AutoUpdate(0) units = ppm_GetUnits() if units = 3 then call ppm_SetUnits(1) signal on halt signal on break_c signal on break_e signal on break_d group = ppm_GroupFirstBox() if group = 0 then exit_msg("Please select a group first") hspacing = "Left"cr"Right"cr"Centers"cr"Boxes"cr"None" vspacing = "Top"cr"Bottom"cr"Centers"cr"Boxes"cr"None" hspacing = ppm_SelectFromList("Horizontal Spacing..", 15, 5, 0, hspacing) if hspacing = '' then exit_msg() vspacing = ppm_SelectFromList("Vertical Spacing..", 15, 5, 0, vspacing) if vspacing = '' then exit_msg() vdist = 0 hdist = 0 if hspacing ~= "None" then do string = hspacing if hspacing="Left" | hspacing="Right" then do string = hspacing" edges" end hdist = ppm_GetForm( "Enter Horizontal Spacing", 8, "Between "string) if hdist = '' then exit_msg() if ~datatype(hdist, n) then call exit_msg('Invalid Input') if units = 3 then hdist = ppm_ConvertUnits(3, 1, hdist) end if vspacing ~= "None" then do string = vspacing if vspacing="Top" | vspacing="Bottom" then do string = vspacing" edges" end vdist = ppm_GetForm( "Enter Vertical Spacing", 8, "Between "string) if vdist = '' then exit_msg() if ~datatype(vdist, n) then call exit_msg('Invalid Input') if units = 3 then vdist = ppm_ConvertUnits(3, 1, vdist) end grouprect = ppm_GetGroupRect() groupleft = word(grouprect, 1) grouptop = word(grouprect, 2) hspace = "hpos = hpos + hdist" vspace = "vpos = vpos + vdist" vpos = grouptop hpos = groupleft if vspacing = "Top" then vstring = "vpos" else if vspacing = "Bottom" then vstring = "vpos - height" else if vspacing = "Centers" then vstring = "vpos - .5 * height" else if vspacing = "Boxes" then do vstring = "vpos" vspace = "vpos = vpos + height + vdist" end else do vstring = "top" vspace = "/**/" end if hspacing = "Left" then hstring = "hpos" else if hspacing = "Right" then hstring = "hpos - width" else if hspacing = "Centers" then hstring = "hpos - .5 * width" else if hspacing = "Boxes" then do hstring = "hpos" hspace = "hpos = hpos + width + hdist" end else do hstring = "left" hspace = "/**/" end box = ppm_GroupFirstBox() do while box ~= 0 boxpos = ppm_GetBoxRect(box) left = word(boxpos, 1) top = word(boxpos, 2) width = word(boxpos, 3) height = word(boxpos, 4) interpret "x = "hstring interpret "y = "vstring call ppm_SetBoxPosition(box, x, y) interpret hspace interpret vspace box = ppm_GroupNextBox(box) end call exit_msg() break_d: break_e: break_c: halt: call exit_msg("User aborted Genie!") exit_msg: procedure expose units do parse arg message if message ~= '' then call ppm_Inform( 1, message, ) if units = 3 then call ppm_SetUnits(3) call ppm_AutoUpdate(1) exit end