home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ANews 2
/
AnewsCD2.iso
/
ANews_N°2
< prev
next >
Wrap
Text File
|
1999-10-14
|
36KB
|
1,107 lines
/**********************************************************\
**
** Interface du CD ANews
** ©1999 Frédéric RIGNAULT
**
\**********************************************************/
VERSION = "$VER:v1.02 (14.10.99)"
VERSION = SUBSTR(VERSION,6)
ROOT="ANewsCD2:"
DEBUG=0
REDIR=">NIL:"
/* Déclarations Globale */
FALSE=0
TRUE=1
NOSELECT=4.2949673E+9
TXTCOL="\0339" /* \0339 */
TXTCOL2="\0339"
LASTCAT=0
LASTREP=0
LASTLIST=0
typl.0=11 ;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/HTML" ;aide.7="Afficher la page Html."
typl.8="+anim" ;icone.8=ROOT||"Icônes/Video" ;aide.8="Voir l'animation"
typl.9="+copie" ;icone.9=ROOT||"Icônes/Disk" ;aide.9="Copier le(s) fichier."
typl.10="+extract";icone.10=ROOT||"Icônes/Archive" ;aide.10="Extraire l'archive et lance l'installation si disponible."
typl.11="+install";icone.11=ROOT||"Icônes/Disk" ;aide.11="Lancement de l'installation."
guide.0=ROOT||"Icônes/help.iff"
guide.1=ROOT||"Icônes/guide.iff"
guide.2=ROOT||"Icônes/html.iff"
guide.3=ROOT||"Icônes/readme.iff"
image.1=ROOT||"Icônes/run.iff"
image.2=image.1
image.3=ROOT||"Icônes/View.iff"
image.4=ROOT||"Icônes/musique.iff"
image.5=image.4
image.6=image.4
image.7=ROOT||"Icônes/html.iff"
image.8=ROOT||"Icônes/video.iff"
image.9=ROOT||"Icônes/disk.iff"
image.10=ROOT||"Icônes/archive.iff"
image.11=ROOT||"Icônes/disk.iff"
PrefsLoad=FALSE
WaitLoad=FALSE
IconShow=1
IconGuide=1
/* 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
if DEBUG then 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
call StopMUI
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)
if debug then 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='HELP' then call ShowHelp
otherwise do
if debug then say class||"?"
end
end
end
return
InitAll:
If open('f1',ROOT||"Arbre.ani",'r') then Do
i=0
j=0
Arbre.0=0
do forever
a=readln('f1')
if a="END" then break
if left(a,1)="+" then do
j=j+1
parse var a "+" b "," c
Arbre.i.0=j
Arbre.i.j.Titre=b
Arbre.i.j.Rep=c
end
else do
i=i+1
Arbre.0=i
Arbre.i.Titre=a
j=0
Arbre.i.0=j
end
end
a=close('f1')
End
address ANEWS
list ID CATS ATTRS MUIA_List_Quiet TRUE
do i=1 to Arbre.0
list ID CATS INSERT POS MUIA_List_Insert_Bottom STRING TXTCOL||Arbre.i.Titre
end
list ID CATS ATTRS MUIA_List_Quiet FALSE MUIA_List_Active 0
return
UpdateReps:
list ID CATS ATTRS MUIA_List_Active
i=result+1
if LASTCAT=i then return
LASTCAT=i
list ID REPS STRING
list ID REPS ATTRS MUIA_List_Quiet TRUE
DO j=1 to Arbre.i.0
LIST ID REPS INSERT POS MUIA_List_Insert_Bottom STRING TXTCOL||Arbre.i.j.Titre
end
list ID REPS ATTRS MUIA_List_Quiet FALSE MUIA_List_Active 0
LASTREP=0
return
UpdateList:
parse arg nouv
if nouv="" then nouv=0
list ID CATS ATTRS MUIA_List_Active
i=result+1
list ID REPS ATTRS MUIA_List_Active
j=result+1
if (LASTREP=j) & (nouv=0) then return
LASTREP=j
list ID LIST STRING
list ID LIST ATTRS MUIA_List_Quiet TRUE
repertoire=ROOT||Arbre.i.j.Rep
i=0
if exists(repertoire||'contenu.ani') then do
If open('f1',repertoire||"contenu.ani",'r') then Do
do forever
a=readln('f1')
if eof('f1') then break
parse var a b '=' c
select
when b="nom" then do
i=i+1
contenu.0=i
contenu.i.nom=c
contenu.i.finfo=""
contenu.i.rep=""
contenu.i.guide=""
contenu.i.action.0=0
contenu.i.infos.0=0
list ID LIST INSERT POS MUIA_List_Insert_Bottom STRING TXTCOL||c
end
when b="+rep" then contenu.i.rep=c
when b="+guide" then contenu.i.guide=c
when b="+infos" then do
k=contenu.i.infos.0+1
contenu.i.infos.0=k
contenu.i.infos.k=a
end
when b="+finfo" then contenu.i.finfo=c
otherwise do
j=contenu.i.action.0+1
contenu.i.action.0=j
contenu.i.action.j=a
end
end
end
a=close('f1')
end
end
list ID LIST ATTRS MUIA_List_Quiet FALSE
if i>0 then do
if nouv=0 then nouv=1
if nouv>=0 then list ID LIST ATTRS MUIA_List_Active nouv-1
end
else do
call UpdGuide(0)
call UpdIcon(0)
end
LASTLIST=0
return
UpdateInfos:
list ID CATS ATTRS MUIA_List_Active
i=result+1
list ID REPS ATTRS MUIA_List_Active
j=result+1
list ID LIST ATTRS MUIA_List_Active
k=result+1
if LASTLIST=k then return
LASTLIST=k
repertoire=ROOT||Arbre.i.j.Rep
repbase=repertoire
etat=0
listeaction.0=0
listeinfos.0=0
if k=NOSELECT then return
b="nom="||contenu.k.nom
if contenu.k.infos.0>0 then do
if debug then say "Texteinfo"
if open('f2',"T:infos.txt",'w') then do
do l=1 to contenu.k.infos.0
parse var contenu.k.infos.l a '=' b
x=listeinfos.0+1
listeinfos.0=x
listeinfos.x=b
call writeln('f2',b)
end
call close('f2')
VIEW ID INFOS FILE "T:infos.txt"
end
end
else do
fichier=repbase||contenu.k.rep||contenu.k.finfo
if (exists(fichier)) & (contenu.k.finfo~="") then do
VIEW ID INFOS FILE fichier
end
else do
VIEW ID INFOS STRING ""
end
end
repbase=repertoire
if contenu.k.action.0>0 then do
parse var contenu.k.action.1 a '=' b
m=0
do l=1 to typl.0
if typl.l=a then do
m=l
break
end
end
if debug then say "Image:"||m
call UpdIcon(m)
do l=1 to contenu.k.action.0
parse var contenu.k.action.l a '=' b
x=listeaction.0+1
listeaction.0=x
listeaction.x=b
end
end
else do
call UpdIcon(0)
end
if (Contenu.k.guide~=lastfile) & (Contenu.k.guide~="") then do
a=upper(Contenu.k.guide)
select
when right(a,6)=".GUIDE" then call UpdGuide(1)
when (right(a,5)=".HTML") | (right(a,4)=".HTM") then call UpdGuide(2)
otherwise call UpdGuide(3)
end
end
else do
call UpdGuide(0)
end
return
UpdIcon:
if IconShow~=0 then do
object ID AUT||IconShow ATTRS MUIA_ShowMe FALSE
IconShow=0
end
if arg(1)~=IconShow then do
IconShow=arg(1)
object ID AUT||IconShow ATTRS MUIA_ShowMe TRUE
end
return
UpdGuide:
if IconGu