home *** CD-ROM | disk | FTP | other *** search
- /* This Genie sets up a grid to match the size of a box, with snap enabled.
- Written by Don Cox © August 92 Revised Feb 93. Not public domain but freely usable for non-commercial purposes. */
-
-
- signal on error
- signal on syntax
- address command
- call SafeEndEdit.rexx()
- call ppm_AutoUpdate(0)
- cr="0a"x
-
- currentunits = ppm_GetUnits()
- box = ppm_ClickOnBox(" Click on box for grid size.")
- if box = 0 then exit_msg("No box selected")
- gsize = ppm_GetGridSize()
- gwidth = word(gsize,1)
- gheight = word(gsize,2)
- call ppm_SaveText("ram:gridsize",gsize)
- size = ppm_GetBoxSize(box)
- width = word(size,1)
- height = word(size,2)
- choice = ppm_Inform(3,"Set Grid size to match box...","Width","Height","Both")
- select
- when choice = 0 then call ppm_SetGridSize(width,gheight)
- when choice = 1 then call ppm_SetGridSize(gwidth,height)
- otherwise call ppm_SetGridSize(width,height)
- end
-
-
- call ppm_SetGrid(1)
-
- call ppm_SetGridSnap(1)
-
- call exit_msg()
-
- end
-
- error:
- syntax:
- do
- exit_msg("Genie failed due to error: "errortext(rc))
- end
-
- exit_msg:
- do
- parse arg message
- if message ~= "" then
- call ppm_Inform(1,message)
- call ppm_ClearStatus()
- call ppm_AutoUpdate(1)
- exit
- end
-
-