home *** CD-ROM | disk | FTP | other *** search
- /*
- @BGroupAttr @P@ICopyright Gold Disk Inc. February, 1992
-
- This Genie will change the attributes of all boxes in a group.
-
- */
- signal on error
- signal on syntax
-
- pageopts = "OODDEEVENAALL"
- cr = '0a'x
- counter = 0
-
- address command
- call SafeEndEdit.rexx()
- box = ppm_GroupFirstBox()
- if box = 0 then exit_msg("Select a group first!")
-
- call ppm_AutoUpdate(0)
-
- commands.1 = "Position"
- commands.1.1 = "left:"cr"top:"
- commands.1.2 = "verifynumbers"
- commands.2 = "Angle"
- commands.2.1 = "Angle:"
- commands.2.2 = "verifynumbers"
- commands.3 = "Margins"
- commands.3.1 = "left:"cr"top:"cr"right:"cr"bottom:"
- commands.3.2 = "verifynumbers"
- commands.4 = "Standoff"
- commands.4.1 = "Standoff:"
- commands.4.2 = "verifynumbers"
- commands.5 = "Size"
- commands.5.1 = "width:"cr"height:"
- commands.5.2 = "verifynumbers"
- commands.6 = "Offset"
- commands.6.1 = "X offset:"cr"Y offset:"
- commands.6.2 = "verifynumbers"
- commands.7 = "Lock"
- commands.7.1 = "Enter Yes or No"
- commands.7.2 = "yntonumbers"
- commands.8 = "TextWrap"
- commands.8.1 = "Enter Type:"cr"Side:"
- commands.8.2 = "verifynumbers"
- commands.9 = "Hide"
- commands.9.1 = "Enter Yes or No"
- commands.9.2 = "yntonumbers"
- commands.10 = "Frame"
- commands.10.1 = "Enter Yes or No"
- commands.10.2 = "yntonumbers"
- commands.11 = "Transparent"
- commands.11.1 = "Enter Yes or No"
- commands.11.2 = "yntonumbers"
- commands.12 = "FrameData"
- commands.12.1 = "Line Color:"cr"Fill Color:"cr"Line Weight:"cr"Line Pattern:"cr"Fill Pattern:"
- commands.12.2 = ""
- commands.13 = "Tabs"
- commands.13.1 = "Tabs:"
- commands.13.2 = "verifytabs"
- commands.14 = "Scale"
- commands.14.1 = "X Scale:"cr"Y Scale:"
- commands.14.2 = "verifynumbers"
-
- command = ''
-
- do i = 1 to 14
-
- command = command||commands.i||cr
-
- end
-
- command = left(command, length(command) - 1)
-
- commands = ppm_SelectFromList("Select command to apply to boxes..",30,5,1,command)
- if commands = '' then exit_msg()
-
- com = 0
-
- do while commands ~= ''
-
- com = com + 1
- parse var commands command.com '0a'x commands
-
- do i = 1 to 14
- if command.com = commands.i then leave
- end
-
- if pos(':', commands.i.1) ~= 0 then
- do
- interpret "settings = ppm_GetBox"command.com"(box)"
- commands.i.1 = stuffsettings(settings, commands.i.1)
- end
-
- args.com = ppm_GetForm("Enter Values for "command.com, min(length(commands.i.1), 40), commands.i.1)
- if args.com = '' then exit_msg()
-
- if command.com = "Tabs" then
- args.com = verifytabs(args.com)
- else
- args.com = separate(args.com, commands.i.2)
-
- end
-
-
- do while box ~= 0
-
- do c = 1 to com
- interpret "call ppm_SetBox"command.c"(box,"args.c")"
- end
- box = ppm_GroupNextBox(box)
-
- end
-
- call exit_msg()
-
- error:
- syntax:
- do
- exit_msg("Genie failed due to error: "errortext(rc)||'0a'x||"Line "SIGL)
- end
-
- exit_msg:
- do
- parse arg message
-
- if message ~= '' then
- call ppm_Inform(1, message,)
-
- call ppm_ClearStatus()
- call ppm_AutoUpdate(1)
- exit
- end
-
- separate:
- do
- parse arg string, vfunction
-
- output = ''
-
- do forever
-
- parse var string item '0a'x string
-
- if vfunction ~= '' then
- interpret "item = "vfunction"("item")"
-
- item = "'"item"'"
-
- if string = '' then
- return(output||item)
- else
- output = output||item","
- end
- end
-
- verifynumbers: procedure
- do
- parse arg number
-
- if ~datatype(number, n) then exit_msg("Invalid input")
- return(number)
-
- end
-
-
- yntonumbers: procedure
- do
- parse arg type
-
- type = upper(type)
-
- if left(type, 1) = "Y" then return(1)
- if left(type, 1) = "N" then return(0)
- call exit_msg("Invalid Entry")
- end
-
- verifytabs: procedure
- do
- parse arg tabs
-
- output = ''
-
- tabs = strip(tabs)
-
- do 16
-
- parse var tabs tab ' ' tabs
-
- if tab = '' then tab = 0
- if ~datatype(tab, n) then exit_msg("Invalid Entry")
-
- output = output" "tab
-
- tabs = strip(tabs)
-
- end
-
- return('"'output'"')
- end
-
- stuffsettings: procedure
- do
- parse arg settings, prompt
-
- output = ''
- counter = 1
- colon = pos(':', prompt)
- cr = pos('0a'x, settings)
-
- if cr ~= 0 then
- do
- do while colon ~= 0
-
- parse var settings default '0a'x settings
-
- prompt = insert(default, prompt, colon)
- colon = pos(':', prompt, colon + 1)
-
- end
-
- return(prompt)
-
- end
-
-
-
- do while colon ~= 0
-
- prompt = insert(word(settings, counter), prompt, colon)
- counter = counter + 1
-
- colon = pos(':', prompt, colon + 1)
- end
-
- prompt = prompt" " || subword(settings, counter)
-
- return(prompt)
-
- end
-