home *** CD-ROM | disk | FTP | other *** search
- /*
- @N
-
- This Genie will copy the attributes of one object to of a selection of objects.
-
- */
- msg = PDSetup.rexx(2,0)
- units = getclip(pds_units)
- if msg ~= 1 then exit_msg(msg)
-
- signal on error
- signal on syntax
-
- cr = '0a'x
-
- commands.1 = "Position"
- commands.2 = "Size"
- commands.3 = "_Line Color"
- commands.4 = "_Line Pattern"
- commands.5 = "_Fill Pattern"
- commands.6 = "Line Weight"
- commands.7 = "_Line Join"
- commands.8 = "Lock"
-
- prompt = ''
-
- do i = 1 to 7
- prompt = prompt || cr || commands.i
- if left(commands.i,1) = '_' then commands.i = substr(commands.i,2)
- end
-
- prompt = substr(prompt, 2)
-
- obj = pdm_SelFirstobj()
- if obj = 0 then exit_msg("Please Select the objects whose attributes are to be changed, before executing this genie.")
-
- source = pdm_ClickOnObj("Click on object to copy attributes from..")
- if source = 0 then exit_msg()
-
- response = pdm_SelectFromList("Select attributes to copy..",30,7,1,prompt)
- if response = '' then exit_msg()
-
- do while response ~= ''
- parse var response command '0a'x response
- if command = commands.1 then do
- p = pdm_GetObjPosn(source)
- x = word(p,1)
- y = word(p,2)
- o = pdm_selfirstobj()
- do while o ~= 0
- call pdm_SetObjPosn(o,x,y)
- o = pdm_selnextobj(o)
- end
- end
- else if command = commands.2 then do
- p = pdm_GetObjVisSize(source)
- x = word(p,1)
- y = word(p,2)
- o = pdm_selfirstobj()
- do while o ~= 0
- call pdm_SetObjVisSize(o,x,y)
- o = pdm_selnextobj(o)
- end
- end
- else if command = commands.3 then do
- p = pdm_GetLineColor(source)
- p = pdm_SetLineColor(,p)
- end
- else if command = commands.4 then do
- p = pdm_GetLinePattern(source)
- p = pdm_SetLinePattern(,word(p,1),subword(p,2))
- end
- else if command = commands.5 then do
- p = pdm_GetFillPattern(source)
- parse var p ty '0a'x c1 '0a'x c2 '0a'x st '0a'x an '0a'x cx '0a'x cy
- p = pdm_SetFillPattern(,ty,c1,c2,st,an,cx,cy)
- end
- else if command = commands.6 then do
- p = pdm_GetLineWeight(source)
- p = pdm_SetLineWeight(,p)
- end
- else if command = commands.7 then do
- p = pdm_GetLineJoin(source)
- call pdm_SetLineJoin(,p)
- end
- else if command = commands.8 then do
- p = pdm_islocked(source)
- p = pdm_SetObjLock(,p)
- end
- end
-
- call exit_msg()
-
-
-
- error:
- syntax:
- do
- exit_msg("Genie failed due to error: "errortext(rc))
- end
-
- exit_msg: procedure expose units
- do
- parse arg message
-
- if message ~= '' then
- call pdm_Inform(1, message,)
-
- call pdm_ClearStatus()
- call pdm_SetUnits(units)
- call pdm_AutoUpdate(1)
- exit
- end
-