home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Boxes Front to Back Select boxes by name or number and rearrange them from front to back in order. Useful in complex layouts where there are several boxes on top of each other. You will be given a list of boxes, and asked to double-click on the names in order from front to back. You can click on Cancel at any time to finish the process. Written by Don Cox © Aug 92 Debug + Mods by Fabien Larini, Aug.93 */ signal on error signal on syntax call ppm_AutoUpdate(0) cr = "0a"x trace n address command call SafeEndEdit.rexx() call ppm_ShowStatus("Making List of Boxes ...") thispage = ppm_CurrentPage() totalboxes = ppm_NumBoxes(thispage) list = "" numberlist = "" box = ppm_PageFirstBox(thispage) do i = 1 to totalboxes number = right(ppm_BoxNum(box),3," ") numberlist = numberlist" "number 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" "boxname||cr box = ppm_PageNextBox(box) end call ppm_ClearStatus() form = "" series = "" box = ppm_SelectFromList("Double-click front box",34,18,0,list) if box = "" then exit_msg("Abandon Genie") series = series||" "||word(box,1) form = box||":1"||"0a"x do i = 2 to totalboxes box = ppm_SelectFromList("Double-click next box",34,18,0,list) if box = "" then break series = series||" "||word(box,1) form = form||box":"||i||"0a"x end form = delstr(form,length(form),1) /* line added by F. Larini */ accept = ppm_GetForm("Is this OK?",3,form) if accept = "" then exit_msg("Aborted by user ") newnumbers = numberlist numselected = words(series) do i=1 to numselected this = word(series,i) do w = 1 to words(numberlist) that = word(numberlist,w) chars = length(that) pad = left("XXXXXX",chars) pad = " "pad" " position = wordindex(newnumbers,w)+(chars-1) /* changed Aug. 93 */ if this = that then do newnumbers = insert(pad,newnumbers,position) newnumbers = delword(newnumbers,w,1) leave w end end end newnumbers = compress(newnumbers,"X") series = series||" "||newnumbers /* stick the unselected boxes on the end of the list */ do until series = "" parse var series box series call ppm_BoxToBack(box) end 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,"Resume") call ppm_ClearStatus() call ppm_AutoUpdate(1) exit end