home *** CD-ROM | disk | FTP | other *** search
- /* Box to Front
- Select a box by name or number and bring it to the front. Useful in complex layouts where there are several boxes on top of each other.
- Written by Don Cox */
-
- trace n
- signal on error
- signal on syntax
- call ppm_AutoUpdate(0)
- cr = "0a"x
-
- address command
- call SafeEndEdit.rexx()
-
- call ppm_ShowStatus("Making List of Boxes ...")
- thispage = ppm_CurrentPage()
- totalboxes = ppm_NumBoxes(thispage)
- list = ""
- box = ppm_PageFirstBox(thispage)
- do i = 1 to totalboxes
- number = right(ppm_BoxNum(box),4," ")
- info = ppm_GetBoxInfo(box)
- boxtype = word(info,1)
- boxname = ppm_GetBoxName(box)
- select
- when upper(boxtype) = "TEXT" then do
- boxtext = ppm_GetBoxText(box,0)
- shorttext = substr(boxtext,1,15)
- if boxname = "" then boxname = shorttext
- end
- when upper(boxtype) = "BITMAP" then do
- filename = word(info,5)
- filename = substr(filename, lastpos("/",filename)+1)
- if boxname = "" then boxname = filename
- end
- when upper(boxtype) = "EPSF" then do
- filename = word(info,3)
- filename = substr(filename, lastpos("/",filename)+1)
- if boxname = "" then boxname = filename
- end
- when upper(boxtype) = "CLIP" then do
- objects = "Clip, "||word(info,2)||" objects"
- if boxname = "" then boxname = objects
- end
- when upper(boxtype) = "STRUCTURED" then do
- objects = "Struct., "||word(info,2)||" objects"
- if word(info,2)=1 then objects = "Struct., 1 object"
- if boxname = "" then boxname = objects
- end
- when upper(boxtype) = "EMPTY" then do
- if boxname = "" then boxname = "Empty"
- end
- otherwise boxname = "Unknown type of box"
- end
- boxtype = substr(boxtype,1,1)
- list = list||number" "boxtype" "boxname||cr
- box = ppm_PageNextBox(box)
- end
-
- call ppm_ClearStatus()
- chosen = ppm_SelectFromList("Select Box...",35,18,0,list)
- box = ppm_SelectBox(word(chosen,1))
- call ppm_BoxToFront(box)
- exit_msg()
-
- 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
-