home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 46
/
Mobiclic46.iso
/
pc
/
DATA
/
SHARED
/
COMMUNS.CST
/
00013_Script_magsMilan
< prev
next >
Wrap
Text File
|
2002-07-12
|
12KB
|
321 lines
-----------------------------------------------------------------
-- MARKETING APPLICATION
-- "MAGAZINES MILAN" MODULE SCRIPTS
-- Gyorgy Gutierrez, Mai 2002
-----------------------------------------------------------------
-----------------------------------------------------------------
----------------------- global variables ------------------------
-----------------------------------------------------------------
global gMyParent, gTestMode, gLastMovie, gCodeEuro
global gMagList, gNomMagList, gTexteMagList, gCadeauList
global gPrixLibEList, gTextePrixLibList
global gPrixClasEList, gTextePrixClasList
global gTypeAboChoisi, gListePrix, gPort, gListeCom, gListeTotal
global gSommeTotalE, gChoixCadeau1, gChoixCadeau2, gNewCad
global gFichierMags, gLiens
-----------------------------------------------------------------
-- ajout d'un magazine a la commande et acces ecrans commande ---
-----------------------------------------------------------------
on ajoutMag
s = the currentSpriteNum
myref = value(member("my ref").line[s-19])
--si premiere commande passage par ecran abonnement
--sinon acces directe aux module de commande suivant le
--type de abonnement deja choisi
if count(gListeCom) = 0 then
acces "prom02"
else
case gTypeAboChoisi of
1: acces "pan01_1"
2: acces "pan02_1"
end case
end if
-- ajout du magazine α la commande
-- creer l'objet magazine si le nombre maximum de commandes n'est pas depasse
-- cas particulier Moi je lis + 2 hors serie ne peut pas etre commande par
-- paiement par prelevements
if count(gListeCom) < 2 then
append gListeCom, new(script"magazine parent",myref)
else
alert member("alerte trop d'abo").text
end if
end
-----------------------------------------------------------------
-------------------- gestion de l'affichage ---------------------
-----------------------------------------------------------------
on gestAffich
inc = 0
--affichage des magazines commandes
if count(gListeCom) <> 0 then
member("abo01").text = EMPTY
member("abo02").text = EMPTY
repeat with i = 1 to count(gListeCom)
put string(the nmag of gListeCom[i]) into member("abo0" & string(i)).line[1]
put string(the tmag of gListeCom[i]) into member("abo0" & string(i)).line[2]
case gTypeAboChoisi of
1:
put string(the tpli of gListeCom[i]) into member("abo0" & string(i)).line[3]
2:
put string(the tpcl of gListeCom[i]) into member("abo0" & string(i)).line[3]
end case
set the font of field("abo0" & string(i)) = "Arial"
set the fontSize of line 1 of field("abo0" & string(i)) = 12
set the fontSize of line 2 of field("abo0" & string(i)) = 10
set the fontSize of line 3 of field("abo0" & string(i)) = 10
inc = inc + 49
afficherPistes i+20, i+24, i+27, i+31, i+35, i+38, i+41
end repeat
calculTotal
--affichage de la somme totale
put gSommeTotalE && gCodeEuro into member("SommeTotalE")
repeat with i = 1 to 5
sprite(i+50).locV = sprite(i+50).locV + inc
afficherPistes i+50
end repeat
-- gestion et affichage du cadeau
if count(gListeCom) <> 0 then
case count(gListeCom) of
1:
gChoixCadeau1 = the cad of gListeCom[1]
sprite(60).member = member("cadeau" & string(gChoixCadeau1))
afficherPistes 57,60
2:
gChoixCadeau1 = the cad of gListeCom[1]
gChoixCadeau2 = the cad of gListeCom[2]
sprite(60).member = member("cadeau" & string(gChoixCadeau1))
sprite(61).member = member("cadeau" & string(gChoixCadeau2))
afficherPistes "57>62"
end case
end if
else
gSommeTotalE = 0
put gSommeTotalE into member("SommeTotalE")
end if
updatestage
end
-----------------------------------------------------------------
------------------- gestion du cadeau double --------------------
-----------------------------------------------------------------
on changeCadeau
if count(gListeCom)=2 and gChoixCadeau1 = gChoixCadeau2 then
afficherPistes "7>9"
gNewCad=[1,2,3]
pvc = getPos(gNewCad,gChoixCadeau1)
deleteAt(gNewCad,pvc)
put member("les cadeau").line[gNewCad[1]] into member("new cad 1")
put member("les cadeau").line[gNewCad[2]] into member("new cad 2")
put member("les cadeau").line[gChoixCadeau1] into member("old cad")
end if
end
-----------------------------------------------------------------
------------ suprimer un magazine de la commande ----------------
-----------------------------------------------------------------
on supprimer
s = the currentSpriteNum
if count(gListeCom)=2 then
ref2abo = the ref of gListeCom[2]
cadorigine = gCadeauList[ref2abo]
set the cad of gListeCom[2] to cadorigine
end if
gListeCom.deleteAt(s-41)
sprite(51).locV = 95
sprite(52).locV = 85
sprite(53).locV = 95
sprite(54).locV = 85
sprite(55).locV = 95
sprite(59).locV = 130
sprite(62).locV = 146
masquerPistes "21>62"
masquerPistes "7>10"
if count(gListeCom) = 0 then gTypeAboChoisi = 0
gestAffich
end
-----------------------------------------------------------------
------------ calculs des montants de la commande ----------------
-----------------------------------------------------------------
on calculTotal
-- calcul du montant total de la commande
gSommeTotalE = 0
case gTypeAboChoisi of
1:
repeat with i = 1 to count(gListeCom)
prixe = the plie of gListeCom[i]
put string(prixe) && gCodeEuro into member("prixe_" & i)
gSommeTotalE = gSommeTotalE + prixe
end repeat
2:
repeat with i = 1 to count(gListeCom)
prixe = the pcle of gListeCom[i]
put string(prixe) && gCodeEuro into member("prixe_" & i)
gSommeTotalE = gSommeTotalE + prixe
end repeat
end case
end
-----------------------------------------------------------------
------------ gestion de l'affichage pour impression -------------
-----------------------------------------------------------------
on igestAffich
inc = 0
--affichage des magazines commandes
if count(gListeCom) <> 0 then
member("iabo01").text = EMPTY
member("iabo02").text = EMPTY
repeat with i = 1 to count(gListeCom)
put string(the nmag of gListeCom[i]) into member("iabo0" & string(i)).line[1]
put string(the tmag of gListeCom[i]) into member("iabo0" & string(i)).line[2]
case gTypeAboChoisi of
1:
put string(the tpli of gListeCom[i]) into member("iabo0" & string(i)).line[3]
2:
put string(the tpcl of gListeCom[i]) into member("iabo0" & string(i)).line[3]
end case
set the font of field("iabo0" & string(i)) = "Arial"
set the fontSize of line 1 of field("iabo0" & string(i)) = 11
set the fontSize of line 2 of field("iabo0" & string(i)) = 10
set the fontSize of line 3 of field("iabo0" & string(i)) = 10
inc = inc + 49
afficherPistes i+20, i+24, i+27, i+31, i+35, i+38, i+41
end repeat
icalculTotal
--affichage de la somme totale
put gSommeTotalE && gCodeEuro into member("iSommeTotalE")
repeat with i = 1 to 5
sprite(i+50).locV = sprite(i+50).locV + inc
afficherPistes i+50
end repeat
-- gestion et affichage du cadeau
if count(gListeCom) <> 0 then
case count(gListeCom) of
1:
gChoixCadeau1 = the cad of gListeCom[1]
put member("les cadeau").line[gChoixCadeau1] into member("icadeau 1")
s = member("icadeau 1").text.word.count
put member("code cadeau").line[gChoixCadeau1] into member("icadeau 1").word[s+1]
afficherPistes 56,60
2:
gChoixCadeau1 = the cad of gListeCom[1]
gChoixCadeau2 = the cad of gListeCom[2]
put member("les cadeau").line[gChoixCadeau1] into member("icadeau 1")
s = member("icadeau 1").text.word.count
put member("code cadeau").line[gChoixCadeau1] into member("icadeau 1").word[s+1]
put member("les cadeau").line[gChoixCadeau2] into member("icadeau 2")
s = member("icadeau 1").text.word.count
put member("code cadeau").line[gChoixCadeau2] into member("icadeau 2").word[s+1]
s = member("prime2abos").text.word.count
--put member("code cadeau").line[4] into member("prime2abos").word[s+1]
repeat with i = 57 to 61
sprite(i).locV = sprite(i).locV + 65
end repeat
afficherPistes "57>61"
end case
end if
else
gSommeTotalE = 0
put gSommeTotalE into member("iSommeTotalE")
end if
updatestage
end
-----------------------------------------------------------------
------ calculs des montants de la commande pour impression ------
-----------------------------------------------------------------
on icalculTotal
-- calcul du montant total de la commande
gSommeTotalE = 0
case gTypeAboChoisi of
1:
repeat with i = 1 to count(gListeCom)
prixe = the plie of gListeCom[i]
put string(prixe) && gCodeEuro into member("iprixe_" & i)
gSommeTotalE = gSommeTotalE + prixe
end repeat
2:
repeat with i = 1 to count(gListeCom)
prixe = the pcle of gListeCom[i]
put string(prixe) && gCodeEuro into member("iprixe_" & i)
gSommeTotalE = gSommeTotalE + prixe
end repeat
end case
end
-----------------------------------------------------------------
---- transfert des valeurs des champs gris vers champs noirs ----
-----------------------------------------------------------------
on gestTransfert
case gTypeAboChoisi of
1:
repeat with i = 101 to 108
put member(i,"abo_lib").text into member(i,"interne")
end repeat
repeat with i = 111 to 118
put member(i,"abo_lib").text into member(i,"interne")
end repeat
repeat with i = 121 to 134
put member(i,"abo_lib").text into member(i,"interne")
end repeat
2:
repeat with i = 101 to 112
put member(i,"abo_cla").text into member(i,"interne")
end repeat
repeat with i = 121 to 128
put member(i,"abo_cla").text into member(i,"interne")
end repeat
end case
end
-----------------------------------------------------------------
----------------- impression bon de commande --------------------
-----------------------------------------------------------------
on imprimeBon
updateStage
-- gΘnΘrer un aperτu d'Θcran si la touche option est appuyΘe
if the optionDown=1 then
set prevue=1
end if
-- gΘnΘrer le fichier impression si validation du format d'impression
set doc = new(xtra "PrintOMatic")
-- enregistrement de PrintOMatic
--register(xtra "PrintOMatic", member("codePom").text)
if not objectP(doc) then exit
setPrintableMargins doc
if doPageSetUp (doc) = true then
newPage doc
drawStagePicture doc, Point(10,10),true
if prevue=1 then
if doJobSetup (doc) = TRUE then
setProgressMsg doc , "Impression en cours... "
printPreview doc
end if
else
if doJobSetup (doc) = TRUE then
setProgressMsg doc , "Impression en cours... "
print doc
end if
end if
end if
set doc = 0
end