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
/
PagesAutomatiques.pprx
< prev
next >
Wrap
Text File
|
1993-08-03
|
3KB
|
101 lines
/*
@BPagesAutomatiques @P @I Ecrit et © par Don Cox juillet 1993
@IN'est pas du Domaine Publique. Tous Droits Réservés.
Traduit par Fabien Larini le 29/07/93.
Ce Génie crée le nombre nécessaire de pages pour pouvoir faire rentrer
un texte qui est trop grand pour sa boîte. Il est conçu pour être utilisé
pour des mises en page simples. Il sous remplis plutôt que de faire
déborder. Il rajoute une boîte contenant le numéro de page en bas de la
page.
*/
/* This Genie will make the necessary number of new pages to accommodate an
article which is currently overflowing its box. It is intended for use with
simple essays and the like, not complex layouts. I have set the genie to
underflow rather than overflow.
Written by Don Cox July 93 Not Public Domain. All rights reserved. */
trace n
signal on error
signal on syntax
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
fsize = ppm_GetSize()
cr="0a"x
currentunits=ppm_GetUnits()
call ppm_SetUnits(2)
cpage = ppm_CurrentPage()
psize = ppm_GetPageSize(cpage)
pagewidth = word(psize,1)
pageheight = word(psize,2)
numberbox = ppm_CreateBox(pagewidth-6,pageheight-2,3,1,0,)
call ppm_SetSize(12)
overflow = ppm_TextIntoBox(numberbox,"Page \#<Pc0>")
box=ppm_ClickOnBox("Clickez dans la boîte contenant le texte")
if box=0 then exit_msg("Pas de Boîte Sélectionnée")
call ppm_SelectBox(box)
call ppm_ShowStatus("Ajustement du Texte ...")
boxtype = upper(word(ppm_GetBoxInfo(box), 1))
if boxtype~="TEXTE" then exit_msg("Cette Boîte ne Contient pas de Texte")
howbig = ppm_GetBoxSize(box)
boxwidth = word(howbig,1)
boxheight = word(howbig,2)
where = ppm_GetBoxPosition(box)
boxX = word(where,1)
boxY = word(where,2)
tilt = ppm_GetBoxAngle(box)
thispage = cpage
do 100 /* 100 pages is enough for most purposes - you can always run the genie again */
call ppm_ShowStatus("Ajustement du Texte ... " )
/* Create a new page without adding a blank page at end of document */
newpage = ppm_CreatePage(thispage,1,1,0,0)
newpage = ppm_MovePage(newpage+1,newpage)
thispage = ppm_GoToPage(newpage+1)
newbox = ppm_CreateBox(boxX, boxY, boxwidth, boxheight, tilt, )
call ppm_BoxChangePage(newbox,thispage)
overflow = ppm_LinkBox(box,newbox)
numberbox = ppm_CloneBox(numberbox,0,0)
call ppm_BoxChangePage(numberbox,thispage)
box = newbox
if newtext="" | overflow = 0 then break
end
newpage = ppm_GoToPage(cpage)
call ppm_SetUnits(currentunits)
call exit_msg()
end
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
error:
syntax:
do
exit_msg("Arrêt du Génie dû à l'erreur: "errortext(rc))
end
exit_msg:
do
parse arg message
if message ~= "" then
call ppm_Inform(1,message,)
call ppm_ClearStatus()
call ppm_AutoUpdate(1)
exit
end