/* Author : iri || http://www.irizone.net Date : august 2005 Version : 0.1a Editor : Notepad++ (http://notepad-plus.sourceforge.net/) License : GNU/GPL v1.1 or above || http://www.gnu.org */ /* This file is part of DemoSCS. DemoSCS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DemoSCS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* OBJECTIFS : - Démo / Présentation du SCS - Création d'un site SCS simple avec une aide pas à pas */ /* TO DO : - Etapes 6 et suivantes - Refaire le C3D3 différemment (en utilisant moins de bitmap notamment) - Ressources signés à télécharger (actu, non signées) - Enregistrement et chargement d'une session de la démo - Sauvegarde du .dms du site pour une exécution / édition dans le SCS - Tous les textes ou presque (explications, bubbles, etc ...) - Commentaires du code - Optimisation du code - .... */ /********************************************************/ /***** DECLARATIONS / DEFINITIONS ************/ /***** ************/ /********************************************************/ // structure mère struct APPLETMAIN = [ win : ObjWin, // fenêtre mère winW : I, // largeur fenêtre mère winH : I, // hauteur fenêtre mère comment : ObjWin, // sous-fenêtre de texte commentW : I, // sa largeur commentH : I, // et sa hauteur maincont : ObjContainer, // container ds laquelle se déroulera la demo commenttext : ObjRichText, // obj texte de la fenêtre comment commentlast : S // texte considéré comme étant le dernier (texte de survol mis à part) ] mkAPPLETMAIN;; typeof amain = APPLETMAIN;; // structure de l'interface de la demo struct APPLETCONT = [ contBMPbg : CompBitmap, // container bitmap de l'interf du SCS contBMPmenu : CompBitmap, // container bitmap contenant le menu de chaque icône du haut du SCS contBMPinterfProp : CompBitmap, // container bitmap contenant la fenêtre de propriétés d'une zone contBMPeditor : CompBitmap, // container bitmap d'un exemple d'édition d'un module contBMPtreeMod : CompBitmap // container bitmap contenant l'arbre de création ] mkAPPLETCONT;; typeof acont = APPLETCONT;; // structure de l'interface de navigation de l'applet struct USERINTERFACE = [ ucontmain : ObjContainer, // container parent ucontBMPprevious : ObjNode, // bouton précédent ucontBMPnext : ObjNode, // bouton suivant ucontBMPstep : ObjNode, // bouton étape (liste les étapes de la demo) ucontBMPload : ObjNode, // bouton load ucontBMPsave : ObjNode, // bouton save ucontBMPdms : ObjNode, // bouton de sauvegarde au format .dms ucontBMPrun : ObjNode, // bouton de préview ucontBMPpref : ObjNode // bouton d'infos ] mkUSERINTERFACE;; typeof ucont = USERINTERFACE;; // structure du module LOGIN struct MODLOGIN = [ dcontloginBMP : ObjNode, // brique du module sur le shell dloginBMP : S, // path du bitmap dloginName : S, // nom du module dloginPos : [I I], // pos sur le shell x y dloginClicked : I // bouton gauche appuyé sur la brique pour le déplacer (1) sinon (0) ] mkMODLOGIN;; typeof modLogin = MODLOGIN;; // structure du module PHOTO struct MODPHOTO = [ dcontphotoBMP : ObjNode, // brique du module sur le shell dphotoBMP : S, // path du bitmap dphotoName : S, // nom du module dphotoPos : [I I], // pos sur le shell x y dphotoClicked : I // bouton gauche appuyé sur la brique pour le déplacer (1) sinon (0) ] mkMODPHOTO;; typeof modPhoto = MODPHOTO;; // structure du module COLORTERM struct MODCT = [ dcontCTBMP : ObjNode, dCTBMP : S, dCTName : S, dCTPos : [I I], dCTClicked : I, dCTabmp : AlphaBitmap, // alphabitmap de l'éditeur dCTbg : I, // background color dCTsys1 : I, // couleur msg système > dCTsys2 : I, // couleur msg systeme >> dCTlogin : I, // couleur login dCTaction : I, // couleur msg actions dCTsaisie : I // couleur de saisie ] mkMODCT;; typeof modCT = MODCT;; // structure du module CONTACT struct MODCONTACT = [ dcontCoBMP : ObjNode, dCoBMP : S, dCoName : S, dCoPos : [I I], dCoClicked : I, dCoAuto : I, // lancement auto au démarrage dCoAbmp : AlphaBitmap // alphabitmap de l'éditeur ] mkMODCONTACT;; typeof modCo = MODCONTACT;; // structure du module INOUT struct MODIO = [ dcontIoBMP : ObjNode, // brique du module sur le shell dIoBMP : S, // path du bitmap dIoName : S, // nom du module dIoPos : [I I], // pos sur le shell x y dIoClicked : I // bouton gauche appuyé sur la brique pour le déplacer (1) sinon (0) ] mkMODIO;; typeof modIo = MODIO;; // structure du module C3D3 struct MODC3D3 = [ dcont3dBMP : ObjNode, // brique du module sur le shell d3dBMP : [S r1], // paths des bitmaps d3dName : S, // nom du module d3dPos : [I I], // pos sur le shell x y d3dClicked : I, // bouton gauche appuyé sur la brique pour le déplacer (1) sinon (0) d3dOpened : I, // doit être ouvert qu'une fois d3dmain : CompBitmap, // CompBitmap principal d3dtab : I, // onglet : 0 : objets, 1 : liens, 2 : positions, 3 : ancres, 4 : observateur, 5 : instances, 6 : plugins, 7 : avancé d3editwin : ObjWin, // fenêtre de la view 3d session : S3d, // session shell : H3d, // father cam : H3d, // caméra buffer : ObjSurface, // buffer d3dTimer : Timer, // timer de rendu d3dClicOn : I, // click = 1, unclick = 0 d3dPosClick : [I I], // coordonnées x y du dernier clic d3dPosCursor : [I I], // coordonnées x y du curseur d3dfocus : I, // focus sur la vue 3d (1) sinon 0 d3dMoveCamVector : [I I I], // vecteur déplacement camera d3dMoveCamAngle : [I I I], // angle déplacement caméra d3dbgcolor : I, // couleur de fond de scène d3dHMatSelect : [H3d HMat3d], // objet 3d et materiau sélectionné dans la vue 3d d3dObj : [ // liste des objets 3d [H3d // objet 3d [HMat3d r1] // liste des materiau de l'objet 3d [I I I] // position de l'objet 3d [I I I] // angle de l'objet 3d S // nom du fichier m3d ] r1], darkbase : H3d, // darkbase darkbaseValue : I, // valeur de la darbase scelbox : SBox, // boîte de déplacement session celbox : Box, // boîte de déplacement d3dmenu : ObjMenu, // menu contextuel d3dBmpTemp : ObjBitmap, // temp bitmap pour affichage d3dAddObjectSelected : H3d, // objet 3d sélectionné dans l'ajout d'un m3d d3dAddObjectTimer : Timer, // timer pour la vignette 3d de l'objet sélectionné d3dAddObjectSelectedFile : S // fichier m3d ] mkMODC3D3;; typeof mod3d = MODC3D3;; // module BUTTON : {brique} {container bitmap associé} {path du bitmap lié au module} {nom du bouton} {pos x et y sur le shell} {brique cliqué ou pas} typeof modButton = [[ObjNode CompBitmap S S [I I] I] r1];; typeof mylang = S;; // langue choisie typeof ulogin = S;; // login choisi typeof uname = S;; // site name typeof lastkbdstate = I;; typeof datatmp = S;; // récupère les données transférées du net avant sauvegarde sur le HD typeof errDl = [[S I] r1];; // liste des fichiers où une erreur de téléchargement est survenue (fichiers + code erreur) typeof winDl = ObjWin;; // fenêtre de loading typeof textDl = ObjText;; // etat d'avancement du téléchargement typeof contProgression = ObjContainer;; typeof contBubble = ObjContainer;; var oldbubble = "";; var defPath = "applets/scs/";; // chemin de l'applet var etape = 0;; // numéro de l'étape courante var linking = 0;; // création en cours d'un line (1) sinon (0) /********************************************************/ /***** PROTOTYPAGES ************/ /***** ************/ /********************************************************/ proto creaCompBmpMenu = fun[S I I] I ;; proto cbClickMenu = fun [CompBitmap [S I I I I] I I I I] I ;; proto creaTreeModule = fun [S I I] I ;; //proto creaCompBmpEditorButton = fun [S I I [ObjNode CompBitmap S S [I I] I] I] I ;; proto creaCompBmpEditorButton = fun [S I I S I] I ;; proto creaCompBmpEditorColorTerm = fun [S I I I] I ;; proto creaCompBmpEditorContact = fun [S I I I] I ;; proto validEditor = fun [S] I ;; proto c3d3CbMenuContextuel = fun [ObjMenuItem [I I S]] I ;; proto dlRSC = fun [[S r1]] I ;; // // FUNCTIONS // /********************************************************/ /***** INIT & CALLBACKS ************/ /***** ************/ /********************************************************/ fun cbMaincontMove(obj, u, xm, ym, mask)= 0;; fun cbEnd(obj, u)= MBOXdestroy mod3d.scelbox; _closemachine;; fun init()= set amain = mkAPPLETMAIN [nil 800 800 nil 700 190 nil nil nil]; set acont = mkAPPLETCONT [nil nil nil nil nil]; set ucont = mkUSERINTERFACE [nil nil nil nil nil nil nil nil nil]; set modLogin = mkMODLOGIN [nil "login.scs.png" "login3" [22 110] 0]; set modPhoto = mkMODPHOTO [nil "photo.scs.png" "photo3" [22 110] 0]; set modCT = mkMODCT [nil "term.scs.png" "colorterm" [22 110] 0 nil nil nil nil nil nil nil]; set modCo = mkMODCONTACT [nil "contact.scs.png" "contact" [22 110] 0 1 nil]; set modIo = mkMODIO [nil "io.scs.png" "inout" [22 110] 0]; set mod3d = mkMODC3D3 [nil "3d.scs.png"::"c3d3main."::nil "c3d3" [22 110] 0 0 nil 0 nil nil nil nil nil nil 0 nil [0 0] 0 [0 0 0] [0 0 0] 0 nil nil nil 0 nil nil nil nil nil nil nil ]; set modButton = nil; set mylang = "french"; ///*set mylang = strlowercase */_showconsole; _fooSList switchstr (strextr _getress "parameters") "language"; // set ulogin = switchstr (strextr _getress "parameters") "login"; set ulogin = if ulogin == nil then "userSCS" else ulogin; 0;; /********************************************************/ /***** LOCALISATIONS ************/ /***** ************/ /********************************************************/ // loc. pour une phrase fun getLangRef(l, s)= if l == nil then "ERR_LANGUAGE" else if (!strcmpi hd hd l s) then let linebuild tl hd l -> s in substr s 0 (strlen s) - 1 else getLangRef tl l s;; fun _loc(ref)= let strextr _getpack _checkpack strcat defPath strcat "lang/" strcat mylang ".lang" -> l in getLangRef l ref;; // loc pour un seul mot fun getLangRef2(l, s)= if l == nil then "ERR_LANGUAGE" else if (!strcmpi hd hd l s) then hd tl hd l else getLangRef2 tl l s;; fun _loc2(ref)= let strextr _getpack _checkpack strcat defPath strcat "lang/" strcat mylang ".lang" -> l in getLangRef2 l ref;; // inutilisé fun initLoc()= 0;; /********************************************************/ /***** CHOIX COULEUR ************/ /***** ************/ /********************************************************/ /* _mcolormap001.pkg - may, 22 '98 - by Marc Barilley color selection interface User callable function : proto _CRcolorMap = fun [Chn ObjWin I I S fun [I] I I] ColorMap;; parameters are : channel (can't be nil) parent window x coord (can't be nil nor negative) y coord (can't be nil nor negative) title end callback initial color (if nil then black r=0 g=0 b=0) files needed : locked/lib/const.pkg locked/lib/_mcolormap.bmp locked/lib/opencross.bmp */ /* colormap struct */ struct ColorMap= [ chColorMap : Chn, winColorMap : ObjWin, /* main window */ bwinColorMap : ObjWin, /* color window */ swinColorMap : ObjWin, /* sample window */ rwinColorMap : ObjWin, /* ruler window */ cursorColorMap : ObjCursor, bcursorColorMap : ObjBitmap, backColorMap : ObjBitmap, workColorMap : ObjBitmap, rulerColorMap : ObjBitmap, sampleColorMap : ObjBitmap, rColorMap : ObjText, gColorMap : ObjText, bColorMap : ObjText, hColorMap : ObjText, sColorMap : ObjText, vColorMap : ObjText, oldhColorMap : I, oldsColorMap : I, endColorMap : fun [I] I ] mkColorMap;; proto rflHLine = fun [ObjText ColorMap] ObjText;; proto rflSLine = fun [ObjText ColorMap] ObjText;; proto rflVLine = fun [ObjText ColorMap] ObjText;; proto rflRLine = fun [ObjText ColorMap] ObjText;; proto rflGLine = fun [ObjText ColorMap] ObjText;; proto rflBLine = fun [ObjText ColorMap] ObjText;; /* conversion */ fun hsv2rgb (h, s, v) = /* rgb 24bits, 0 <= h <= 360, 0 <= s <= 1, 0 <= v <= 1 */ set v= v*.itof 255; if s==itof 0 then (ftoi v)+((ftoi v)<<8)+((ftoi v)<<16) else { while h >=. itof 360 do set h = h -. itof 360; while h <. itof 0 do set h = h +. itof 360; set h = h /. itof 60; let ftoi h -> i in let h -. itof i -> f in let v *. ((itof 1) -. s) -> p in let v *. ((itof 1) -. s *. f) -> q in let v *. ((itof 1) -. s *. ((itof 1) -. f)) -> t in if i==0 then (ftoi v)+((ftoi t)<<8)+((ftoi p)<<16) else if i==1 then (ftoi q)+((ftoi v)<<8)+((ftoi p)<<16) else if i==2 then (ftoi p)+((ftoi v)<<8)+((ftoi t)<<16) else if i==3 then (ftoi p)+((ftoi q)<<8)+((ftoi v)<<16) else if i==4 then (ftoi t)+((ftoi p)<<8)+((ftoi v)<<16) else if i==5 then (ftoi v)+((ftoi p)<<8)+((ftoi q)<<16) else nil } ;; fun rgb2hsv (c) = /* c = 24 bits color */ let (c>>16) & 255 -> b in let (c>>8) & 255 -> g in let c & 255 -> r in let if r>g then if b>r then b else r else if b>g then b else g -> mx in let if r mn in let itof mx-mn -> delta in let if mx==0 then itof 0 else (itof mx-mn) /. itof mx -> s in let if (s>.itof 0) || (s<.itof 0) || (delta>.itof 0) || (delta<.itof 0) /* s != 0 || delta != 0 */ then (itof 60) *. if r==mx then (itof g-b)/.delta else if g==mx then (itof 2)+.(itof b-r)/.delta else (itof 4)+.(itof r-g)/.delta else itof 0 -> h in [ /* h */ if h<.itof 0 then h+.itof 360 else h /* s */ s /* v */ (itof mx)/.itof 255 ];; /* ending */ fun rflOkColorMap (wn, cm)= _DScursor cm.cursorColorMap; _DSbitmap cm.bcursorColorMap; _DSbitmap cm.backColorMap; _DSbitmap cm.workColorMap; _DSbitmap cm.rulerColorMap; _DSbitmap cm.sampleColorMap; let atoi _GETtext cm.rColorMap -> r in let atoi _GETtext cm.gColorMap -> g in let atoi _GETtext cm.bColorMap -> b in { _DSwindow cm.winColorMap; exec cm.endColorMap with [r + (g<<8) + (b<<16)] }; set cm=nil;; fun rflDestroyColorMap (wn, cm)= _DScursor cm.cursorColorMap; _DSbitmap cm.bcursorColorMap; _DSbitmap cm.backColorMap; _DSbitmap cm.workColorMap; _DSbitmap cm.rulerColorMap; _DSbitmap cm.sampleColorMap; exec cm.endColorMap with [nil]; set cm=nil;; fun rflCancelColorMap (wn, cm)= _DScursor cm.cursorColorMap; _DSbitmap cm.bcursorColorMap; _DSbitmap cm.backColorMap; _DSbitmap cm.workColorMap; _DSbitmap cm.rulerColorMap; _DSbitmap cm.sampleColorMap; _DSwindow cm.winColorMap; exec cm.endColorMap with [nil]; set cm=nil;; /* sample window */ fun rflPaintSColorMap (wn, cm)= _BLTbitmap wn cm.sampleColorMap 0 0;; /* ruler */ fun fillRuler (h, v, cm)= let (itof 1) /. itof 100 -> delta in let itof 1 -> float_1 in let itof 0 -> float_0 in let itof 200 -> float_200 in { let float_1 -> v in while v >. float_0 do { let hsv2rgb h float_1 v -> c in _DRAWrectangle cm.rulerColorMap 0 ftoi v*.float_200 10 3 DRAW_SOLID 1 c DRAW_SOLID c; set v = v -. delta; }; _DRAWrectangle cm.rulerColorMap 10 0 20 200 DRAW_SOLID 1 0xffffff DRAW_SOLID 0xffffff; let ftoi v*.itof 200 -> av in let mktab 3 [10 av] -> t in { set t.(0) = [20 av-5]; set t.(2) = [20 av+5]; _DRAWpoly16 cm.rulerColorMap 3 t DRAW_SOLID 1 0 DRAW_SOLID 0; } }; _PAINTwindow cm.rwinColorMap;; fun rflPaintRColorMap (wn, cm)= _BLTbitmap wn cm.rulerColorMap 0 0;; fun rflClickRColorMap (wn, cm, x, y, b)= let atoi _GETtext cm.hColorMap -> h in let atoi _GETtext cm.sColorMap -> s in let hsv2rgb itof h (itof s)/.itof 100 (itof y)/.itof 200 -> c in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* fill the ruler */ fillRuler itof h (itof y)/.itof 200 cm; /* set correct text */ _SETtext cm.vColorMap itoa y/2; /* draw bitmaps in the window */ _PAINTwindow cm.winColorMap; /* set correct text */ _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; };; fun rflUnclickRColorMap (wn, cm, x, y, b)= 0;; fun rflCursorMoveRColorMap (wn, cm, x, y, b)= if b == 1 then { if y<0 then set y = 0 else nil; if y>200 then set y = 200 else nil; let atoi _GETtext cm.hColorMap -> h in let atoi _GETtext cm.sColorMap -> s in let hsv2rgb itof h (itof s)/.itof 100 (itof y)/.itof 200 -> c in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* fill the ruler */ fillRuler itof h (itof y)/.itof 200 cm; /* set correct text */ _SETtext cm.vColorMap itoa (y/2); /* draw bitmaps in the window */ _PAINTwindow cm.winColorMap; /* set correct text */ _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; } } else nil;; /* color window */ fun rflPaintBColorMap (wn, cm)= _BLTbitmap wn cm.workColorMap 0 0;; fun rflClickBColorMap (wn, cm, x, y, b)= if b==1 then { /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-15 cm.oldsColorMap-15 cm.backColorMap cm.oldhColorMap-15 cm.oldsColorMap-15 31 31 nil; set cm.oldhColorMap = x; set cm.oldsColorMap = y; /* fill the ruler */ fillRuler itof x (itof atoi _GETtext cm.vColorMap)/.(itof 100) cm; /* draw bitmap in the window */ _PAINTwindow cm.winColorMap; _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.hColorMap nil nil; _CBtext cm.sColorMap nil nil; _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; let hsv2rgb itof x (itof y)/.itof 200 (itof atoi _GETtext cm.vColorMap)/.itof 100 -> c in { _FILLbitmap cm.sampleColorMap c; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; }; _SETtext cm.hColorMap itoa x; _SETtext cm.sColorMap itoa y/2; _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; _PAINTwindow cm.swinColorMap; } else nil;; fun rflUnclickBColorMap (wn, cm, x, y, b)= if b==1 then { if x>360 then set x=360 else nil; if x<0 then set x=0 else nil; if y>200 then set y=200 else nil; if y<0 then set y=0 else nil; _fooS "rflUnclickBColorMap"; /* trace new pointer */ _CPbitmap16 cm.workColorMap x-15 y-15 cm.bcursorColorMap 1 1 27 27 0xffffff; set cm.oldhColorMap = x; set cm.oldsColorMap = y; _PAINTwindow cm.bwinColorMap; } else nil;; fun rflCursorMoveBColorMap (wn, cm, x, y, b)= if b != 1 then nil else { if x>360 then set x=360 else nil; if x<0 then set x=0 else nil; if y>200 then set y=200 else nil; if y<0 then set y=0 else nil; let hsv2rgb itof x (itof y)/.itof 200 (itof atoi _GETtext cm.vColorMap)/.itof 100 -> c in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* fill the ruler */ fillRuler itof x (itof atoi _GETtext cm.vColorMap)/.itof 100 cm; /* set correct text */ _CBtext cm.hColorMap nil nil; _CBtext cm.sColorMap nil nil; _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _SETtext cm.hColorMap itoa x; _SETtext cm.sColorMap itoa y/2; _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; } };; fun rflRLine (l, cm)= let atoi _GETtext l -> r in let atoi _GETtext cm.gColorMap -> g in let atoi _GETtext cm.bColorMap -> b in let r+(g<<8)+(b<<16) -> c in let rgb2hsv c -> [fh fs fv] in let ftoi fh -> h in let ftoi (itof 100)*.fs -> s in let ftoi (itof 100)*.fv -> v in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 cm.backColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 32 32 nil; set cm.oldhColorMap = h; set cm.oldsColorMap = 2*s; /* trace new pointer */ _CPbitmap16 cm.workColorMap h-15 2*s-15 cm.bcursorColorMap 1 1 31 31 0xffffff; /* fill the ruler */ fillRuler fh fv cm; /* draw bitmap in the window */ _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.hColorMap nil nil; _CBtext cm.sColorMap nil nil; _CBtext cm.vColorMap nil nil; _SETtext cm.hColorMap itoa h; _SETtext cm.sColorMap itoa s; _SETtext cm.vColorMap itoa v; _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.vColorMap @rflVLine cm; };; fun rflGLine (l, cm)= let atoi _GETtext cm.rColorMap -> r in let atoi _GETtext l -> g in let atoi _GETtext cm.bColorMap -> b in let r+(g<<8)+(b<<16) -> c in let rgb2hsv c -> [fh fs fv] in let ftoi fh -> h in let ftoi (itof 100)*.fs -> s in let ftoi (itof 100)*.fv -> v in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-15 cm.oldsColorMap-15 cm.backColorMap cm.oldhColorMap-15 cm.oldsColorMap-15 32 32 nil; set cm.oldhColorMap = h; set cm.oldsColorMap = 2*s; /* trace new pointer */ _CPbitmap16 cm.workColorMap h-15 2*s-15 cm.bcursorColorMap 1 1 31 31 0xffffff; /* fill the ruler */ fillRuler fh fv cm; /* draw bitmap in the window */ _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.hColorMap nil nil; _CBtext cm.sColorMap nil nil; _CBtext cm.vColorMap nil nil; _SETtext cm.hColorMap itoa h; _SETtext cm.sColorMap itoa s; _SETtext cm.vColorMap itoa v; _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.vColorMap @rflVLine cm; };; fun rflBLine (l, cm)= let atoi _GETtext cm.rColorMap -> r in let atoi _GETtext cm.gColorMap -> g in let atoi _GETtext l -> b in let r+(g<<8)+(b<<16) -> c in let rgb2hsv c -> [fh fs fv] in let ftoi fh -> h in let ftoi (itof 100)*.fs -> s in let ftoi (itof 100)*.fv -> v in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 cm.backColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 32 32 nil; set cm.oldhColorMap = h; set cm.oldsColorMap = 2*s; /* trace new pointer */ _CPbitmap16 cm.workColorMap h-15 2*s-15 cm.bcursorColorMap 1 1 31 31 0xffffff; /* fill the ruler */ fillRuler fh fv cm; /* draw bitmap in the window */ _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.hColorMap nil nil; _CBtext cm.sColorMap nil nil; _CBtext cm.vColorMap nil nil; _SETtext cm.hColorMap itoa h; _SETtext cm.sColorMap itoa s; _SETtext cm.vColorMap itoa v; _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.vColorMap @rflVLine cm; };; fun rflHLine (l, cm)= let atoi _GETtext l -> h in let atoi _GETtext cm.sColorMap -> s in let atoi _GETtext cm.vColorMap -> v in let hsv2rgb itof h (itof s)/.itof 100 (itof v)/.itof 100 -> c in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 cm.backColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 32 32 nil; set cm.oldhColorMap = h; /* trace new pointer */ _CPbitmap16 cm.workColorMap h-15 2*s-15 cm.bcursorColorMap 1 1 31 31 0xffffff; /* fill the ruler */ fillRuler itof h (itof v)/.itof 100 cm; /* draw bitmap in the window */ _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; };; fun rflSLine (l, cm)= let atoi _GETtext cm.hColorMap -> h in let atoi _GETtext l -> s in let atoi _GETtext cm.vColorMap -> v in let hsv2rgb itof h (itof s)/.itof 100 (itof v)/.itof 100 -> c in { _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* erase old pointer */ _CPbitmap16 cm.workColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 cm.backColorMap cm.oldhColorMap-16 cm.oldsColorMap-16 32 32 nil; set cm.oldsColorMap = 2*s; /* trace new pointer */ _CPbitmap16 cm.workColorMap h-15 2*s-15 cm.bcursorColorMap 1 1 31 31 0xffffff; /* fill the ruler */ fillRuler itof h (itof v)/.itof 100 cm; /* draw bitmap in the window */ _PAINTwindow cm.bwinColorMap; /* set correct text */ _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; };; fun rflVLine (l, cm)= let atoi _GETtext cm.hColorMap -> h in let atoi _GETtext cm.sColorMap -> s in let atoi _GETtext l -> v in let hsv2rgb itof h (itof s)/.itof 100 (itof v)/.itof 100 -> c in { /* fill the ruler */ fillRuler itof h (itof v)/.itof 100 cm; /* sample */ _FILLbitmap cm.sampleColorMap c; _PAINTwindow cm.swinColorMap; /* set correct text */ _CBtext cm.rColorMap nil nil; _CBtext cm.gColorMap nil nil; _CBtext cm.bColorMap nil nil; _SETtext cm.rColorMap itoa c&255; _SETtext cm.gColorMap itoa (c>>8)&255; _SETtext cm.bColorMap itoa (c>>16)&255; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; };; fun _CRcolorMap (ch, father, x, y, title, end, color)= if (ch==nil) || (x==nil) || (y==nil) || (x<0) || (y<0) then nil else let if title==nil then "" else title -> title in let if color==nil then [0 0 0] else [(color>>16)&255 (color>>8)&255 color&255] ->[bc gc rc] in let rgb2hsv color -> [hc sc vc] in let _CRwindow ch father x y 400 310 WN_MENU+WN_MINBOX title -> win in let _CRwindow ch win 5 5 360 204 WN_DOWN+WN_CHILD title -> bwin in let _CRwindow ch win 5 215 40 40 WN_DOWN+WN_CHILD title -> swin in let _CRwindow ch win 368 5 22 204 WN_DOWN+WN_CHILD title -> rwin in let _CRbitmap ch 360 200 -> work in let _FILLbitmap _CRbitmap ch 20 200 0xbfbfbf -> ruler in let _CRbitmap ch 40 40 -> sample in let _LDbitmap ch _checkpack "dms/lib/_mcolormap.bmp" -> back in let _LDbitmap ch _checkpack "dms/lib/opencross.bmp" -> bcursor in let _CRcursor ch bcursor 16 16 0x000000 0xff0000 -> cursor in let _CReditLine ch win 75 215 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa ftoi hc -> h in let _CReditLine ch win 195 215 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa ftoi (sc*.itof 100) -> s in let _CReditLine ch win 315 215 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa ftoi (vc*.itof 100) -> v in let _CReditLine ch win 75 240 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa rc -> r in let _CReditLine ch win 195 240 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa gc -> g in let _CReditLine ch win 315 240 75 20 ET_NUMBER|ET_DOWN|ET_ALIGN_RIGHT itoa bc -> b in let mkColorMap [ch win bwin swin rwin cursor bcursor back work ruler sample r g b h s v ftoi hc 2*ftoi (sc*.itof 100) end] -> cm in let _CBbutton _CRbutton ch win 80 285 80 20 0 "Ok" @rflOkColorMap cm -> ok in let _CBbutton _CRbutton ch win 240 285 80 20 0 "Cancel" @rflCancelColorMap cm -> cancel in { _CRtext ch win 50 215 20 20 ET_ALIGN_CENTER "H"; _CRtext ch win 160 215 30 20 ET_ALIGN_CENTER "S"; _CRtext ch win 280 215 30 20 ET_ALIGN_CENTER "V"; _CRtext ch win 50 240 20 20 ET_ALIGN_CENTER "R"; _CRtext ch win 160 240 30 20 ET_ALIGN_CENTER "G"; _CRtext ch win 280 240 30 20 ET_ALIGN_CENTER "B"; /* editlines reflexes */ _CBtext cm.hColorMap @rflHLine cm; _CBtext cm.sColorMap @rflSLine cm; _CBtext cm.vColorMap @rflVLine cm; _CBtext cm.rColorMap @rflRLine cm; _CBtext cm.gColorMap @rflGLine cm; _CBtext cm.bColorMap @rflBLine cm; /* ruler window */ _CBwinPaint rwin @rflPaintRColorMap cm; _CBwinClick rwin @rflClickRColorMap cm; _CBwinUnclick rwin @rflUnclickRColorMap cm; _CBcursorMove rwin @rflCursorMoveRColorMap cm; fillRuler hc vc cm; /* samle window */ _FILLbitmap sample color; _CBwinPaint swin @rflPaintSColorMap cm; /* workwindow reflexes */ _CBwinPaint bwin @rflPaintBColorMap cm; _CBwinClick bwin @rflClickBColorMap cm; _CBwinDClick bwin @rflClickBColorMap cm; _CBwinUnclick bwin @rflUnclickBColorMap cm; _CBcursorMove bwin @rflCursorMoveBColorMap cm; _CPbitmap16 work 0 0 back 0 0 360 200 nil; /* trace pointer on work */ _CPbitmap16 work (ftoi hc)-15 (2*ftoi sc*.itof 100)-15 bcursor 1 1 31 31 0xffffff; /* draw bitmaps in the window */ _PAINTwindow win; _PAINTwindow bwin; _PAINTwindow swin; cm };; /*** END COULEUR ****/ /********************************************************/ /***** MISCELLEANOUS ************/ /***** ************/ /********************************************************/ // compare deux chaînes fun compString(s1, s2)= !strcmp s1 s2;; // compare deux ObjNode (ou autres !) fun compObjNode(node1, node2)= node1 == node2;; // trouve la position d'un bouton dans la liste des boutons (module Button) // en fonction du container bitmap fun posButtonInModButton(l, f, b)= if l == nil then nil else let hd l -> [_ o _ _ _ _] in if exec f with [o b] then 0 else 1 + posButtonInModButton tl l f b;; // trouve la position d'un bouton dans la liste des boutons (module Button) // en fonction du nom donné dans l'éditeur fun posButtonInModButtonName(l, f, b)= if l == nil then nil else let hd l -> [_ _ _ m _ _] in if exec f with [m b] then 0 else 1 + posButtonInModButtonName tl l f b;; // remplace le énième élément de la liste des boutons intégrés fun replaceNthButtonInModButton(l, n, b)= if n < 0 then l else if n == 0 then b::(tl l) else (hd l)::replaceNthButtonInModButton tl l n-1 b;; // remplace un élément par un autre dans la liste des boutons intégrés fun replaceButtonInModButton(l, old, new)= if l == nil then nil else if (hd l) == old then new::(tl l) else (hd l)::replaceButtonInModButton tl l old new;; // retourne le bitmap créé fun crBmp(file)= if file == nil then nil else let _LDbitmap _channel _checkpack file -> bmp in if bmp == nil then _LDjpeg _channel _checkpack file else bmp;; // retourne la liste des fichiers bmp ou jpeg contenus dans un repertoire fun searchImageInFolder(l, r)= if l == nil then r else let strlen hd l -> n in let substr hd l n-2 2 -> ext in if (!strcmpi ext "bmp") || (!strcmpi ext "jpg") then set r = (hd l)::r else searchImageInFolder tl l r;; // ajoute des items sous forme de liste à un ObjBox. // Le parametre supplémentaire indique la longueur à prendre en compe de chaque elt de la liste (0 pour tt prendre) fun addItemsInBox(obj, l, n)= if l == nil then obj else let if n == 0 then hd l else substr hd l (strlen hd l)-n n -> item in ( _ADDlist obj 0 item; addItemsInBox obj tl l n );; // miroir d'une liste fun listcat(p, q)= if p == nil then q else let p -> [h nxt] in h::listcat nxt q;; fun mirror(list)= if list == nil then nil else let list -> [first next] in listcat mirror next first::nil;; // retourne l'élt correspondant de d3dObj en fonction de l'objet 3d // fun [[[H3d [HMat3d r1] [I I I] [I I I] S] r1] H3d] [H3d [HMat3d r1] [I I I] [I I I] S] fun returnEltD3dobjH(l, H)= if l == nil then nil else let hd l -> [h _ _ _ _] in if h == H then hd l else returnEltD3dobjH tl l H;; /********************************************************/ /***** COMENTAIRES ************/ /***** ************/ /********************************************************/ fun chgComment(ref)= _SETtextRichText amain.commenttext _loc ref "Arial" 10 0 0;; fun bubbleEnd2(obj, u)= _deltimer u;; fun bubbleEnd()= _DScontainer contBubble; set contBubble = nil; 0;; fun bubbleTimer(obj, u)= bubbleEnd;; fun bubble(x, y, s)= if strcmp s oldbubble then ( bubbleEnd; set oldbubble = s; let _starttimer _channel 5000 -> t in let _CRfont _channel 14 0 0 "Arial" -> font in let _GETstringSize font s -> [w h] in let _CRcontainerFromObjWin _channel amain.win x+5 y+5 w+10 h+10 CO_NOCAPTION make_rgb 255 255 100 nil -> c in let _CRcompText _channel c nil [5 5] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 w h s font [0 0 0 0] [0 0] nil nil -> _ in ( set contBubble = c; _PAINTcontainer c; _rfltimer t @bubbleTimer 0; _CBcontainerDestroy c @bubbleEnd2 t; 0 ) ) else 0;; /********************************************************/ /***** DESTRUCTION ************/ /***** ************/ /********************************************************/ fun dsContBmp(comp)= _DScompBitmap comp; _PAINTcontainer amain.maincont; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** GESTION DES MODULES ************/ /***** ************/ /********************************************************/ // ALL MODULES fun dsEditor()= dsContBmp acont.contBMPeditor; 0;; fun creaBMPmod(fic, nom)= let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> [bmp _] in let _DRAWtext _FILLbitmap _CRbitmap _channel 40 44 make_rgb 140 180 220 _CRfont _channel 12 0 0 "Arial" 20 42 TD_BOTTOM|TD_CENTER 0 nom -> bg in let _CRalphaBitmap _channel _SCPbitmap bg 7 5 7+25 5+25 bmp 0 0 25 25 0 nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _DSbitmap bg -> _ in abmp;; fun testNameOfModule(l, s)= // pour button if l == nil then s else let hd l -> [_ _ _ m _ _] in if !strcmp m s then ( set s = strcat "new_" s; testNameOfModule modButton s ) else testNameOfModule tl l s;; // LOGIN fun cbClickModLogin(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modLogin.dloginClicked = 1 else 0;; fun cbMoveModLogin(obj, u, xm, ym, mask)= if modLogin.dloginClicked && mask == MK_LBUTTON then let modLogin.dloginPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates modLogin.dcontloginBMP [x y] 1; set modLogin.dloginPos = [x y]; ) else ( set modLogin.dloginClicked = 0; nil ); 0;; fun cbUnclickModLogin(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modLogin.dloginClicked = 0 else 0;; // PHOTO3 fun cbClickModPhoto(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modPhoto.dphotoClicked = 1 else 0;; fun cbMoveModPhoto(obj, u, xm, ym, mask)= if modPhoto.dphotoClicked && mask == MK_LBUTTON then let modPhoto.dphotoPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates modPhoto.dcontphotoBMP [x y] 1; set modPhoto.dphotoPos = [x y]; ) else ( set modPhoto.dphotoClicked = 0; nil ); 0;; fun cbUnclickModPhoto(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modPhoto.dphotoClicked = 0 else 0;; // BUTTON fun cbClickModButton(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then let posButtonInModButton modButton @compObjNode obj -> i in let nth_list modButton i -> [a b c d e _] in set modButton = replaceNthButtonInModButton modButton i [a b c d e 1] else nil;; fun cbUnclickModButton(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then let posButtonInModButton modButton @compObjNode obj -> i in let nth_list modButton i -> [a b c d e _] in set modButton = replaceNthButtonInModButton modButton i [a b c d e 0] else nil;; fun cbMoveModButton(obj, u, xm, ym, mask)= let posButtonInModButton modButton @compObjNode obj -> i in let nth_list modButton i -> [o c p m [xi yi] val] in if val && mask == MK_LBUTTON then let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates o [x y] 1; set modButton = replaceNthButtonInModButton modButton i [o c p m [x y] val] ) else set modButton = replaceNthButtonInModButton modButton i [o c p m [xi yi] 0]; 0;; fun validEditorButton(name, edit)= dsEditor; let creaBMPmod "button.scs.png" name -> abmp in let _CRcompBitmap _channel amain.maincont nil [22 110] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModButton 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModButton 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModButton 0 -> _ in ( set modButton = ([_CONVERTcompBitmapToObjNode c c "button.scs.png" name [22 110] 0])::modButton; _PAINTcontainer amain.maincont; 0 );; fun cbClickBMPeditorButton(obj, u, xm, ym, btn, mask)= let u -> [fic X Y w h t c edit] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in let testNameOfModule modButton _GETcompText t -> name in ( if ((x > 107 && x < 107+57) || (x > 245 && x < 245+83)) && (y > 91 && y < 91+22) then // ok et appliquer ( _DScontainer c; validEditorButton name edit ) else if (x > 165 && x < 165+72) && (y > 91 && y < 91+22) then // annuler ( _DScontainer c; dsEditor ) else if (x > 306 && x < 306+24) && (y > 38 && y < 38+24) then // help let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in ( _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/button/help." strcat l ".htm"; 0 ) else 0 );; fun cbMoveBMPeditorButton(obj, u, xm, ym, mask)= 0;; fun creaCompBmpEditorButton(fic, x, y, m, edit)= // b -> tab du button edit -> rééedition du module let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in // let b -> [node c p m [xi yi] clic] in ( set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; let if edit then m else testNameOfModule modButton m -> name in let _CRcontainerFromObjCont _channel amain.maincont x+84 y+50 209 18 CO_CHILDINSIDE make_rgb 200 200 200 nil -> c in let _CRcompText _channel c nil [2 2] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE 0 207 15 name _CRfont _channel 12 0 0 "Arial" [0 0 0 0] [0 90] nil nil -> t in ( _PAINTcontainer c; _CBcompBitmapClick acont.contBMPeditor @cbClickBMPeditorButton [fic x y w h t c edit]; _CBcompBitmapCursorMove acont.contBMPeditor @cbMoveBMPeditorButton [fic x y w h t c]; ); _PAINTcontainer amain.maincont; 0 );; // COLORTERM fun cbClickModCT(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modCT.dCTClicked = 1 else 0;; fun cbMoveModCT(obj, u, xm, ym, mask)= if modCT.dCTClicked && mask == MK_LBUTTON then let modCT.dCTPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates modCT.dcontCTBMP [x y] 1; set modCT.dCTPos = [x y]; ) else ( set modCT.dCTClicked = 0; nil ); 0;; fun cbUnclickModCT(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modCT.dCTClicked = 0 else 0;; fun endColorCT(c, flag)= let _GETalphaBitmaps modCT.dCTabmp -> [bmp _] in if flag == 1 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 100 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTbg = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else if flag == 2 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 125 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTsys1 = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else if flag == 3 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 150 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTsys2 = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else if flag == 4 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 175 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTlogin = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else if flag == 5 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 200 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTaction = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else if flag == 6 then ( set modCT.dCTabmp = _CRalphaBitmap _channel _DRAWrectangle bmp 340 315 15 15 DRAW_SOLID 1 0 DRAW_SOLID c nil nil nil; set modCT.dCTsaisie = c; creaCompBmpEditorColorTerm nil 1 20 20 ) else 0;; fun cbClickBMPeditorCT(obj, u, xm, ym, btn, mask)= let u -> [fic X Y] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if x > 340 && x < 340+16 && y > 100 && y < 100+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 1 0xffffff else if x > 340 && x < 340+16 && y > 125 && y < 125+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 2 0xffffff else if x > 340 && x < 340+16 && y > 150 && y < 150+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 3 0xffffff else if x > 340 && x < 340+16 && y > 175 && y < 175+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 4 0xffffff else if x > 340 && x < 340+16 && y > 200 && y < 200+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 5 0xffffff else if x > 340 && x < 340+16 && y > 315 && y < 315+16 then _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" mkfun2 @endColorCT 6 0xffffff else if (x > 148 && x < 148+51 && y > 441 && y < 441+20) || (x > 284 && x < 284+83 && y > 441 && y < 441+20) then ( validEditor "ct"; nil ) else if x > 345 && x < 345+25 && y > 36 && y < 36+25 then ( let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/ct/help." strcat l ".htm"; nil ) else nil; 0;; fun cbMoveBMPeditorCT(obj, u, xm, ym, mask)= 0;; fun cbResizeBMPeditorCT(obj, u, w, h, oldcoord)= [u oldcoord];; /* fic -> S : nom du fichier graphique flag -> I : 0 = création à partir de fic, 1 = création à partir de modCT.dCTabmp x -> I : pos x y -> I : pos y <- I : inutilisé */ fun creaCompBmpEditorColorTerm(fic, flag, x, y)= if !flag then let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set modCT.dCTabmp = abmp; dsContBmp acont.contBMPeditor; set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 modCT.dCTabmp 0 0 w h; ) else let _GETalphaBitmapSize modCT.dCTabmp -> [w h] in ( dsContBmp acont.contBMPeditor; set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 modCT.dCTabmp 0 0 w h; ); _CBcompBitmapClick acont.contBMPeditor @cbClickBMPeditorCT [fic x y]; _CBcompBitmapCursorMove acont.contBMPeditor @cbMoveBMPeditorCT [fic x y]; _CBcompBitmapResizeResource acont.contBMPeditor @cbResizeBMPeditorCT modCT.dCTabmp; _PAINTcontainer amain.maincont; 0;; // CONTACT fun cbClickModCo(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modCo.dCoClicked = 1 else 0;; fun cbMoveModCo(obj, u, xm, ym, mask)= if modCo.dCoClicked && mask == MK_LBUTTON then let modCT.dCTPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates modCo.dcontCoBMP [x y] 1; set modCo.dCoPos = [x y]; ) else ( set modCo.dCoClicked = 0; nil ); 0;; fun cbUnclickModCo(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modCo.dCoClicked = 0 else 0;; fun cbClickBMPeditorCo(obj, u, xm, ym, btn, mask)= let u -> [fic X Y] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if x > 10 && x < 10+145 && y > 80 && y < 80+20 then let _GETalphaBitmaps modCo.dCoAbmp -> [bmp _] in ( set modCo.dCoAuto = !modCo.dCoAuto; if !modCo.dCoAuto then set modCo.dCoAbmp = _CRalphaBitmap _channel _DRAWtext bmp _CRfont _channel 16 0 0 "Arial" 19 80 TD_TOP|TD_LEFT 0 "x" nil nil nil else set modCo.dCoAbmp = _CRalphaBitmap _channel _DRAWrectangle bmp 18 85 9 9 DRAW_INVISIBLE 0 0 DRAW_SOLID 0xffffff nil nil nil; creaCompBmpEditorContact nil 1 20 20; 0 ) else if x > 307 && x < 307+24 && y > 38 && y < 38+24 then ( let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/contact/help." strcat l ".htm"; 0 ) else if ((x > 108 && x < 108+50) || (x > 244 && x < 244+85)) && (y > 169 && y < 169+20) then validEditor "contact" else 0;; fun cbMoveBMPeditorCo(obj, u, xm, ym, mask)= 0;; fun creaCompBmpEditorContact(fic, flag, x, y)= if !flag then let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( dsContBmp acont.contBMPeditor; set modCo.dCoAbmp = abmp; set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 modCo.dCoAbmp 0 0 w h; ) else let _GETalphaBitmapSize modCo.dCoAbmp -> [w h] in ( dsContBmp acont.contBMPeditor; set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 modCo.dCoAbmp 0 0 w h; ); _CBcompBitmapClick acont.contBMPeditor @cbClickBMPeditorCo [fic x y]; _CBcompBitmapCursorMove acont.contBMPeditor @cbMoveBMPeditorCo [fic x y]; _PAINTcontainer amain.maincont; 0;; // INOUT fun cbClickModIo(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modIo.dIoClicked = 1 else 0;; fun cbMoveModIo(obj, u, xm, ym, mask)= if modIo.dIoClicked && mask == MK_LBUTTON then let modIo.dIoPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates modIo.dcontIoBMP [x y] 1; set modIo.dIoPos = [x y]; ) else ( set modIo.dIoClicked = 0; nil ); 0;; fun cbUnclickModIo(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set modIo.dIoClicked = 0 else 0;; // C3D3 (icône sur le shell) fun cbClickModC3d3(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set mod3d.d3dClicked = 1 else 0;; fun cbMoveModC3d3(obj, u, xm, ym, mask)= if mod3d.d3dClicked && mask == MK_LBUTTON then let mod3d.d3dPos -> [xi yi] in let xi + (xm - xi) - 20 -> x in let yi + (ym - yi) - 22 -> y in ( _CHANGEobjNodeCoordinates mod3d.dcont3dBMP [x y] 1; set mod3d.d3dPos = [x y]; ) else ( set mod3d.d3dClicked = 0; nil ); 0;; fun cbUnclickModC3d3(obj, u, xm, ym, btn, mask)= if btn == LBUTTON then set mod3d.d3dClicked = 0 else 0;; // MAIN MODULES fun validEditor(m)= dsContBmp acont.contBMPeditor; if !strcmp m "login" then ( let creaBMPmod modLogin.dloginBMP modLogin.dloginName -> abmp in let _CRcompBitmap _channel amain.maincont nil modLogin.dloginPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModLogin 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModLogin 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModLogin 0 -> _ in set modLogin.dcontloginBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else if !strcmp m "photo3" then ( let creaBMPmod modPhoto.dphotoBMP modPhoto.dphotoName -> abmp in let _CRcompBitmap _channel amain.maincont nil modPhoto.dphotoPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModPhoto 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModPhoto 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModPhoto 0 -> _ in set modPhoto.dcontphotoBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else if !strcmp m "ct" then ( let creaBMPmod modCT.dCTBMP modCT.dCTName -> abmp in let _CRcompBitmap _channel amain.maincont nil modCT.dCTPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModCT 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModCT 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModCT 0 -> _ in set modCT.dcontCTBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else if !strcmp m "contact" then ( let creaBMPmod modCo.dCoBMP modCo.dCoName -> abmp in let _CRcompBitmap _channel amain.maincont nil modCo.dCoPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModCo 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModCo 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModCo 0 -> _ in set modCo.dcontCoBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else if !strcmp m "io" then ( let creaBMPmod modIo.dIoBMP modIo.dIoName -> abmp in let _CRcompBitmap _channel amain.maincont nil modIo.dIoPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModIo 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModIo 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModIo 0 -> _ in set modIo.dcontIoBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else if !strcmp m "c3d3" then ( let creaBMPmod hd mod3d.d3dBMP mod3d.d3dName -> abmp in let _CRcompBitmap _channel amain.maincont nil mod3d.d3dPos OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 40 44 -> c in let _CBcompBitmapClick c @cbClickModC3d3 0 -> _ in let _CBcompBitmapCursorMove c @cbMoveModC3d3 0 -> _ in let _CBcompBitmapUnClick c @cbUnclickModC3d3 0 -> _ in set mod3d.dcont3dBMP = _CONVERTcompBitmapToObjNode c; _PAINTcontainer amain.maincont; 0 ) else 0;; /********************************************************/ /***** C3D3 ************/ /***** ************/ /********************************************************/ // MAT. ECLAIRE fun c3d3_chgMatLight()= let mod3d.d3dHMatSelect -> [h mat] in M3setType mod3d.session mat ((M3getType mod3d.session mat) & (~MAT_LIGHT)); 0;; // TRANSPARENCE fun c3d3_chgTransparencyPaint(obj, u)= _BLTbitmap obj u 1 1 ;; fun c3d3_chgTransparencyEnd(obj, u)= let u -> [wn bmp] in ( _DSbitmap bmp; _DSwindow wn ) ;; fun c3d3_chgTransprency()= let _CRwindow _channel amain.win 80 50 300 100 WN_MENU _loc "TITLE_3D_TRANSPARENCY" -> wn in let strcat mylang ".png" -> suff in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/c3d3_transp." suff -> [bmp _] in let _CRbutton _channel wn 5 75 70 20 0 "OK" -> ok in let _CRbutton _channel wn 220 75 70 20 0 _loc2 "CANCEL" -> cancel in ( _CBwinPaint wn @c3d3_chgTransparencyPaint bmp; _CBwinDestroy wn @c3d3_chgTransparencyEnd [wn bmp]; _CBbutton ok @c3d3_chgTransparencyEnd [wn bmp]; _CBbutton cancel @c3d3_chgTransparencyEnd [wn bmp]; 0 ) ;; // CHANGE FILTRE fun c3d3_chgFiltrePaint(obj, u)= ( _BLTbitmap obj u 70 30; _BLTbitmap obj mod3d.d3dBmpTemp 5 30; );; fun c3d3_chgFiltreEnd(obj, u)= let u -> [wn filtre] in ( _DSbitmap mod3d.d3dBmpTemp; _DSbitmap filtre; _DSwindow wn );; fun c3d3_chgFiltre()= let mod3d.d3dHMatSelect -> [h mat] in let M3textureName mod3d.session M3textureFromMaterial mod3d.session mat -> nom in let _CRwindow _channel amain.win 80 50 340 400 WN_MENU _loc "TITLE_3D_FILTER" -> wn in let _CRtext _channel wn 5 5 310 20 ET_BORDER|ET_AHSCROLL nom -> _ in let strcat mylang ".png" -> suff in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/filtre3d." suff -> [filtre _] in let _CRbutton _channel wn 5 375 70 20 0 "OK" -> ok in let _CRbutton _channel wn 80 375 70 20 0 _loc2 "CANCEL" -> cancel in let crBmp nom -> bmp2 in let _GETbitmapSize bmp2 -> [w h] in let _CRbitmap _channel 64 64 -> bmp in ( _CBwinDestroy wn @c3d3_chgFiltreEnd [wn filtre]; _CBwinPaint wn @c3d3_chgFiltrePaint filtre; _CBbutton ok @c3d3_chgFiltreEnd [wn filtre]; _CBbutton cancel @c3d3_chgFiltreEnd [wn filtre]; set mod3d.d3dBmpTemp = _SCPbitmap bmp 0 0 64 64 bmp2 0 0 w h nil; _DSbitmap bmp2; ); 0;; // CHANGE FLAT COLOR fun endColorC3D3ColorFlat(color)= let mod3d.d3dHMatSelect -> [h mat] in M3setMaterialFlat mod3d.session mat color;; fun c3d3_cnhgFlatColor()= let mod3d.d3dHMatSelect -> [h mat] in let M3getMaterialFlat mod3d.session mat -> c in _CRcolorMap _channel amain.win 50 50 _loc "TITLE_CHOOSE_COLOR" @endColorC3D3ColorFlat c; 0;; // CHANGE TEXTURE fun c3d3_chgTextureEnd(obj, u)= _DSbitmap mod3d.d3dBmpTemp; set mod3d.d3dBmpTemp = nil; _DSwindow obj;; fun c3d3_chgTextureOk(obj, u)= _DSwindow u; _DSbitmap mod3d.d3dBmpTemp; 0;; fun c3d3_chgTextureChgPaint(obj, u)= let u -> [_ arbo] in ( _CLRwindow obj; _BLTbitmap obj mod3d.d3dBmpTemp 5 210; _BLTbitmap obj arbo 5 30 );; fun c3d3_chgTextureChgClickList(obj, u, i, s)= set mod3d.d3dBmpTemp = crBmp strcat defPath strcat "rsc3d/" s; let u -> [wn2 arbo] in c3d3_chgTextureChgPaint wn2 [nil arbo];; fun c3d3_chgTextureChgCancel(obj, u)= let u -> [wn2 _ arbo] in ( _DSbitmap arbo; _DSwindow wn2 );; fun c3d3_chgTextureChgOk(obj, u)= let u -> [wn2 list _ arbo h3d nom mat] in let _GETlist list -> s in let returnEltD3dobjH mod3d.d3dObj h3d -> [h mats pos ang path] in let M3copyMaterialTexture mod3d.session mat -> tex in ( M3blitTexture16 mod3d.session tex mod3d.d3dBmpTemp; c3d3_chgTextureChgPaint wn2 [arbo nil]; c3d3_chgTextureChgCancel nil [wn2 nil arbo]; 0 );; fun c3d3_chgTextureChg(obj, u)= let u -> [wn nom h3d mat] in let _CRwindow _channel wn 100 50 450 500 WN_MENU _loc "TITLE_3D_SELECTTEXTURE" -> wn2 in let _CRtext _channel wn2 5 5 440 20 ET_BORDER nom -> text in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack strcat defPath "img/addobjectarbo.png" -> [arbo _] in let crBmp nom -> bmp in let _CRlist _channel wn2 295 30 150 565 LB_DOWN -> list in let addItemsInBox list mirror "applets/scs/rsc3d/bed3009a.jpg"::"applets/scs/rsc3d/bed3010a.jpg":: "applets/scs/rsc3d/bed3010e.jpg"::"applets/scs/rsc3d/bed3011a.jpg":: "applets/scs/rsc3d/bed3011f.jpg"::"applets/scs/rsc3d/bed3012a.jpg":: "applets/scs/rsc3d/bed3013a.jpg"::"applets/scs/rsc3d/cei3020e.jpg":: "applets/scs/rsc3d/cei3021e.jpg"::"applets/scs/rsc3d/cei3022e.jpg":: "applets/scs/rsc3d/dor3001d.jpg"::"applets/scs/rsc3d/gro3016e.jpg":: "applets/scs/rsc3d/lea3001b.jpg"::"applets/scs/rsc3d/met3001b.jpg":: "applets/scs/rsc3d/sid3001d.jpg"::"applets/scs/rsc3d/sid3002d.jpg":: "applets/scs/rsc3d/sid3004f.jpg"::"applets/scs/rsc3d/sid3005d.jpg":: "applets/scs/rsc3d/stn3004f.jpg"::"applets/scs/rsc3d/wal3005e.jpg":: "applets/scs/rsc3d/wal3006e.jpg"::"applets/scs/rsc3d/woo3001b.jpg":: "applets/scs/rsc3d/woo3017e.jpg"::nil 12 -> _ in let _CRbutton _channel wn2 5 475 70 20 0 "OK" -> ok2 in let _CRbutton _channel wn2 80 475 70 20 0 _loc2 "CANCEL" -> cancel2 in ( _CBwinPaint wn2 @c3d3_chgTextureChgPaint [nil arbo]; _CBlistClick list @c3d3_chgTextureChgClickList [wn2 arbo]; _CBbutton cancel2 @c3d3_chgTextureChgCancel [wn2 nil arbo]; _CBbutton ok2 @c3d3_chgTextureChgOk [wn2 list nil arbo h3d nom mat]; ); 0;; fun c3d3_chgTexturePaint(obj, u)= _CLRwindow obj; _BLTbitmap obj mod3d.d3dBmpTemp 5 30;; fun c3d3_chgTextureCancel(obj, u)= c3d3_chgTextureEnd u mod3d.d3dBmpTemp;; fun c3d3_chgTexture()= let mod3d.d3dHMatSelect -> [h mat] in let M3textureName mod3d.session M3textureFromMaterial mod3d.session mat -> nom in let M3materialName mod3d.session mat -> m in let crBmp nom -> bmp in let _CRwindow _channel amain.win 80 30 300 380 WN_MENU m -> wn in let _CRtext _channel wn 5 5 290 20 ET_BORDER|ET_AHSCROLL nom -> text in let _CRbutton _channel wn 20 320 260 20 0 _loc "BTN_3D_CONVERTBMP2JPG" -> _ in let _CRbutton _channel wn 5 350 70 20 0 "OK" -> ok in let _CRbutton _channel wn 100 350 70 20 0 _loc2 "CANCEL" -> cancel in let _CRbutton _channel wn 190 350 70 20 0 _loc2 "CHANGE" -> chg in ( set mod3d.d3dBmpTemp = bmp; _CBwinDestroy wn @c3d3_chgTextureEnd 0; _CBwinPaint wn @c3d3_chgTexturePaint 0; _CBbutton ok @c3d3_chgTextureOk wn; _CBbutton chg @c3d3_chgTextureChg [wn nom h mat]; _CBbutton cancel @c3d3_chgTextureCancel wn; _PAINTwindow wn; ); 0;; // BOITE DE DEPLACEMENTS (.box) /* ajoute la boîte de déplacement */ fun c3d3_addCelBox()= set mod3d.scelbox = MBOXcreate _channel 200 600; MBOXload mod3d.scelbox strcat defPath "rsc3d/ROO3001.BOX"; let M3getObjVec mod3d.session M3getFather mod3d.session mod3d.cam -> [x y z] in let MBOXprojection mod3d.scelbox [x y z] 10 -> [b pos] in set mod3d.celbox = b; 0;; fun c3d3_RepAddCelBox(obj, u, rep)= if rep then c3d3_addCelBox else 0;; /* demande si ajout de la boite de déplacement */ fun c3d3_AskAddCelBox()= _DLGrflmessage _DLGMessageBox _channel amain.win "Question" _loc "C3D3_CELBOX_MSG" 2 @c3d3_RepAddCelBox 0; 0;; /* teste si l'avatar est dans ou hors de la boîte de déplacement */ fun c3d3_box_test()= let M3getObjVec mod3d.session M3getFather mod3d.session mod3d.cam -> pos in let MBOXmove mod3d.scelbox mod3d.celbox pos 10 -> [_ p] in M3setObjVec mod3d.session M3getFather mod3d.session mod3d.cam p; 0;; // ADD OBJECT fun addObjectSearchMeshName(l)= if l == nil then nil else if !strcmpi hd hd l "mesh" then hd tl hd l else addObjectSearchMeshName tl l;; fun cbAddObjectTimer(obj, u)= let u -> [addObjectSession addObjectCam addObjectBuffer wn] in ( M3rotateObj addObjectSession mod3d.d3dAddObjectSelected [45 80 25]; MX3render addObjectSession addObjectBuffer addObjectCam 0 0 make_rgb 200 200 200; _BLTsurface wn 5 210 addObjectBuffer 0 0 256 256 );; fun cbAddObjectClickList(obj, u, pos, s)= let u -> [addObjectSession addObjectShell addObjectBuffer addObjectCam wn fic] in let addObjectSearchMeshName strextr _getpack _checkpack strcat defPath strcat "rsc3d/" s -> nom in let M3load addObjectSession strcat defPath strcat "rsc3d/" s addObjectShell -> _ in ( _SETtext fic strcat defPath strcat "rsc3d/" s; M3delObj addObjectSession mod3d.d3dAddObjectSelected; set mod3d.d3dAddObjectSelected = M3getObj addObjectSession nom; set mod3d.d3dAddObjectSelectedFile = /*strcat defPath strcat "rsc3d/"*/ s; M3link addObjectSession mod3d.d3dAddObjectSelected addObjectShell; M3recursFillMatObj addObjectSession addObjectShell; M3setObjVec addObjectSession mod3d.d3dAddObjectSelected [0 0 0]; M3setObjAng addObjectSession mod3d.d3dAddObjectSelected [0 0 0]; set mod3d.d3dAddObjectTimer = _rfltimer _starttimer _channel 10 @cbAddObjectTimer [addObjectSession addObjectCam addObjectBuffer wn]; ); 0;; fun addObjectOK(addObjectSession)= let addObjectSearchMeshName strextr _getpack _checkpack strcat defPath strcat "rsc3d/" mod3d.d3dAddObjectSelectedFile -> nom in let M3load mod3d.session strcat defPath strcat "rsc3d/" mod3d.d3dAddObjectSelectedFile mod3d.shell -> _ in let M3getObj mod3d.session nom -> h in let M3listOfMaterials mod3d.session h -> lmat in ( M3link mod3d.session h mod3d.shell; M3recursFillMatObj mod3d.session mod3d.shell; M3setObjVec mod3d.session h [0 0 0]; M3setObjAng mod3d.session h [0 0 0]; // set mod3d.d3dObjectAdded = h::mod3d.d3dObjectAdded; set mod3d.d3dObj = [h lmat [0 0 0] [0 0 0] mod3d.d3dAddObjectSelectedFile]::mod3d.d3dObj; /* ajout éventuellement du .box */ if !strcmpi mod3d.d3dAddObjectSelectedFile "ROO3001.M3D" then c3d3_AskAddCelBox else 0; ); 0;; fun cbDestoryWinAddObject(obj, u)= let u -> [wn bmp addObjectSession addObjectBuffer] in ( _deltimer mod3d.d3dAddObjectTimer; M3unLink addObjectSession mod3d.d3dAddObjectSelected; M3reset addObjectSession; M3destroy addObjectSession; _DSsurface addObjectBuffer; _DSbitmap bmp; _DSwindow wn );; fun cbAddObjectDClickList(obj, u, pos, s)= cbDestoryWinAddObject nil u; let u -> [_ _ addObjectSession _] in addObjectOK addObjectSession;; fun cbAddObjectOK(obj, u)= cbDestoryWinAddObject nil u; let u -> [_ _ addObjectSession _] in addObjectOK addObjectSession;; fun cbAddObjectCancel(obj, u)= cbDestoryWinAddObject nil u;; fun addAnObject()= // vignette 3d let MX3createSession _channel -> addObjectSession in let M3createShell addObjectSession -> addObjectShell in let M3load addObjectSession strcat defPath "rsc3d/cam.m3d" addObjectShell -> _ in let M3getObj addObjectSession "camera" -> addObjectCam in let M3setObjVec addObjectSession addObjectCam [0 0 (-1000)] -> _ in let M3setObjAng addObjectSession addObjectCam [0 0 0] -> _ in let ((atof "29.7") /. (atof "57.29")) -> d in let ftoi ((itof (256 / 2)) /. (tan d)) -> dx in let M3setCamera addObjectSession addObjectCam [[dx dx] [(256 / 2) (256 / 2)] [0 32768 65536]] -> _ in let _CRsurface _channel 256 256 -> addObjectBuffer in // 2d let _CRwindow _channel amain.win 80 30 600 520 WN_MENU _loc "TITLE_3D_ADDOBJECT" -> wn in let _CRtext _channel wn 5 5 590 20 ET_BORDER nil -> fic in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack strcat defPath "img/addobjectarbo.png" -> [bmp _] in let _CRbuttonBitmap _channel wn bmp 5 30 285 175 0 -> _ in let _CRlist _channel wn 295 30 300 495 LB_DOWN -> list in let _CRbutton _channel wn 5 495 70 20 0 "OK" -> ok in let _CRbutton _channel wn 80 495 70 20 0 _loc2 "CANCEL" -> cancel in ( _CBwinDestroy wn @cbDestoryWinAddObject [wn bmp addObjectSession addObjectBuffer]; _AFFfontList list _CRfont _channel 12 0 0 "Arial"; _ADDlist list 0 "BED3001.M3D"; _ADDlist list 1 "CHA3001.M3D"; _ADDlist list 2 "DES3001.M3D"; _ADDlist list 3 "DIV3001.M3D"; _ADDlist list 4 "DOR3001.M3D"; _ADDlist list 5 "ROO3001.M3D"; _CBlistClick list @cbAddObjectClickList [addObjectSession addObjectShell addObjectBuffer addObjectCam wn fic]; _CBlistDclick list @cbAddObjectDClickList [wn bmp addObjectSession addObjectBuffer]; _CBbutton ok @cbAddObjectOK [wn bmp addObjectSession addObjectBuffer]; _CBbutton cancel @cbAddObjectCancel [wn bmp addObjectSession addObjectBuffer]; 0 );; // MENU CONTEXTUEL VUE 3d fun c3d3CbMenuContextuel(obj, u)= let u -> [x y item] in if !strcmp item _loc2 "MENU_3D_TEXTURE" then c3d3_chgTexture else if (strfind item _loc "MENU_3D_FLATCOLOR" 0) != nil then c3d3_cnhgFlatColor else if !strcmp item _loc2 "MENU_3D_FILTER" then c3d3_chgFiltre else if !strcmp item _loc2 "MENU_3D_TRNSPARENCY" then c3d3_chgTransprency else if !strcmp item _loc2 "MENU_3D_LIGHT" then c3d3_chgMatLight else 0;; fun c3d3_crMenuContextuel(x, y)= set mod3d.d3dmenu = _CRpopupMenu _channel; _DRAWmenu mod3d.d3editwin mod3d.d3dmenu x y PM_LEFT_ALIGN|PM_TOP_ALIGN; let _APPpopup _channel mod3d.d3dmenu _loc2 "MENU_3D_MODIFY" -> m in ( _CBmenu _APPitem _channel m ME_ENABLED _loc2 "MENU_3D_TEXTURE" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_TEXTURE"]; _CBmenu _APPitem _channel m ME_ENABLED _loc "MENU_3D_FLATCOLOR" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_FLATCOLOR"]; _CBmenu _APPitem _channel m ME_ENABLED _loc2 "MENU_3D_FILTER" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_FILTER"]; _CBmenu _APPitem _channel m ME_ENABLED _loc2 "MENU_3D_TRNSPARENCY" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_TRNSPARENCY"]; _CBmenu _APPitem _channel m ME_ENABLED _loc2 "MENU_3D_LIGHT" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_LIGHT"]; _CBmenu _APPitem _channel m ME_ENABLED _loc2 "MENU_3D_GOURAUD" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_GOURAUD"]; _CBmenu _APPitem _channel m ME_ENABLED _loc "MENU_3D_MAPENV" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_MAPENV"]; _CBmenu _APPitem _channel m ME_ENABLED _loc "MENU_3D_BOX" @c3d3CbMenuContextuel [x y _loc2 "MENU_3D_BOX"]; ); _APPitem _channel mod3d.d3dmenu ME_SEPARATOR nil; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_OPENEDIT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_OPENEDIT"]; _APPitem _channel mod3d.d3dmenu ME_SEPARATOR nil; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_COPYMAT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_COPYMAT"]; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_PASTEMAT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_PASTEMAT"]; _APPitem _channel mod3d.d3dmenu ME_SEPARATOR nil; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_CENTEROBJECT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_CENTEROBJECT"]; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_TAKEOBJECT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_TAKEOBJECT"]; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_LINKOBJECT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_LINKOBJECT"]; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_DUPLICATEOBJECT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_DUPLICATEOBJECT"]; _APPitem _channel mod3d.d3dmenu ME_SEPARATOR nil; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_ADDLINK" @c3d3CbMenuContextuel [x y _loc "MENU_3D_ADDLINK"]; _CBmenu _APPitem _channel mod3d.d3dmenu ME_ENABLED _loc "MENU_3D_ADDPOSOBJECT" @c3d3CbMenuContextuel [x y _loc "MENU_3D_ADDPOSOBJECT"]; 0;; // MAIN fun c3d3_end()= /* to do ...*/ dsContBmp mod3d.d3dmain; M3destroy mod3d.session; M3reset mod3d.session; _DSsurface mod3d.buffer; _deltimer mod3d.d3dTimer; _deltimer mod3d.d3dAddObjectTimer; _DSbitmap mod3d.d3dBmpTemp; _DSwindow mod3d.d3editwin; 0;; fun cb3dRender(obj, u)= if mod3d.d3dClicOn then ( M3setObjVec mod3d.session mod3d.cam mod3d.d3dMoveCamVector; M3setObjAng mod3d.session mod3d.cam mod3d.d3dMoveCamAngle ) else nil; let mod3d.d3dPosCursor -> [x y] in set mod3d.d3dHMatSelect = MX3renderm mod3d.session mod3d.buffer mod3d.cam x y mod3d.d3dbgcolor; _BLTsurface mod3d.d3editwin 0 0 mod3d.buffer 0 0 420 780;; fun cbClick3dMain(obj, u, xm, ym, btn, mask)= let xm - 10 -> x in let ym - 10 -> y in let strcat mylang ".png" -> suff in ( if x > 316 && x < 316 + 29 && y > 34 && y < 34 + 29 then // help ( let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/c3d3/help." strcat l ".htm"; 0 ) else if x > 124 && x < 124 + 53 && y > 440 && y < 440 + 20 then // ok c3d3_end else if x > 180 && x < 180 + 73 && y > 440 && y < 440 + 20 then // cancel c3d3_end else 0; // in onglet "OBJETS" if mod3d.d3dtab == 0 then if x > 19 && x < 19+57 && y > 308 && y < 308+16 then // ajouter un m3d addAnObject else if x > 220 && x < 220+106 && y > 267 && y < 267+14 then // changer de texture c3d3_chgTexture else if x > 220 && x < 220+106 && y > 290 && y < 290+14 then // changer de couleur de flat c3d3_cnhgFlatColor else if x > 220 && x < 220+106 && y > 312 && y < 312+14 then // changer un filtre sur le materiau c3d3_chgFiltre else if x > 220 && x < 220+106 && y > 336 && y < 336+14 then // changer la transparence sur le materiau c3d3_chgTransprency else if x > 220 && x < 220+106 && y < 360 && y < 360+14 then // materiau éclairé ou non c3d3_chgMatLight else 0 else 0 );; fun cbMove3dMain(obj, u, xm, ym, mask)= 0;; fun cbClick3dEdit(obj, u, x, y, btn)= _SETfocus mod3d.d3editwin; set mod3d.d3dPosClick = [x y]; if btn == LBUTTON then set mod3d.d3dClicOn = 1 else c3d3_crMenuContextuel x y;; fun cbUnClick3dEdit(obj, u, x, y, btn)= set mod3d.d3dClicOn = 0;; /* déplacement de la caméra */ fun cbMoveCamera(obj, u, xm, ym, btn)= if mod3d.d3dfocus then set mod3d.d3dPosCursor = [xm ym] else nil; let mod3d.d3dPosClick -> [xi yi] in let 1 -> a in let 20 -> b in let xm - xi -> x in let yi - ym -> y in ( set mod3d.d3dMoveCamVector = if _keybdstate & 2 then [x * a y * a 0] else if _keybdstate & 1 then [0 0 0] else [0 0 y * a]; set mod3d.d3dMoveCamAngle = if _keybdstate & 2 then [0 0 0] else if _keybdstate & 1 then [0 y * b 0] else [(-x * b) 0 0]; ) ;; fun cbKeyDown3dEdit(obj, u, sc, asc)= set lastkbdstate = _keybdstate; let mod3d.d3dPosClick -> [xi yi] in let 1 * 128 -> a in let 20 * 128 -> b in ( let mod3d.d3dMoveCamVector -> v in if lastkbdstate&2 then if asc == 0xff51 then mutate v <- [(-a) _ _] else if asc == 0xff53 then mutate v <- [a _ _] else if asc == 0xff52 then mutate v <- [_ a _] else if asc == 0xff54 then mutate v <- [_ (-a) _] else nil else if lastkbdstate&1 then nil else if asc == 0xff52 then mutate v <- [_ _ a] else if asc == 0xff54 then mutate v <- [_ _ (-a)] else nil; let mod3d.d3dMoveCamVector -> ang in if lastkbdstate&2 then nil else if lastkbdstate&1 then if asc == 0xff52 then mutate ang <- [_ b _] else if asc == 0xff54 then mutate ang <- [_ (-b) _] else nil else if asc == 0xff51 then mutate ang <- [b _ 0] else if asc == 0xff53 then mutate ang <- [-b _ 0] else nil; ) ;; fun cbEnd3dEdit(obj, u)= c3d3_end ;; fun cbFocus3dEdit(obj, u)= set mod3d.d3dfocus = !mod3d.d3dfocus ;; fun creaCompBmpEditorC3D3()= // main let strcat mylang ".png" -> suff in let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" strcat nth_list mod3d.d3dBMP 1 suff -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( dsContBmp acont.contBMPeditor; dsContBmp mod3d.d3dmain; set mod3d.d3dmain = _CRcompBitmap _channel amain.maincont nil [10 10] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick mod3d.d3dmain @cbClick3dMain 0; _CBcompBitmapCursorMove mod3d.d3dmain @cbMove3dMain 0; _PAINTcontainer amain.maincont; ); // view 3d set mod3d.d3editwin = _CRwindow _channel amain.win 370+50 10 420 780 WN_MENU|WN_MINBOX _loc "TITLE_3D_VIEW"; _CBcursorMove mod3d.d3editwin @cbMoveCamera 0; _CBwinClick mod3d.d3editwin @cbClick3dEdit 0; _CBwinUnclick mod3d.d3editwin @cbUnClick3dEdit 0; _CBwinKeydown mod3d.d3editwin @cbKeyDown3dEdit 0; _CBwinClose mod3d.d3editwin @cbEnd3dEdit 0; _CBwinFocus mod3d.d3editwin @cbFocus3dEdit 1; _CBwinKillFocus mod3d.d3editwin @cbFocus3dEdit 0; set mod3d.session = MX3createSession _channel; set mod3d.shell = M3createShell mod3d.session; M3load mod3d.session strcat defPath "rsc3d/cam.m3d" mod3d.shell; set mod3d.cam = M3getObj mod3d.session "camera"; M3setObjVec mod3d.session mod3d.cam [0 0 (-500)]; M3setObjAng mod3d.session mod3d.cam [0 0 0]; let ((atof "29.7") /. (atof "57.29")) -> d in let ftoi ((itof (420 / 2)) /. (tan d)) -> dx in M3setCamera mod3d.session mod3d.cam [[dx dx] [(420 / 2) (780 / 2)] [0 32768 65536]]; set mod3d.darkbase = M3createLight mod3d.session LIGHT_AMBIENT mod3d.darkbaseValue nil nil nil nil; M3renameObj mod3d.session mod3d.darkbase "global_light"; M3link mod3d.session mod3d.darkbase mod3d.shell; set mod3d.buffer = _CRsurface _channel 420 780; set mod3d.d3dTimer = _rfltimer _starttimer _channel 10 @cb3dRender 0; 0;; /********************************************************/ /***** ************/ /***** ************/ /********************************************************/ fun cbClickBMP(obj, u, x, y, btn, mask)= 0;; fun cbMoveBMP(obj, u, xm, ym, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if !strcmp fic strcat "clientproperty." suff then chgComment _loc "MOVE_DOC_CLIENT_PROPERTY" else if !strcmp fic strcat "serverproperty." suff then chgComment _loc "MOVE_DOC_SERVER_PROPERTY" else _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; fun creaCompBmpInterf(fic, x, y)= _DScompBitmap acont.contBMPinterfProp; let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set acont.contBMPinterfProp = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick acont.contBMPinterfProp @cbClickBMP [fic x y w h]; _CBcompBitmapCursorMove acont.contBMPinterfProp @cbMoveBMP [fic x y w h]; _PAINTcontainer amain.maincont; 0 );; // menu et docs client et server fun cbClickMenu(obj, u, xm, ym, btn, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if !strcmp fic "clientnu.png" then creaCompBmpInterf strcat "clientproperty." suff 100 130 else if !strcmp fic "servernu.png" then creaCompBmpInterf strcat "serverproperty." suff 100 130 else if ((!strcmp fic strcat "mdisplay." suff) && (x > 4) && (x < 4+202) && (y > 20) && (y < 39)) && ((etape == 2) || (etape == 3) || (etape == 4) || (etape == 5)) then creaTreeModule strcat "creatree." strcat mylang ".png" 400 50 else dsContBmp acont.contBMPmenu; 0;; fun cbMoveMenu(obj, u, xm, ym, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if !strcmp fic strcat "mfiles." suff then if x > 2 && x < 192 && y > 1 && y < 19 then // chgComment "MOVE_MENU_NEW" bubble x y _loc "MOVE_MENU_NEW" else if x > 2 && x < 192 && y > 20 && y < 39 then // chgComment "MOVE_MENU_OPEN" bubble x y _loc "MOVE_MENU_OPEN" else if x > 2 && x < 192 && y > 40 && y < 59 then // chgComment "MOVE_MENU_RECENTS" bubble x y _loc "MOVE_MENU_RECENTS" else if x > 2 && x < 192 && y > 60 && y < 79 then // chgComment "MOVE_MENU_CLOSE" bubble x y _loc "MOVE_MENU_CLOSE" else if x > 2 && x < 192 && y > 80 && y < 99 then // chgComment "MOVE_MENU_SAVE" bubble x y _loc "MOVE_MENU_SAVE" else if x > 2 && x < 192 && y > 120 && y < 139 then // chgComment "MOVE_MENU_WIZARD" bubble x y _loc "MOVE_MENU_WIZARD" else if x > 2 && x < 192 && y > 140 && y < 159 then // chgComment "MOVE_MENU_EXIT" bubble x y _loc "MOVE_MENU_EXIT" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd) else if !strcmp fic strcat "medit." suff then if x > 2 && x < 192 && y > 1 && y < 19 then // chgComment "MOVE_MENU_DEL" bubble x y _loc "MOVE_MENU_DEL" else if x > 2 && x < 122 && y > 20 && y < 39 then // chgComment "MOVE_MENU_UNDO" bubble x y _loc "MOVE_MENU_UNDO" else if x > 2 && x < 122 && y > 40 && y < 59 then // chgComment "MOVE_MENU_REDO" bubble x y _loc "MOVE_MENU_REDO" else if x > 2 && x < 122 && y > 70 && y < 89 then // chgComment "MOVE_MENU_CUT" bubble x y _loc "MOVE_MENU_CUT" else if x > 2 && x < 122 && y > 90 && y < 109 then // chgComment "MOVE_MENU_COPY" bubble x y _loc "MOVE_MENU_COPY" else if x > 2 && x < 122 && y > 110 && y < 129 then // chgComment "MOVE_MENU_PASTE" bubble x y _loc "MOVE_MENU_PASTE" else if x > 2 && x < 122 && y > 130 && y < 149 then // chgComment "MOVE_MENU_IMPORT" bubble x y _loc "MOVE_MENU_IMPORT" else if x > 2 && x < 122 && y > 150 && y < 169 then // chgComment "MOVE_MENU_EXPORT" bubble x y _loc "MOVE_MENU_EXPORT" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd) else if !strcmp fic strcat "mdisplay." suff then if x > 2 && x < 202 && y > 1 && y < 19 then // chgComment "MOVE_MENU_SITETREE" bubble x y _loc "MOVE_MENU_SITETREE" else if x > 2 && x < 202 && y > 20 && y < 39 then // chgComment "MOVE_MENU_CREATIONASSOTREE" bubble x y _loc "MOVE_MENU_CREATIONASSOTREE" else if x > 2 && x < 202 && y > 40 && y < 59 then // chgComment "MOVE_MENU_PROPERTIES" bubble x y _loc "MOVE_MENU_PROPERTIES" else if x > 2 && x < 202 && y > 60 && y < 79 then // chgComment "MOVE_MENU_SITEOPTIONS" bubble x y _loc "MOVE_MENU_SITEOPTIONS" else if x > 2 && x < 202 && y > 80 && y < 99 then // chgComment "MOVE_MENU_HOST" bubble x y _loc "MOVE_MENU_HOST" else if x > 2 && x < 202 && y > 105 && y < 124 then // chgComment "MOVE_MENU_ERR" bubble x y _loc "MOVE_MENU_ERR" else if x > 2 && x < 202 && y > 125 && y < 144 then // chgComment "MOVE_MENU_HISTORY" bubble x y _loc "MOVE_MENU_HISTORY" else if x > 2 && x < 202 && y > 150 && y < 169 then // chgComment "MOVE_MENU_PREF" bubble x y _loc "MOVE_MENU_PREF" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd) else if !strcmp fic strcat "mproject." suff then if x > 2 && x < 202 && y > 1 && y < 19 then // chgComment "MOVE_MENU_CREABBOX" bubble x y _loc "MOVE_MENU_CREABBOX" else if x > 2 && x < 202 && y > 20 && y < 39 then // chgComment "MOVE_MENU_ENTERBBOX" bubble x y _loc "MOVE_MENU_ENTERBBOX" else if x > 2 && x < 202 && y > 40 && y < 59 then // chgComment "MOVE_MENU_CREACHILDDOC" bubble x y _loc "MOVE_MENU_CREACHILDDOC" else if x > 2 && x < 202 && y > 60 && y < 79 then // chgComment "MOVE_MENU_CREACHILDZONE" bubble x y _loc "MOVE_MENU_CREACHILDZONE" else if x > 2 && x < 202 && y > 80 && y < 99 then // chgComment "MOVE_MENU_SELECTFATHER" bubble x y _loc "MOVE_MENU_SELECTFATHER" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd) else if !strcmp fic strcat "mhelp." suff then // chgComment "MOVE_HELPHELP" bubble x y _loc "MOVE_HELPHELP" else if !strcmp fic "modShellEvent.png" then if x > 2 && x < 64 && y > 1 && y < 18 then // chgComment "MOVE_MOD_SHELL_A_ENTER" bubble x y _loc "MOVE_MOD_SHELL_A_ENTER" else if x > 2 && x < 64 && y > 20 && y < 38 then // chgComment "MOVE_MOD_SHELL_A_FULL" bubble x y _loc "MOVE_MOD_SHELL_A_FULL" else if x > 2 && x < 64 && y > 39 && y < 58 then // chgComment "MOVE_MOD_SHELL_A_IN" bubble x y _loc "MOVE_MOD_SHELL_A_IN" else if x > 2 && x < 64 && y > 58 && y < 76 then // chgComment "MOVE_MOD_SHELL_A_LOG" bubble x y _loc "MOVE_MOD_SHELL_A_LOG" else if x > 2 && x < 64 && y > 77 && y < 94 then // chgComment "MOVE_MOD_SHELL_A_OUT" bubble x y _loc "MOVE_MOD_SHELL_A_OUT" else if x > 2 && x < 64 && y > 95 && y < 114 then // chgComment "MOVE_MOD_SHELL_A_START" bubble x y _loc "MOVE_MOD_SHELL_A_START" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd) else if !strcmp fic "clientnu.png" then // chgComment "MOVE_DOC_CLIENT" bubble x y _loc "MOVE_DOC_CLIENT" else if !strcmp fic "servernu.png" then // chgComment "MOVE_DOC_SERVER" bubble x y _loc "MOVE_DOC_SERVER" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd); 0;; /*** editeur module ***/ fun cbMoveBMPeditor(obj, u, xm, ym, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in if x > 306 && x < 306+22 && y > 40 && y < 40+22 then // chgComment "MOVE_EDITOR_HELP" bubble x y _loc "MOVE_EDITOR_HELP" else if x > 107 && x < 107+132 && y > 91 && y < 91+20 then // chgComment "MOVE_EDITOR_VALIDATE" bubble x y _loc "MOVE_EDITOR_VALIDATE" else (_SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd); 0;; fun cbClickBMPeditor(obj, u, xm, ym, btn, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in ( if etape == 2 then if x > 306 && x < 306+22 && y > 40 && y < 40+22 then ( let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/help." strcat l ".htm"; 0 ) else if x > 151 && x < (151+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "mdisplay." suff 151 33+41; 0 ) else if x > 107 && x < 107+132 && y > 91 && y < 91+20 then dsContBmp acont.contBMPeditor else 0 else if etape == 3 then let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in if !strcmp fic strcat "editor." suff then if x > 306 && x < 306+22 && y > 40 && y < 40+22 then ( _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/login/help." strcat l ".htm"; 0 ) // else if x > 107 && x < 107+132 && y > 91 && y < 91+20 then // dsContBmp acont.contBMPeditor else if ((x > 107 && x < 107+50) || (x > 242 && x < 242+83)) && (y > 91 && y < 91+22) then // ok et appliquer validEditor "login" else 0 else if !strcmp fic strcat "edphoto3." suff then if x > 309 && x < 309+30 && y > 46 && y < 46+30 then ( _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/photo3/help." strcat l ".htm"; 0 ) else if ((x > 107 && x < 107+57) || (x > 245 && x < 242+87)) && (y > 87 && y < 91+28) then // ok et appliquer validEditor "photo3" else 0 else 0 else if etape == 4 then let if (!strcmp mylang "english") || (!strcmp mylang "french") then mylang else "english" -> l in if !strcmp fic strcat "edio." suff then if x > 303 && x < 303+25 && y> 35 && y < 35+25 then ( _openbrowserhttp strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/help/io/help." strcat l ".htm"; 0 ) else if ((x > 108 && x < 108+50) || (x > 242 && x < 242+83)) && (y > 215 && y < 215+20) then // ok et appliquer validEditor "io" else 0 else 0 else 0 );; fun creaCompBmpEditor(fic, x, y)= dsContBmp acont.contBMPeditor; let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set acont.contBMPeditor = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick acont.contBMPeditor @cbClickBMPeditor [fic x y w h]; _CBcompBitmapCursorMove acont.contBMPeditor @cbMoveBMPeditor [fic x y w h]; _PAINTcontainer amain.maincont; 0 );; /********************************************************/ /***** ARBRE DE CREATION ************/ /***** ************/ /********************************************************/ fun cbClickBMPtreeModule(obj, u, xm, ym, btn, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in ( if x > 206 && x < 206+22 && y > 11 && y < 11+22 then dsContBmp acont.contBMPtreeMod else 0; if etape == 3 then if x > 84 && x < 84+33 && y > 241 && y < 241+33 then // login creaCompBmpEditor strcat "editor." suff 20 20 else if x > 84 && x < 84+33 && y > 297 && y < 297+33 then // photo3 creaCompBmpEditor strcat "edphoto3." suff 20 20 else if x > 85 && x < 85+26 && y > 402 && y < 402+26 then // button creaCompBmpEditorButton strcat "edbutton." suff 20 20 "button" 0 else 0 else if etape == 4 then if x > 84 && x < 84+27 && y > 437 && y < 437+27 then // colorterm creaCompBmpEditorColorTerm strcat "edcolorterm." suff 0 20 20 else if x > 83 && x < 83+29 && y > 216 && y < 216+24 then // contact creaCompBmpEditorContact strcat "edcontact." suff 0 20 20 else if x > 80 && x < 80+35 && y > 347 && y < 347+35 then // io creaCompBmpEditor strcat "edio." suff 20 20 else 0 else if etape == 5 then if x > 81 && x < 81+35 && y > 160 && y < 160+35 then // C3D3 creaCompBmpEditorC3D3 else 0 else 0 );; fun cbMoveBMPtreeModule(obj, u, xm, ym, mask)= let u -> [fic X Y w h] in let xm - X -> x in let ym - Y -> y in let strcat mylang ".png" -> suff in if x > 206 && x < 206+22 && y > 11 && y < 11+22 then chgComment "MOVE_TREEMODULE_CLOSE" else if x > 12 && x < 12+97 && y > 42 && y < 42+22 then chgComment "MOVE_TREEMODULE_STRETCH" else if x > 124 && x < 124+97 && y > 42 && y < 42+22 then chgComment "MOVE_TREEMODULE_REBUILD" else if x > 12 && x < 12+183 && y > 70 && y < 74+409 then chgComment "MOVE_TREEMODULE_LISTMOD" else _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; fun creaTreeModule(fic, x, y)= dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPtreeMod; let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set acont.contBMPtreeMod = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick acont.contBMPtreeMod @cbClickBMPtreeModule [fic x y w h]; _CBcompBitmapCursorMove acont.contBMPtreeMod @cbMoveBMPtreeModule [fic x y w h]; _PAINTcontainer amain.maincont; 0 );; /********************************************************/ /***** ETAPE 5 : ************/ /***** C3D3 - Onglet Objets ************/ /***** ************/ /********************************************************/ fun cbClickStep5(obj, u, xm, ym, btn, mask)= let strcat mylang ".png" -> suff in if btn == LBUTTON then if xm > 151 && xm < (151+39) && ym > 33 && ym < (33+41) then creaCompBmpMenu strcat "mdisplay." suff 151 33+41 else dsContBmp acont.contBMPmenu else 0;; fun cbMoveStep5(obj, u, x, y, mask)= 0;; fun step5()= set etape = 5; dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPinterfProp; _PAINTcontainer amain.maincont; _CBcompBitmapClick acont.contBMPbg @cbClickStep5 0; _CBcompBitmapCursorMove acont.contBMPbg @cbMoveStep5 0; set amain.commentlast = _loc "MSG_STEP5"; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** ETAPE 4 : ************/ /***** ColorTerm, Contact et InOut ************/ /***** ************/ /********************************************************/ fun cbClickStep4(obj, u, xm, ym, btn, mask)= let strcat mylang ".png" -> suff in if btn == LBUTTON then if xm > 151 && xm < (151+39) && ym > 33 && ym < (33+41) then creaCompBmpMenu strcat "mdisplay." suff 151 33+41 else dsContBmp acont.contBMPmenu else 0;; fun cbMoveStep4(obj, u, x, y, mask)= 0;; fun step4()= set etape = 4; dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPinterfProp; _PAINTcontainer amain.maincont; _CBcompBitmapClick acont.contBMPbg @cbClickStep4 0; _CBcompBitmapCursorMove acont.contBMPbg @cbMoveStep4 0; set amain.commentlast = _loc "MSG_STEP4"; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** ETAPE 3 : ************/ /***** Login, Photo3 & Button ************/ /***** ************/ /********************************************************/ fun cbClickStep3(obj, u, xm, ym, btn, mask)= let strcat mylang ".png" -> suff in if btn == LBUTTON then if xm > 151 && xm < (151+39) && ym > 33 && ym < (33+41) then creaCompBmpMenu strcat "mdisplay." suff 151 33+41 else dsContBmp acont.contBMPmenu else 0;; fun cbMoveStep3(obj, u, x, y, mask)= 0;; fun step3()= set etape = 3; dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPinterfProp; dsContBmp acont.contBMPbg; set acont.contBMPbg = _CRcompBitmap _channel amain.maincont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_CLICK _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/scsmainvide." strcat mylang ".png" 0 0 800 600; _CHANGEobjNodeFlags ucont.ucontBMPprevious OBJ_VISIBLE|OBJ_ENABLE 1; _PAINTcontainer amain.maincont; _CBcompBitmapClick acont.contBMPbg @cbClickStep3 0; _CBcompBitmapCursorMove acont.contBMPbg @cbMoveStep3 0; set amain.commentlast = _loc "MSG_STEP3"; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** ETAPE 2 : ************/ /***** Modules : généralités ************/ /***** ************/ /********************************************************/ fun cbClickMenuStep2(obj, u, x, y, btn, mask)= /* if btn == LBUTTON then if x > 151 && x < (151+39) && y > 33 && y < (33+41) then creaCompBmpMenu strcat "mdisplay." suff 151 33+41 else dsContBmp acont.contBMPmenu else*/ 0;; fun cbClickStep2(obj, u, x, y, btn, mask)= if x > 295 && x < 295+39 && y > 237 && y < 237+46 then creaCompBmpEditor strcat "editor." strcat mylang ".png" 20 20 else dsContBmp acont.contBMPeditor; let strcat mylang ".png" -> suff in if btn == LBUTTON then if x > 151 && x < (151+39) && y > 33 && y < (33+41) then creaCompBmpMenu strcat "mdisplay." suff 151 33+41 else dsContBmp acont.contBMPmenu else 0;; /* ( _DScompBitmap acont.contBMPmenu; _DScompBitmap acont.contBMPinterfProp; let strcat "creatree." strcat mylang ".png" -> fic in let [400 50] -> [x y] in let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set acont.contBMPmenu = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick acont.contBMPmenu @cbClickMenuStep2 fic; _PAINTcontainer amain.maincont; 0 )*/ // creaTreeModule strcat "creatree." strcat mylang ".png" 400 50 fun cbMoveStep2(obj, u, x, y, mask)= 0;; fun step2()= set etape = 2; dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPinterfProp; dsContBmp acont.contBMPbg; set acont.contBMPbg = _CRcompBitmap _channel amain.maincont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_CLICK _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/scsmainmodex." strcat mylang ".png" 0 0 800 600; _CHANGEobjNodeFlags ucont.ucontBMPprevious OBJ_VISIBLE|OBJ_ENABLE 1; _PAINTcontainer amain.maincont; _CBcompBitmapClick acont.contBMPbg @cbClickStep2 0; _CBcompBitmapCursorMove acont.contBMPbg @cbMoveStep2 0; set amain.commentlast = _loc "MSG_STEP2"; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** ETAPE 1 : ************/ /***** Connaissance de l'interface du SCS ************/ /***** ************/ /********************************************************/ fun cbMoveStep1(obj, u, x, y, mask)= if x > 33 && x < (33+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_FILE"; bubble x y _loc "MOVE_FILE"; 0 ) else if x > 92 && x < (92+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_EDITOR"; bubble x y _loc "MOVE_EDITOR"; 0 ) else if x > 151 && x < (151+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_DISPLAY"; bubble x y _loc "MOVE_DISPLAY"; 0 ) else if x > 212 && x < (212+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_PROJECT"; bubble x y _loc "MOVE_PROJECT"; 0 ) else if x > 271 && x < (271+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_HELP"; bubble x y _loc "MOVE_HELP"; 0 ) else if x > 392 && x < (392+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_MODULES"; bubble x y _loc "MOVE_MODULES"; 0 ) else if x > 451 && x < (451+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_CLIENT"; bubble x y _loc "MOVE_CLIENT"; 0 ) else if x > 511 && x < (511+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_SERVER"; bubble x y _loc "MOVE_SERVER"; 0 ) else if x > 610 && x < (610+39) && y > 33 && y < (33+41) then ( // chgComment "MOVE_RUN"; bubble x y _loc "MOVE_RUN"; 0 ) else if x > 20 && x < 782 && y > 109 && y < 563 then ( // chgComment "MOVE_SHELL"; bubble x y _loc "MOVE_SHELL"; 0 ) else if x > 354 && x < (344+92) && y > 81 && y < (81+18) then ( // chgComment "MOVE_NAME"; bubble x y _loc "MOVE_NAME"; 0 ) else ( _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; bubbleEnd; 0 );; fun creaCompBmpMenu(fic, x, y)= _DScompBitmap acont.contBMPmenu; _DScompBitmap acont.contBMPinterfProp; let _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/" fic -> abmp in let _GETalphaBitmapSize abmp -> [w h] in ( set acont.contBMPmenu = _CRcompBitmap _channel amain.maincont nil [x y] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 w h; _CBcompBitmapClick acont.contBMPmenu @cbClickMenu [fic x y w h]; _CBcompBitmapCursorMove acont.contBMPmenu @cbMoveMenu [fic x y w h]; _PAINTcontainer amain.maincont; 0 );; fun cbClickStep1(obj, u, x, y, btn, mask)= let strcat mylang ".png" -> suff in if btn == LBUTTON then ( if x > 33 && x < (33+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "mfiles." suff 33 33+41; 0 ) else if x > 92 && x < (92+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "medit." suff 92 33+41; 0 ) else if x > 151 && x < (151+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "mdisplay." suff 151 33+41; 0 ) else if x > 212 && x < (212+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "mproject." suff 212 33+41; 0 ) else if x > 271 && x < (271+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu strcat "mhelp." suff 271 33+41; 0 ) else if x > 451 && x < (451+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu "clientnu.png" 25 120; 0 ) else if x > 511 && x < (511+39) && y > 33 && y < (33+41) then ( creaCompBmpMenu "servernu.png" 25 120; 0 ) else dsContBmp acont.contBMPmenu ) else if btn == RBUTTON then ( if x > 20 && x < 782 && y > 109 && y < 563 then creaCompBmpMenu "modShellEvent.png" x y else dsContBmp acont.contBMPmenu ) else 0;; fun step1()= set etape = 1; dsContBmp acont.contBMPmenu; dsContBmp acont.contBMPinterfProp; dsContBmp acont.contBMPbg; set acont.contBMPbg = _CRcompBitmap _channel amain.maincont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_CLICK _LDalphaBitmap _channel _checkpack strcat defPath strcat "img/scsmainvide." strcat mylang ".png" 0 0 800 600; _CBcompBitmapClick acont.contBMPbg @cbClickStep1 0; _CBcompBitmapCursorMove acont.contBMPbg @cbMoveStep1 _PAINTcontainer amain.maincont; set amain.commentlast = _loc "MSG_STEP1"; _SETtextRichText amain.commenttext amain.commentlast "Arial" 10 0 0; 0;; /********************************************************/ /***** PROGRESSION ************/ /***** ************/ /********************************************************/ // flag : 0 = no fait, 1 = fait, 2 = en cours fun progression_crabmp(flag)= let _FILLbitmap _CRbitmap _channel 16 16 0xffffff -> bmp in let _DRAWcircle bmp 8 8 8 DRAW_INVISIBLE 0 0 DRAW_SOLID if flag == 0 then make_rgb 255 0 0 else if flag == 2 then make_rgb 0 255 0 else make_rgb 0 0 255 -> bmp in let _CRalphaBitmap _channel bmp nil make_rgb 200 200 200 0xffffff -> abmp in let _DSbitmap bmp -> _ in abmp ;; fun progression_addEltList(list, n)= if n < 0 then 0 else let if n > etape then progression_crabmp 0 else if n == etape then progression_crabmp 2 else progression_crabmp 1 -> abmp in ( _ADDcompList list 0 [_loc strcat "PROGRES_STEP" itoa n abmp]; progression_addEltList list n-1 ) ;; fun progression_end(obj, u, xm, ym, btn, mask)= _DScontainer u;; fun progression()= progression_end nil contProgression nil nil nil nil; let _CRcontainerFromObjWin _channel amain.win 100 100 300 300 0 make_rgb 200 200 200 "Infos ..." -> c in let _CRcompText _channel c nil [5 5] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 290 20 _loc "PROGRES_MSG1" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _CRcompList _channel c nil [5 30] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT 0 290 240 13 LST_VERTICAL _CRfont _channel 14 0 0 "Arial" 25 [0 0 0 0] [0 0] nil -> list in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "CLOSE" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 275] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btnclose in ( progression_addEltList list 13; _CBcompBitmapClick btnclose @progression_end c; _PAINTcontainer c; set contProgression = c; 0 ) ;; /********************************************************/ /***** INFORMATIONS ************/ /***** ************/ /********************************************************/ // callbacks fun cbClickContInfo(obj, tag, x, y, btn, mask)= if tag == 1 then _openbrowserhttp "http://www.scolring.org/SCS" else if tag == 2 then _openbrowserhttp "http://www.scolring.org" else if tag == 3 then _openbrowserhttp "http://www.scol-technologies.org" else if tag == 4 then _openbrowserhttp "http://www.irizone.net" else nil ;; fun cbInfosEnd(obj, u, xm, ym, btn, mask)= let u -> [c abmp] in ( _DSalphaBitmap abmp; _DScontainer c ) ;; // main fun infos()= let _CRcontainerFromObjWin _channel amain.win 100 100 300 300 0 make_rgb 200 200 200 "Infos ..." -> c in let _CRcompText _channel c nil [5 5] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 290 165 _loc "INFOS_MSG1" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "SCS" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 175] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btnscs in let _CRcompText _channel c nil [85 175] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 210 20 _loc "INFOS_MSG2" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "Scolring" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 200] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btnscolring in let _CRcompText _channel c nil [85 200] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 210 20 _loc "INFOS_MSG3" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "Asso." -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 225] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btnasso in let _CRcompText _channel c nil [85 225] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 210 20 _loc "INFOS_MSG4" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "IriZone" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 250] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btniri in let _CRcompText _channel c nil [85 250] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 210 20 _loc "INFOS_MSG5" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "CLOSE" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 275] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 -> btnok in let _CRcompText _channel c nil [85 275] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP 0 210 20 _loc "INFOS_MSG6" _CRfont _channel 14 0 0 "Arial" [0 0 0 0] [0 0] nil nil -> _ in ( _CBcompBitmapClick btnscs @cbClickContInfo 1; _CBcompBitmapClick btnscolring @cbClickContInfo 2; _CBcompBitmapClick btnasso @cbClickContInfo 3; _CBcompBitmapClick btniri @cbClickContInfo 4; _CBcompBitmapClick btnok @cbInfosEnd [c abmp]; _PAINTcontainer c; 0 ) ;; /********************************************************/ /***** INTERFACE UTILISATEUR ************/ /***** ************/ /********************************************************/ fun cbPrevious(obj, u, x, y, btn, mask)= if etape == 2 then step1 else if etape == 3 then step2 else if etape == 4 then step3 else if etape == 5 then step4 else 0; if contProgression != nil then progression else 0;; fun cbNext(obj, u, x, y, btn, mask)= if etape == 1 then step2 else if etape == 2 then step3 else if etape == 3 then step4 else if etape == 4 then step5 else 0; if contProgression != nil then progression else 0;; fun cbProgress(obj, u, x, y, btn, mask)= progression ;; fun cbLoadTutScs(obj, u, x, y, btn, mask)= 0;; fun cbSaveTutScs(obj, u, x, y, btn, mask)= 0;; fun cbSaveDms(obj, u, x, y, btn, mask)= 0;; fun cbRun(obj, u, x, y, btn, mask)= 0;; fun cbOpenPref(obj, u, x, y, btn, mask)= infos ;; fun creaUserInterface()= // main cont set ucont.ucontmain = _CRcontainerFromObjWin _channel amain.win amain.commentW +10 605 amain.winW - amain.commentW -15 amain.commentH CO_CHILDINSIDE make_rgb 200 200 200 nil; // précédent let _DRAWtext _FILLbitmap _CRbitmap _channel 35 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "<<" -> bmp in let _DRAWrectangle bmp 0 0 35 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPprevious = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 5] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 35 20 @cbPrevious 0; // suivant let _DRAWtext _FILLbitmap _CRbitmap _channel 35 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 ">>" -> bmp in let _DRAWrectangle bmp 0 0 35 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPnext = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [45 5] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 35 20 @cbNext 0; // progresion let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_PROPGRESS" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPstep = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 30] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbProgress 0; // load let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_LOAD" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPload = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 55] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbLoadTutScs 0; // save let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_SAVE" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPsave = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 80] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbSaveTutScs 0; // save dms let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_SAVEDMS" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPdms = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 105] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbSaveDms 0; // run let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_RUN" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPrun = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 130] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbRun 0; // contact let _DRAWtext _FILLbitmap _CRbitmap _channel 75 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 _loc2 "BTN_PREF" -> bmp in let _DRAWrectangle bmp 0 0 75 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in set ucont.ucontBMPpref = _CONVERTcompBitmapToObjNode _CBcompBitmapUnClick _CRcompBitmap _channel ucont.ucontmain nil [5 155] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 75 20 @cbOpenPref 0; _CRtoolTipDefault ucont.ucontBMPprevious 100 _loc "TOOLTIP_BTN_PREVIOUS" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPnext 100 _loc "TOOLTIP_BTN_NEXT" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPstep 100 _loc "TOOLTIP_BTN_STEP" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPload 100 _loc "TOOLTIP_BTN_LOAD" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPsave 100 _loc "TOOLTIP_BTN_SAVE" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPdms 100 _loc "TOOLTIP_BTN_DMS" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPrun 100 _loc "TOOLTIP_BTN_RUN" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CRtoolTipDefault ucont.ucontBMPpref 100 _loc "TOOLTIP_BTN_PREF" 0 _CRfont _channel 16 0 FF_WEIGHT "Arial" make_rgb 255 255 100; _CHANGEobjNodeFlags ucont.ucontBMPprevious OBJ_HIDE|OBJ_ENABLE 1; _PAINTcontainer ucont.ucontmain; 0;; /*****************************************************************/ /***** ETAPE 0 : ************/ /***** Présentation de la demo, indentification ************/ /***** ************/ /*****************************************************************/ /* *** *** */ fun cbStep0(obj, u)= _DSwindow u; set amain.win = _CRwindow _channel nil 50 0 amain.winW amain.winH WN_MENU|WN_MINBOX "SCS - Construisons des mondes virtuels à la souris !"; _CBwinDestroy amain.win @cbEnd 0; set amain.comment = _CRwindow _channel amain.win 5 605 amain.commentW amain.commentH WN_CHILDINSIDE nil; set amain.maincont = _CRcontainerFromObjWin _channel amain.win 0 0 amain.winW 600 CO_CHILDINSIDE 0xffffff nil; set amain.commenttext = _CRrichText _channel amain.comment 0 0 700 190 ET_HSCROLL|ET_VSCROLL|ET_DOWN|ET_BORDER|ET_NOEDIT nil; _PAINTcontainer amain.maincont; _CBcontainerCursorMove amain.maincont @cbMaincontMove nil; creaUserInterface; step1;; fun step0b(wn)= _SIZEwindow wn 780 800 60 10; let _CRtext _channel wn 5 5 770 765 ET_DOWN _loc "MSG_INTRO" -> _ in _CBbutton _CRbutton _channel wn 5 775 770 20 0 _loc2 "BTN_CONTINUE" @cbStep0 wn; 0;; // fun [CompBitmap [ObjWin ObjContainer CompText CompText CompList] I I I I] I fun cbStep0bOK(obj, u, x, y, btn, mask)= if btn == LBUTTON then let u -> [wn c login name langue] in let _GETcompText login -> l in let _GETcompText name -> n in let _GETcompListClicked langue -> [_ [la _]] in ( set mylang = if la == nil then "french" else la; set ulogin = if l == nil then "userSCS" else l; set uname = if n == nil then "siteSCS" else n; _DScontainer c; step0b wn; ) else 0;; /* initialisation de la première étape */ fun step0()= let _CRwindow _channel amain.win 100 100 400 240 WN_NOCAPTION nil -> wn in let _CRfont _channel 14 0 0 "Arial" -> font in let _CRcontainerFromObjWin _channel wn 0 0 400 300 CO_CHILDINSIDE make_rgb 200 200 200 nil -> c in let _CRcompText _channel c nil [5 5] OBJ_ENABLE|OBJ_VISIBLE|CT_LABEL|CT_WORDWRAP 0 290 40 _loc "MSG_INFO_LOGIN" font [0 0 0 0] [0 0] nil nil -> _ in // login let _DRAWtext _FILLbitmap _CRbitmap _channel 85 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "Login" -> bmp in let _DRAWrectangle bmp 0 0 85 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 50] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 85 20 -> _ in let _CRcontainerFromObjCont _channel c 95 50 295 20 CO_CHILDINSIDE|CO_3DBORDER 0xffffff nil -> cc in let _CRcompText _channel cc nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|CT_EDITLINE|ET_BORDER 0 295 20 ulogin font [0 0 0 0] [0 90] nil nil -> login in let _PAINTcontainer cc -> _ in // name du site let _DRAWtext _FILLbitmap _CRbitmap _channel 85 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "Site name" -> bmp in let _DRAWrectangle bmp 0 0 85 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 75] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 85 20 -> _ in let _CRcontainerFromObjCont _channel c 95 75 295 20 CO_CHILDINSIDE|CO_3DBORDER 0xffffff nil -> cc in let _CRcompText _channel cc nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|CT_EDITLINE 0 295 20 "SCSsite" font [0 0 0 0] [0 90] nil nil -> name in let _PAINTcontainer cc -> _ in // langue let _DRAWtext _FILLbitmap _CRbitmap _channel 85 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "Language" -> bmp in let _DRAWrectangle bmp 0 0 85 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 100] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 85 20 -> _ in let _CRcontainerFromObjCont _channel c 95 100 295 80 CO_CHILDINSIDE|CO_3DBORDER 0xffffff nil -> cc in let _CRcompList _channel cc nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|LST_HIGHLIGHT_CLICKED|LST_TOP 0 295 80 5 LST_VERTICAL font 0 [0 0 0 0] [0 90] nil -> langue in let _PAINTcontainer cc -> _ in // ok let _DRAWtext _FILLbitmap _CRbitmap _channel 85 20 make_rgb 140 180 220 _CRfont _channel 16 0 FF_WEIGHT "Arial" 11 1 0 0 "OK" -> bmp in let _DRAWrectangle bmp 0 0 85 20 DRAW_SOLID 1 0 DRAW_INVISIBLE 0 -> bmp in let _CRalphaBitmap _channel bmp nil nil nil -> abmp in let _DSbitmap bmp -> _ in let _CRcompBitmap _channel c nil [5 185] OBJ_ENABLE|OBJ_VISIBLE 0 abmp 0 0 85 20 -> ok in ( _ADDcompList langue 0 ["english" nil]; _ADDcompList langue 0 ["french" nil]; _PAINTcontainer cc; _PAINTcontainer c; _CBcompBitmapClick ok @cbStep0bOK [wn c login name langue]; ); 0;; /*************************************************************/ /***** DOWNLOAD RESSOURCES *************/ /***** *************/ /*************************************************************/ // fun [ObjButton I] I fun cbEndDlOk(obj, u)= _DStext textDl; _DSwindow winDl; step0 ;; // fun [[S I] r1] I fun addErrDl(l)= if l == nil then 0 else let hd l -> [file code] in ( _ADDtext textDl strcat defPath strcat file strcat ", code n° " strcat itoa code "\n"; addErrDl tl l ) ;; /* fin des téléchargements des ressources Si la liste des erreurs est non vide, elle est affichée */ // fun [] I fun endDlRsc()= if errDl == nil then ( _DStext textDl; _DSwindow winDl; step0 ) else // il y a eu des erreurs durant la séquence des téléchargements ( _SETtext textDl "Error files :\n"; addErrDl errDl; _SIZEwindow winDl 300 325 100 100; _CBbutton _CRbutton _channel winDl 5 300 290 20 0 "OK" @cbEndDlOk 0; 0 ) ;; /* enregistrement dans le cache client. Si le fichier n'a pu être sauvegardé ou si le fichier est incorrect, incrémente la liste des erreurs. */ // fun [S] I fun saveFile(file)= let _storepack datatmp strcat defPath file -> r in let _getpack _checkpack strcat defPath file -> s in if r != 0 then set errDl = [file 2005]::errDl else if (strfindi "Not Found" s 0) != nil then set errDl = [file 20050]::errDl else nil; 0 ;; /* callback de téléchargement. Si le fichier est dl, l'enregistre sur le DD, sinon, incrémente la liste d'erreur avec le code retourné par le serveur. Puis appelle le fichier suivant */ // fun [INET [S fun [[S r1]] I [S r1]] S I] I fun cbDlRSC(inet, u, data, err)= if err == 0 then ( set datatmp = strcat datatmp data; 0 ) else if err == 1 then let u -> [file f rsc] in ( saveFile file; exec f with [rsc] ) else let u -> [file f rsc] in ( set errDl = [file err]::errDl; exec f with [rsc] ) ;; /* télécharge les ressources vérifie si le fichier est déjà présent dans le cache client : si oui, passe au fichier suivant (pas de téléchargement) sinon télécharge le fichier attention : fichiers non signés. Rien ne dit que le fichier présent est à la bonne version .... */ // fun [[S r1]] I fun dlRSC(rsc)= if rsc == nil then endDlRsc else let hd rsc -> file in let _checkpack strcat defPath file -> c in if c != nil then // fichier présent dans le cache client ( _SETtext textDl strcat defPath strcat file strcat "\n" _GETtext textDl; _PAINTwindow winDl; dlRSC tl rsc ) else // fichier non présent dans le cache client : demande son téléchargement ( set datatmp = nil; _SETtext textDl strcat defPath strcat file strcat "\n" _GETtext textDl; _PAINTwindow winDl; INETGetURL _channel strcat "http://iri3d.free.fr/Docs/scs_scol/demoscs/" file 0 @cbDlRSC [file @dlRSC tl rsc]; 0 ) ;; /* initialise les ressources à télécharger (facilite la gestionde l'applet, mais attention, les fichiers ne sont pas signés. A faire ...) */ // fun [] I fun initdlRSC()= set winDl = _CRwindow _channel nil 100 100 300 300 0 " _|_ LOADING ... _|_"; set textDl = _CRtext _channel winDl 5 5 290 290 ET_BORDER|ET_AHSCROLL|ET_VSCROLL "Please wait ..."; /* listing auto impossible sauf à tout mettre dans le dossier 'public'. Une applet trale cahce activé A compléter s'il y a lieu (attention à la casse !!) */ // fichiers de langue let "lang/french.lang" :: "lang/english.lang" :: // ressources 3d "rsc3d/BED3001.M3D" :: "rsc3d/BED3009A.JPG" :: "rsc3d/BED3010A.JPG" :: "rsc3d/BED3010E.JPG" :: "rsc3d/BED3011A.JPG" :: "rsc3d/BED3011F.JPG" :: "rsc3d/BED3012A.JPG" :: "rsc3d/BED3013A.JPG" :: "rsc3d/cam.m3d" :: "rsc3d/CEI3020E.JPG" :: "rsc3d/CEI3021E.JPG" :: "rsc3d/CEI3022E.JPG" :: "rsc3d/CHA3001.M3D" :: "rsc3d/DES3001.M3D" :: "rsc3d/DIV3001.M3D" :: "rsc3d/DOR3001.M3D" :: "rsc3d/DOR3001D.JPG" :: "rsc3d/GRO3016E.JPG" :: "rsc3d/LEA3001B.JPG" :: "rsc3d/MET3001B.JPG" :: "rsc3d/ROO3001.BOX" :: "rsc3d/ROO3001.M3D" :: "rsc3d/SID3001D.JPG" :: "rsc3d/SID3002D.JPG" :: "rsc3d/SID3004F.JPG" :: "rsc3d/SID3005D.JPG" :: "rsc3d/STN3004F.JPG" :: "rsc3d/WAL3005E.JPG" :: "rsc3d/WAL3006E.JPG" :: "rsc3d/WOO3001B.JPG" :: "rsc3d/WOO3017E.JPG" :: // images "img/3d.scs.png" :: "img/addobject.french.jpg" :: "img/addobjectarbo.png" :: "img/button.scs.png" :: "img/c3d3main.french.png" :: "img/c3d3_transp.french.png" :: "img/clientnu.png" :: "img/clientproperty.french.png" :: "img/colortermaction.png" :: "img/colortermedit.french.png" :: "img/colortermevent.png" :: "img/contact.scs.png" :: "img/creatree.french.png" :: "img/edbutton.french.png" :: "img/edcolorterm.french.png" :: "img/edcontact.french.png" :: "img/edio.french.png" :: "img/editor.french.png" :: "img/edphoto3.english.png" :: "img/edphoto3.french.png" :: "img/filtre3d.french.png" :: "img/io.scs.png" :: "img/login.scs.png" :: "img/loginaction.png" :: "img/loginevent.png" :: "img/mdisplay.english.png" :: "img/mdisplay.french.png" :: "img/medit.english.png" :: "img/medit.french.png" :: "img/mfiles.english.png" :: "img/mfiles.french.png" :: "img/mhelp.english.png" :: "img/mhelp.french.png" :: "img/mod1.png" :: "img/modShellEvent.png" :: "img/mproject.english.png" :: "img/mproject.french.png" :: "img/photo.scs.png" :: "img/scsmainmodex.french.png" :: "img/scsmainvide.english.png" :: "img/scsmainvide.french.png" :: "img/servernu.png" :: "img/serverproperty.french.png" :: "img/term.scs.png" :: nil -> rsc in dlRSC rsc ;; /********************************************************/ /***** PREMIERE FONCTION / MAIN ************/ /***** ************/ /********************************************************/ fun main()= set ulogin = strcat "guest_" _getress "demoSCSlogin"; init; initdlRSC;;