home *** CD-ROM | disk | FTP | other *** search
- /*
- @BCopyBoxContents @P@ICopyright Gold Disk Inc., Jan, 1993
-
- This Genie will copy the contents of a box into other boxes.
- */
- parse arg source
- address command
- call SafeEndEdit.rexx()
-
- if source = '' then
- do
-
- source = ppm_ClickOnBox("Click on box which has contents to be copied..")
- if source = 0 then exit_msg()
-
- call ppm_SelectBox(source)
-
- counter = 0
-
- do forever
-
- box = ppm_ClickOnBox("Click on boxes to which contents will be copied..")
- if box = 0 then break
-
- call ppm_SelectBox(box)
-
- counter = counter + 1
- boxes.counter = box
-
- end
-
- if counter = 0 then
- exit_msg()
-
- end
- else
- do
-
- if list = '' then exit_msg("Invalid Input")
-
- do counter = 1 to words(list)
-
- boxes.counter = word(list, counter)
-
- end
-
- end
-
- call ppm_AutoUpdate(0)
-
- info = ppm_GetBoxInfo(source)
- fword = upper(word(info, 1))
-
- dellist = ''
-
- if fword = "TEXT" then
- do
- copyfunc = "CopyText"
- text = ppm_GetArticleText(source, 1)
-
- end
- else if fword = "EMPTY" then copyfunc = "DelContents"
- else if fword = "STRUCTURED" | fword = "CLIP" then
- do
- copyfunc = "CopyAll"
- end
- else if fword = "BITMAP" then
- do
- copyfunc = "CopyBitMap"
- bitmapfile = substr(info, wordindex(info, 5))
- end
- else if fword = "EPSF" then
- do
- copyfunc = "CopyEPSF"
- epsfile = substr(info, wordindex(info, 3))
- end
-
- call ppm_ShowStatus("Working..")
-
- do i = 1 to counter
-
- interpret "call "copyfunc"(source, boxes.i)"
-
- end
-
- do while dellist ~= ''
-
- parse var dellist box ';' dellist
-
- if box ~= '' then call ppm_DeleteBox(box)
-
- end
-
- exit_msg()
-
- CopyText: procedure expose text
- do
- parse arg source, dest
-
- call ppm_DeleteContents(dest)
- call ppm_TextIntoBox(dest, text)
- return
-
- end
-
- DelContents: procedure
- do
- parse arg source, dest
- call ppm_DeleteContents(dest)
- return
- end
-
- CopyEPSF: procedure expose epsfile
- do
- parse arg source, dest
-
- call ppm_DeleteContents(dest)
- call ppm_ImportEPSF(dest, epsfile)
- return
- end
-
- CopyBitMap: procedure expose bitmapfile
- do
- parse arg source, dest
-
- call ppm_DeleteContents(dest)
- call ppm_ImportBM(dest, bitmapfile)
- return
- end
-
-
- CopyAll: procedure expose dellist
- do
- parse arg source, dest
-
- dpos = ppm_GetBoxPosition(dest)
- dsize = ppm_GetBoxSize(dest)
- ddata = ppm_GetBoxFrameData(dest)
- dframe = ppm_GetBoxFrame(dest)
- dboxoff = ppm_GetBoxOffset(dest)
- dangle = ppm_GetBoxAngle(dest)
- dimperm = ppm_GetBoxTextWrap(dest)
- dlock = ppm_GetBoxLock(dest)
- dhide = ppm_GetBoxHide(dest)
- dtrans = ppm_GetBoxTransparent(dest)
- dsoff = ppm_GetBoxStandOff(dest)
- dmargs = ppm_GetBoxMargins(dest)
-
- left = word(dpos, 1)
- top = word(dpos, 2)
-
- newbox = ppm_CloneBox(source, 0, 0)
-
- call ppm_SetBoxSize(newbox, word(dsize, 1), word(dsize, 2))
- call ppm_SetBoxAngle(newbox, dangle)
- call ppm_SetBoxPosition(newbox, left, top)
- call ppm_SetBoxTextWrap(newbox, word(dimperm, 1), word(dimperm, 2))
- call ppm_SetBoxLock(newbox, dlock)
- call ppm_SetBoxHide(newbox, dhide)
- call ppm_SetBoxTransparent(newbox, dtrans)
- call ppm_SetBoxFrame(newbox, dframe)
- interpret "call ppm_SetBoxFrameData(newbox, "separate(ddata)")"
- interpret "call ppm_SetBoxOffset(newbox, "separate(dboxoff)")"
- interpret "call ppm_SetBoxStandOff(newbox, "separate(dsoff)")"
- interpret "call ppm_SetBoxMargins(newbox, "separate(dmargs)")"
-
- dellist = dellist';'dest
- return
- end
-
- separate: procedure
- do
- parse arg string
-
- output = ''
-
- cr = pos('0a'x, string)
-
- if cr ~= 0 then
- do
-
- do while string ~= ''
-
- parse var string val '0a'x string
- output = output||val","
- end
- output = delstr(output, length(output))
- end
- else
- do
- wrds = words(string)
-
- do i = 1 to wrds - 1
-
- output = output||word(string, i)", "
-
- end
-
- output = output || word(string, wrds)
-
- end
-
- return(output)
-
- end
-
-
- exit_msg: procedure
- do
- parse arg message
-
- if message ~= '' then call ppm_Inform(1,message,)
- call ppm_ClearStatus()
- call ppm_AutoUpdate(1)
- exit
- end
-
-