home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ANews 2
/
AnewsCD2.iso
/
Script
/
ANewsEdit.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-10-06
|
42KB
|
1,462 lines
/**********************************************************\
**
** Interface d'édition du CD ANews
** ©1999 Frédéric RIGNAULT
**
\**********************************************************/
VERSION = "$VER:v0.40 (24.06.1999)"
VERSION = SUBSTR(VERSION,6)
ROOT="ANewsCD:"
/* Déclarations Globle */
FALSE=0
TRUE=1
NOSELECT=4.2949673E+9
TXTCOL="\0339"
LASTCAT=0
LASTREP=0
LASTLIST=0
typl.0=9 ;icone.0=ROOT||"Icônes/Auto" ;aide.0="Boutton Action par défaut:\nNE DOIT PAS ETRE LA!"
typl.1="+run" ;icone.1=ROOT||"Icônes/Run" ;aide.1="Lancer le programme."
typl.2="+manuel";icone.2=ROOT||"Icônes/Run" ;aide.2="Execute une action."
typl.3="+voir" ;icone.3=ROOT||"Icônes/View" ;aide.3="Visualiser l'image."
typl.4="+son" ;icone.4=ROOT||"Icônes/Musique" ;aide.4="Ecouter le son."
typl.5="+ecoute";icone.5=ROOT||"Icônes/Musique" ;aide.5="Ecouter le son."
typl.6="+jouer" ;icone.6=ROOT||"Icônes/Musique" ;aide.6="Jouer le module."
typl.7="+html" ;icone.7=ROOT||"Icônes/Auto" ;aide.7="Afficher la page Html."
typl.8="+anim" ;icone.8=ROOT||"Icônes/QuickTime";aide.8="Voir l'annimation"
typl.9="+copie" ;icone.9=ROOT||"Icônes/Archive" ;aide.9="Copier le(s) fichier."
PrefsLoad=FALSE
IconShow=1
/* Déclarations Edition */
currinf=NOSELECT
currop=NOSELECT
/* Open libs needed */
options results
IF EXISTS("libs:rexxsupport.library") THEN DO
IF ~SHOW("L","rexxsupport.library") THEN
IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
END
ELSE EXIT
IF EXISTS("libs:rexxreqtools.library") THEN DO
IF ~SHOW("L","rexxreqtools.library") THEN
IF ~ADDLIB("rexxreqtools.library",0,-30) THEN EXIT
END
ELSE EXIT
Say "Libs:OK"
if (show('p','ANEWS')) & (show('p','ASERV')) then do
address ANEWS SHOW
exit
end
/* Open message Port Of Script */
address rexx
OPENPORT("ASERV")
/* Open Muirexx */
call StartMUI
call LoadPrefs
call OpenGUI
call InitAll
call GestEvent
address ANEWS QUIT
exit
GestEvent:
Do forever
address ANEWS
window ID ANEWS ATTRS MUIA_Window_Sleep FALSE
address REXX
gotit=0
do until gotit
call waitpkt(ASERV);packet=getpkt(ASERV)
gotit=(packet ~= null())
end
address ANEWS
window ID ANEWS ATTRS MUIA_Window_Sleep TRUE
address REXX;class=getarg(packet);reply(packet,0)
say class","LASTCAT","LASTREP","LASTLIST
address ANEWS
select
when class='ABOUT' then do
request ID ANEWS Title '"A propos du Navigateur ANews"' GADGETS "D'accord" STRING replacepat("Navigateur de CD ANews\nVersion %s\n©1999 Frédéric Rignault", "%s", VERSION )
end
when class='QUIT' then break
when class='PREFS' then call OpenPrefs
when class='CANCELPREFS' then do
window ID APREF ATTRS MUIA_Window_Open FALSE
end
when class='USEPREFS' then do
call readprefs
window ID APREF ATTRS MUIA_Window_Open FALSE
call saveprefs("USE")
end
when class='SAVEPREFS' then do
call readprefs
window ID APREF ATTRS MUIA_Window_Open FALSE
call saveprefs("SAVE")
end
when class='CATUPD' then call UpdateReps
when class='REPUPD' then call UpdateList
when class='LSTUPD' then call UpdateInfos
when class='AUTO' then call StartAuto
when class='GUIDE' then call ShowGuide
when class='SAVE' then call SauverAction
when class='ADDF' then call CreerAction
when class='DELC' then call EffacerAction
when class='NOUV' then do
call updateList(-1)
end
when class='UPC' then Call DeplacerAction("HAUT")
when class='DOWNC' then Call DeplacerAction("BAS")
when class='ADDR' then do
list ID FICH ATTRS MUIA_List_Active
l=result+1
if l~=NOSELECT then do
if fiche.l.dir=FALSE then do
x=listeaction.0+1
listeaction.0=x
listeaction.x=repactuel||fiche.l.nom
list ID OP INSERT POS MUIA_List_Insert_Bottom STRING repactuel||fiche.l.nom
end
end
end
when class='ADDD' then do
list ID FICH ATTRS MUIA_List_Active
l=result+1
if l~=NOSELECT then do
if fiche.l.dir=FALSE then do
string ID GUID CONTENT repactuel||fiche.l.nom
end
end
end
when class='ADDI' then do
list ID FICH ATTRS MUIA_List_Active
l=result+1
if l~=NOSELECT then do
if fiche.l.dir=FALSE then do
cycle ID IMODE ATTRS MUIA_Cycle_Active
if result=1 then do
string ID IFILE CONTENT repactuel||fiche.l.nom
list ID INF STRING
end
else do
string ID IFILE CONTENT
string ID REP
b=repbase||result||repactuel||fiche.l.nom
say b
if exists(b) then do
if open('f1',b,'r') then do
do forever
a=readln('f1')
if eof('f1') then break
x=listeinfos.0+1
listeinfos.0=x
listeinfos.x=a
list ID INF INSERT POS MUIA_List_Insert_Bottom STRING a
end
call close('f1')
end
end
end
end
end
end
when class='FICH' then do
list ID FICH ATTRS MUIA_List_Active
l=result+1
if l~=NOSELECT then do
if fiche.l.dir=TRUE then do
string ID REP2 CONTENT repactuel||fiche.l.nom||'/'
call UpdateDir
end
end
end
when class="PARENT" then do
if length(repactuel)>1 then do
j=length(repactuel)-1
do i=j to 1 by -1
if substr(repactuel,i,1)="/" then break
end
say i
repactuel=left(repactuel,i)
string ID REP2 CONTENT repactuel
call UpdateDir
end
end
when class='UPDDIR' then call UpdateDir
/* Gestion liste edition informations */
when class='INFUPD' then do /* Suivis Liste INF */
list ID INF ATTRS MUIA_List_Active
a=result+1
if a~=currinf then do
currinf=a
if a~=NOSELECT then string ID EDINF CONTENT listeinfos.a
else string ID EDINF CONTENT
end
end
when class='EDINF' then do /* MàJ texte INFO */
cycle ID IMODE ATTRS MUIA_Cycle_Active 0
string ID IFILE CONTENT
a=currinf
if a~=NOSELECT then do
string ID EDINF
listeinfos.a=result
currinf=a
if listeinfos.a="" then do
list ID INF POS a-1 STRING "(Vide)"
end
else do
list ID INF POS a-1 STRING listeinfos.a
end
end
end
when class='ADDINF' then do /* Ajoute texte INFO */
cycle ID IMODE ATTRS MUIA_Cycle_Active 0
string ID IFILE CONTENT
b=currinf
a=listeinfos.0+1
listeinfos.0=a
listeinfos.a=""
t="(Nouveau)"
if b=NOSELECT then do
string ID EDINF
if result~="" then do
t=result
listeinfos.a=t
end
end
string ID EDINF CONTENT listeinfos.a
list ID INF POS MUIA_List_Insert_Bottom INSERT STRING t
list ID INF ATTRS MUIA_List_Active a-1
currinf=a
end
when class='INSINF' then do /* Insert INF */
cycle ID IMODE ATTRS MUIA_Cycle_Active 0
string ID IFILE CONTENT
a=currinf
if a~=NOSELECT then do
string ID EDINF CONTENT
b=listeinfos.0+1
listeinfos.0=b
do i=b to a by -1
j=i+1
listeinfos.j=listeinfos.i
end
listeinfos.a=""
list ID INF POS a-1 INSERT STRING "(Nouveau)"
list ID INF ATTRS MUIA_List_Active a-1
currinf=a
end
end
when class='DELINF' then do
if currinf~=NOSELECT then do
b=listeinfos.0-1
listeinfos.0=b
if b>=currinf then do
do i=currinf to b
j=i+1
listeinfos.i=listeinfos.j
end
end
list ID INF POS currinf-1 STRING
currinf=min(currinf,b)
list ID INF ATTRS MUIA_List_Active currinf-1
currinf=NOSELECT
end
end
/* Gestion Liste OP */
when class='OPUPD' then do /* Suivis Liste OP */
list ID OP ATTRS MUIA_List_Active
a=result+1
if a~=currop then do
currop=a
if a~=NOSELECT then do
string ID RFILE CONTENT listeaction.a
end
else do
string ID RFILE CONTENT
end
end
end
when class='RFILE' then do /* MàJ OP */
/*l