home *** CD-ROM | disk | FTP | other *** search
- /*
- @BGroupMove @P@ICopyright Gold Disk Inc., February, 1992
-
- This Genie will move a group by a specified amount or to a specified position. You may use a negative or positive offset to current values.
- Example: Left Pos 1 - .5
- Top Pos 1 + 1
-
- This would offset the current group by -.5 inches horizontally and 1 inch vertically
-
- */
- parse arg sx, sy
- signal on error
- signal on syntax
-
- address command
- call SafeEndEdit.rexx()
- cr = '0a'x
- 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
-
-
- box = ppm_GroupFirstBox()
- if box = 0 then exit_msg("Select a group of boxes first")
-
- grppos = ppm_GetGroupRect()
- grpleft = word(grppos, 1)
- grptop = word(grppos, 2)
-
- if sx = '' then do
-
- if units = 3 then
- form = "Left Pos:" || ppm_ConvertUnits(1, 3, grpleft) || cr"Top Pos:" || ppm_ConvertUnits(1, 3, grptop)
- else
- form = "Left Pos:"grpleft||cr"Top Pos:"grptop
-
- form = ppm_GetForm("Enter coordinates", 12, form)
- if form = '' then exit_msg()
-
- parse var form sx '0a'x sy
-
- end
-
- interpret "sx ="sx
- interpret "sy ="sy
-
- if ~(datatype(sx, n) & datatype(sy, n)) then exit_msg("Invalid Entry")
-
- if units = 3 then
- do
- sx = ppm_ConvertUnits(3, 1, sx)
- sy = ppm_ConvertUnits(3, 1, sy)
- end
-
-
- do while box ~= 0
-
- boxpos = ppm_GetBoxPosition(box)
- boxsize = ppm_GetBoxSize(box)
- left = word(boxpos, 1)
- top = word(boxpos, 2)
-
-
- newboxleft = sx + left - grpleft
- newboxtop = sy + top - grptop
-
- call ppm_SetBoxPosition(box, newboxleft, newboxtop)
- box = ppm_GroupNextBox(box)
-
- end
-
- 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,)
-
- call ppm_AutoUpdate(1)
-
- if units = 3 then call ppm_SetUnits(3)
- exit
- end
-
-
- error:
- syntax:
- do
- call exit_msg("Invalid Entry")