home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
fish
/
911-930
/
ff925
/
donsgenies
/
frenchgenies.lha
/
Rexx
/
AligneBoîtesGrille.pprx
< prev
next >
Wrap
Text File
|
1993-08-03
|
3KB
|
119 lines
/*
@BAligneBoîtesGrille @P @I Ecrit et © par Don Cox Août 1992
@IN'est pas du Domaine Publique. Tous Droits Réservés.
Traduit par Fabien Larini le 22/07/93.
Ce Génie aligne les coins des boîtes sur le points de la grille.
*/
/*BoxesToGrid*/
/* This Genie snaps the corners of the boxes to the nearest grid point.
Written by Don Cox Aug 92 Copyright but freely usable for non-commercial purposes */
/*trace r*/
signal on error
signal on syntax
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
cr="0a"x
cpage = ppm_CurrentPage()
counter=0
choice = ppm_Inform(2,"Quelle(s) Boîte(s) ?","Toutes Celles de la Page","Sélection de la (des) Boîte(s)")
select
when choice = 1 then do
do forever
box=ppm_ClickOnBox("Clickez sur les Boîtes à Repositionner")
if box=0 then break
counter=counter+1
boxes.counter=box
call ppm_SelectBox(box)
end
end
when choice = 0 then do
boxes.1 = ppm_PageFirstBox()
box = boxes.1
totalboxes = ppm_NumBoxes(cpage)
counter = totalboxes
do i=2 to totalboxes
box = ppm_PageNextBox(box)
boxes.i = box
end
end
otherwise exit_msg()
end
if counter=0 then exit_msg("Pas de Boîte Sélectoinnée")
currentunits=ppm_GetUnits()
call ppm_SetUnits(2)
gridsize = ppm_GetGridSize()
spacingY = word(gridsize,2)
spacingX = word(gridsize,1)
call ppm_ShowStatus("Arrangement des Boîtes ...")
do i=1 to counter
box=boxes.i
Ypos = word(ppm_GetBoxPosition(box),2)
Xpos = word(ppm_GetBoxPosition(box),1)
oddbit = Ypos//spacingY
if oddbit<= spacingY/2 then Ypos = Ypos-oddbit
else Ypos = Ypos+spacingY-oddbit
oddbit = Xpos//spacingX
if oddbit<= spacingX/2 then Xpos = Xpos-oddbit
else Xpos = Xpos+spacingX-oddbit
call ppm_SetBoxPosition(box,Xpos,Ypos)
width = word(ppm_GetBoxSize(box),1)
height = word(ppm_GetBoxSize(box),2)
oddbit = height//spacingY
if oddbit<= spacingY/2 then newheight = height-oddbit
else newheight = height+spacingY-oddbit
oddbit = width//spacingX
if oddbit<= spacingX/2 then newwidth = width-oddbit
else newwidth = width+spacingX-oddbit
call ppm_SetBoxSize(box,newwidth,newheight)
info = ppm_GetBoxInfo(box)
boxtype = word(info,1)
if upper(boxtype) = "CLIP" | upper(boxtype) = "VECTORISÉ" then do
scales = ppm_GetBoxScale(box)
Xscale = word(scales,1)
Yscale = word(scales,2)
call ppm_SetBoxScale(box, Xscale*(newwidth/width), Yscale*(newheight/height))
end
end
call ppm_SetUnits(currentunits)
call exit_msg()
end
error:
syntax:
do
call exit_msg("Arrêté par l'Utilisateur")
end
exit_msg:
do
parse arg message
if message ~= "" then
call ppm_Inform(1,message,)
call ppm_ClearStatus()
call ppm_AutoUpdate(1)
exit
end