/*
@BBoxColors  @P@ICopyright Gold Disk Inc. January, 1992  - modified by Don Cox, Aug. 92, Dec 92

Set the text and fill colors of a number of boxes.
*/
trace n
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
oldcolor = ppm_GetTextColor()

counter = 0
do forever
    box=ppm_ClickOnBox("  Click on boxes to be changed")
    if box=0 then break
    counter=counter+1
    boxes.counter=box
    call ppm_SelectBox(box)
    end

if counter = 0 then exit_msg("No box selected")

colorlist   = ppm_GetColorList()
colorlist   = substr(colorlist, pos('0a'x, colorlist) + 1)

color   =  ppm_SelectFromList("Select Fill Color..", 25, 18, 0, colorlist)
if color = '' then exit_msg("Aborted")
tcolor  =  ppm_SelectFromList("Select Text Color..", 25, 18, 0, colorlist)
if tcolor = '' then exit_msg("Aborted ")

do i = 1 to counter
    box = boxes.i
    call ppm_SetBoxFrameData(box,color, color, ppm_GetLineWeight(),     ppm_GetLinePattern(), 1)
    call ppm_SetBoxFrame(box, 1)
    call ppm_SetBoxTransparent(box, 0)

    if upper(word(ppm_GetBoxInfo(box), 1)) ~= TEXT then iterate i

    call SafeSetEdit.rexx(box)
    call ppm_SelectBoxText()
    call ppm_SetTextColor(tcolor)
    call SafeEndEdit.rexx()
    end

call ppm_SetTextColor(oldcolor)
call ppm_SetWireFrame(0)
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,"Resume")
    call ppm_ClearStatus()
    call ppm_AutoUpdate(1)
    exit
    end
