/* Term3d version 1.0 - part Editor */ /* by iri : info@irizone.net - 01/2004 */ /* rev. by iri - 03/2004 : add data "initTxt", events "in", "log" and "getTerm" and action "setTerm" */ /* rev. by iri - 05/2004 : add "FSbottom" = how display the term3d at the fullscreen mode ? add "ChgCliSize" = the client can (or not) change the position and size of the term3d add actionC ".getLink" eventC ".away" & ".back" add to manage links 3d add hilite color */ /* rev. by iri - 08/2004 : nouvelle version éditeur + quelques ajouts */ /* Licence : Cette création est mise à disposition selon le Contrat Paternité - Partage des Conditions Initiales à l'Identique disponible en ligne http://creativecommons.org/licenses/by-sa/2.0/fr/deed.fr ou par courrier postal à Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. */ struct TtermEdit = [T_winEd : ObjWin, T_win : ObjWin, T_font : ObjText, T_color : I, T_hilite : I, T_fsize : ObjText, T_pathScrollAv : ObjText, T_x : ObjText, T_y : ObjText, T_w : ObjText, T_h : ObjText, T_bCustom : ObjCheck, T_nameCustom : ObjText, T_initMsg : ObjText, T_termBottom : ObjCheck, T_chgSizeUser : ObjCheck, T_displayLinks : ObjCheck, T_transparency : ObjCheck, T_pathSmileys : ObjText, T_displayAv : ObjCheck, T_AvUpLeft : ObjCheck, T_AvDownLeft : ObjCheck, T_wAv : ObjText, T_hAv : ObjText, T_colorTerm : ObjCheck ] mkTermEdit;; typeof plugin = S;; typeof class = S;; typeof T = [S S S S S S S S S S S S S S S S S S S S S S S];; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun InstName(UI)= UI.nameInst ;; fun cbOk(btn, z)= set T = [_GETtext z.T_font itoa z.T_color itoa z.T_hilite _GETtext z.T_fsize _GETtext z.T_pathScrollAv _GETtext z.T_x _GETtext z.T_y _GETtext z.T_w _GETtext z.T_h itoa _GETcheck z.T_bCustom _GETtext z.T_nameCustom _GETtext z.T_initMsg itoa _GETcheck z.T_termBottom itoa _GETcheck z.T_chgSizeUser itoa _GETcheck z.T_displayLinks itoa _GETcheck z.T_transparency _GETtext z.T_pathSmileys itoa _GETcheck z.T_displayAv itoa _GETcheck z.T_AvUpLeft itoa _GETcheck z.T_AvDownLeft _GETtext z.T_wAv _GETtext z.T_hAv itoa _GETcheck z.T_colorTerm]; _DSwindow z.T_win;; fun cbEnd(wn, z)= cbOk nil z; _DSwindow z.T_win;; /* booleens */ fun cbAvList(obj, z, etat)= if etat then ( _ENcheck z.T_AvUpLeft 1; _ENcheck z.T_AvDownLeft 1; _ENtext z.T_wAv 1; _ENtext z.T_hAv 1; _ENcheck z.T_transparency 1; _ENtext z.T_pathScrollAv 1; _ENcheck z.T_displayLinks 1 ) else ( _ENcheck z.T_AvUpLeft 0; _ENcheck z.T_AvDownLeft 0; _ENtext z.T_wAv 0; _ENtext z.T_hAv 0; _ENcheck z.T_transparency 0; _ENtext z.T_pathScrollAv 0; _ENcheck z.T_displayLinks 0 ); 0;; fun cbMenu(Obj, z, etat)= if etat then _ENtext z.T_nameCustom 1 else _ENtext z.T_nameCustom 0; 0;; /* choix paths */ fun cbOpenAv(dlb, z, file)= _SETtext z.T_pathScrollAv if file == nil then _GETtext z.T_pathScrollAv else _PtoScol file; 0;; fun cbOpenSmileys(dlb, z, file)= _SETtext z.T_pathSmileys if file == nil then _GETtext z.T_pathSmileys else _PtoScol file; 0;; fun cbPathAv(b, z)= _DLGrflopen _DLGOpenFile _channel z.T_win _GETtext z.T_pathScrollAv "top.jpg" "jpg\0*.jpg\0\0" @cbOpenAv z; 0;; fun cbPath(b, z)= _DLGrflopen _DLGOpenFile _channel z.T_win _GETtext z.T_pathSmileys nil "Bitmap\0*.jpg,*.bmp\0\0" @cbOpenSmileys z; 0;; /* choix couleurs */ fun _chooseHilite(color, z)= if color != nil then ( set z.T_hilite = color; 0 ) else 0 ;; fun _chooseColor(color, z)= if color != nil then ( set z.T_color = color; 0 ) else 0 ;; fun showHiliteMap(button, z) = _CRcolorMap _channel z.T_win 5 125 "choose a color" mkfun2 @_chooseHilite z z.T_hilite; 0 ;; fun showColorMap(button, z) = _CRcolorMap _channel z.T_win 5 125 "choose a color" mkfun2 @_chooseColor z z.T_color; 0 ;; /* callback win */ fun _paintE(a, z)= _PAINTrectangle z.T_win 175 30 20 20 DRAW_SOLID 1 0 DRAW_SOLID z.T_color; _PAINTrectangle z.T_win 365 30 20 20 DRAW_SOLID 1 0 DRAW_SOLID z.T_hilite;; /* editor */ fun cbLaunch(b, u)= let u -> [z l w h] in ( set z.T_win = _CRwindow _channel z.T_winEd 5 5 w h WN_MENU "Term3d : Editor"; /* font */ _CRtext _channel z.T_win 5 5 100 20 0 "Font / Police :"; set z.T_font = _CReditLine _channel z.T_win 110 5 200 20 ET_DOWN let getInfo l "font" -> string in if string == nil then "Arial" else string; /* font size */ _CRtext _channel z.T_win 405 5 100 20 0 "Size / Taille :"; set z.T_fsize = _CReditLine _channel z.T_win w-90 5 85 20 ET_DOWN|ET_NUMBER let getInfo l "size" -> string in if string == nil then "12" else string; /* font color (default) */ _CRtext _channel z.T_win 5 30 100 20 0 "Color / Couleur :"; set z.T_color = let getInfo l "color" -> string in if string == nil then z.T_color else atoi string; _CBbutton _CRbutton _channel z.T_win 110 30 60 20 0 "Color" @showColorMap z; /* hilite color */ _CRtext _channel z.T_win 200 30 100 20 0 "Hilite / Surligne"; set z.T_hilite = let getInfo l "colorHilite" -> string in if string == nil then z.T_hilite else atoi string; _CBbutton _CRbutton _channel z.T_win 300 30 60 20 0 "Hilite" @showHiliteMap z; /* coords x y w h */ _CRtext _channel z.T_win 5 55 w-100 20 0 "Distance top of 3d and top of term / Distance entre le haut de la 3d et le haut du term"; set z.T_x = _CReditLine _channel z.T_win w-90 55 85 20 ET_DOWN|ET_NUMBER let getInfo l "x" -> string in if string == nil then "" else string; _CRtext _channel z.T_win 5 80 w-100 20 0 "Distance bottom of 3d and bottom of term (y) / (y) Distance entre le bas de la 3d et le bas du term"; set z.T_y = _CReditLine _channel z.T_win w-90 80 85 20 ET_DOWN|ET_NUMBER let getInfo l "y" -> string in if string == nil then "" else string; _CRtext _channel z.T_win 5 105 w-100 20 0 "Width of the term / Largeur du term"; set z.T_w = _CReditLine _channel z.T_win w-90 105 85 20 ET_DOWN|ET_NUMBER let getInfo l "w" -> string in if string == nil then "" else string; _CRtext _channel z.T_win 5 130 w-100 20 0 "Height of the term / Hauteur du term"; set z.T_h = _CReditLine _channel z.T_win w-90 130 85 20 ET_DOWN|ET_NUMBER let getInfo l "h" -> string in if string == nil then "" else string; /* y constant ? */ _CRtext _channel z.T_win 5 155 w-30 20 0 "In fullscreen mode, y must be constant / En mode plein écran, y doit être constant"; set z.T_termBottom = _CRcheck _channel z.T_win w-20 155 15 15 CH_DOWN nil; _SETcheck z.T_termBottom let getInfo l "FSbottom" -> string in if string == nil then 1 else atoi string; /* can user change coords */ _CRtext _channel z.T_win 5 180 w-30 20 0 "User can change to the position of term / Le client peut changer la position du term"; set z.T_chgSizeUser = _CRcheck _channel z.T_win w-20 180 15 15 CH_DOWN nil; _SETcheck z.T_chgSizeUser let getInfo l "ChgCliSize" -> string in if string == nil then 0 else atoi string; /* first message */ _CRtext _channel z.T_win 5 205 w-270 20 0 "First message displayed / Premier message affiché"; set z.T_initMsg = _CReditLine _channel z.T_win w-260 205 260 20 ET_DOWN|ET_AHSCROLL let getInfo l "initTxt" -> string in if string == nil then "Welcome !" else string; /* path smileys */ _CRtext _channel z.T_win 5 230 w-270 20 0 "Path smileys / Chemin des smileys"; set z.T_pathSmileys = _CRtext _channel z.T_win w-200 230 195 20 ET_DOWN|ET_AHSCROLL let getInfo l "pathsmileys" -> string in if string == nil then "dms/3d/plugins/term3d/smileys" else string; _CBbutton _CRbutton _channel z.T_win w-260 230 55 20 0 "Change" @cbPath z; /* display links */ _CRtext _channel z.T_win 5 255 w-30 20 0 "Links 3d displayed with Term3d / Liens 3d affiché avec le Term3d"; set z.T_displayLinks = _CRcheck _channel z.T_win w-20 255 15 15 CH_DOWN nil; _SETcheck z.T_displayLinks let getInfo l "displayLinks" -> string in if string == nil then 0 else atoi string; /* display list avatar */ _CRtext _channel z.T_win 5 280 w-30 20 0 "Display the list of avatar with it / Liste des avatars affichée avec le term3d"; set z.T_displayAv = _CRcheck _channel z.T_win w-20 280 15 15 CH_DOWN nil; _SETcheck z.T_displayAv let getInfo l "displayAvList" -> string in if string == nil then 0 else atoi string; /* coords av list */ _CRtext _channel z.T_win 5 305 w-30 20 0 "The list must be displayed at \"upleft\" / La liste doit être affichée à \"hautgauche\""; set z.T_AvUpLeft = _CRcheck _channel z.T_win w-20 305 15 15 CH_DOWN nil; _SETcheck z.T_AvUpLeft let getInfo l "xAvList" -> string in if string == nil then 0 else atoi string; _CRtext _channel z.T_win 5 330 w-30 20 0 "The list must be displayed at \"downleft\" / La liste doit être affichée à \"basgauche\""; set z.T_AvDownLeft = _CRcheck _channel z.T_win w-20 330 15 15 CH_DOWN nil; _SETcheck z.T_AvDownLeft let getInfo l "yAvList" -> string in if string == nil then 0 else atoi string; _CRtext _channel z.T_win 5 355 150 20 0 "List : width / Liste : largeur"; set z.T_wAv = _CReditLine _channel z.T_win 160 355 30 20 ET_DOWN|ET_NUMBER let getInfo l "wAvList" -> string in if string == nil then "100" else string; _CRtext _channel z.T_win 400 355 100 20 0 "List : height / Liste : hauteur"; set z.T_hAv = _CReditLine _channel z.T_win w-35 355 30 20 ET_DOWN|ET_NUMBER let getInfo l "hAvList" -> string in if string == nil then "100" else string; /* buttons scroll av */ _CRtext _channel z.T_win 5 380 w-270 20 0 "Path buttons ListAv / Chemin boutons ListeAv"; set z.T_pathScrollAv = _CRtext _channel z.T_win w-200 380 195 20 ET_DOWN|ET_AHSCROLL let getInfo l "pathBgAv" -> string in if string == nil then "dms/3d/plugins/term3d/" else string; _CBbutton _CRbutton _channel z.T_win w-260 380 55 20 0 "Change" @cbPathAv z; /* transparence */ _CRtext _channel z.T_win 5 405 w-30 20 0 "Transparency (Term, links & list) / Transparence (Term, liens & liste)"; set z.T_transparency = _CRcheck _channel z.T_win w-20 405 15 15 CH_DOWN nil; _SETcheck z.T_transparency let getInfo l "Trans" -> string in if string == nil then 1 else atoi string; /* custom item (menu) */ _CRtext _channel z.T_win 5 430 150 20 0 "Customize menu / menu personnalisé"; set z.T_bCustom = _CRcheck _channel z.T_win 160 430 15 15 CH_DOWN nil; _SETcheck z.T_bCustom let getInfo l "customItem" -> string in if string == nil then 0 else atoi string; _CRtext _channel z.T_win 200 430 30 20 0 "Item :"; set z.T_nameCustom = _CReditLine _channel z.T_win 240 430 w-245 20 ET_DOWN|ET_AHSCROLL let getInfo l "customItemName" -> string in if string == nil then "Custom menu item ..." else string; /* explication */ _CRtext _channel z.T_win 5 455 w-10 40 ET_BORDER|ET_ALIGN_CENTER "set up this plugin and validate (\"OK\") this window. So, clic on \"ok\" (save) or \"cancel\" button\nconfigurez ce plugin et validez (\"OK\") la fenêtre. Cliquez ensuite sur le bouton \"ok\"(enregistrer) ou \"annuler\""; /* validation */ _CBbutton _CRbutton _channel z.T_win 5 500 w-10 20 0 "OK" @cbOk z; cbAvList nil z _GETcheck z.T_displayAv; cbMenu nil z _GETcheck z.T_bCustom; _CBwinDestroy z.T_win @cbEnd z; _CBwinPaint z.T_win @_paintE z; _CBcheck z.T_displayAv @cbAvList z; _CBcheck z.T_bCustom @cbMenu z; 0 ) ;; fun openedit(win, param) = let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( let startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class -> ed in let ed.PluginEditorEditWin -> wed in let mkTermEdit[wed nil nil 0 0 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> z in (_CBbutton _CRbutton _channel wed (w/2)-40 h/2 80 20 0 "Open Editor" @cbLaunch [z l 600 525]; _CRtext _channel wed 5 5 w-10 40 ET_BORDER|ET_ALIGN_CENTER "Pour ouvrir l'éditeur, cliquez sur le bouton\nTo launch the editor, clic on this button"); 0 );; fun closeedit()= let T -> [a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23] in strbuild ("font" ::(a1)::nil):: ("size" ::(a4)::nil):: ("x" ::(a6)::nil):: ("y" ::(a7)::nil):: ("w" ::(a8)::nil):: ("h" ::(a9)::nil):: ("color" ::(a2)::nil):: ("colorHilite" ::(a3)::nil):: ("pathBgAv" ::(a5)::nil):: ("customItem" ::(a10)::nil):: ("customItemName"::(a11)::nil):: ("initTxt" ::(a12)::nil):: ("FSbottom" ::(a13)::nil):: ("ChgCliSize" ::(a14)::nil):: ("displayLinks" ::(a15)::nil):: ("trans" ::(a16)::nil):: ("displayAvList" ::(a18 )::nil):: ("xAvList" ::(a19)::nil):: ("yAvList" ::(a20)::nil):: ("wAvList" ::(a21)::nil):: ("hAvList" ::(a22)::nil):: ("smileys" ::("1")::nil):: /* auto - si dossier vide, pas de smiley */ ("pathsmileys" ::(a17)::nil):: nil ;; fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("action"::(strcat class ".broadInfo")::nil):: ("action"::(strcat class ".privateMsg")::nil):: ("action"::(strcat class ".!chgLogin")::nil):: ("action"::(strcat class ".!updateAv")::nil):: ("action"::(strcat class ".!chgColorFromColorTerm")::nil):: ("action"::(strcat class ".fromColorTerm")::nil):: ("actionC"::(strcat class ".IgnoreFlag")::nil):: ("actionC"::(strcat class ".IgnChgLogin")::nil):: ("actionC"::(strcat class ".IgnLogout")::nil):: ("actionC"::(strcat class ".setTerm")::nil):: ("actionC"::(strcat class ".getLink")::nil):: ("actionC"::(strcat class ".disable")::nil):: ("actionC"::(strcat class ".enable")::nil):: (suppactions nl);; fun save(l) = let l -> [UI nl] in let if (InstName UI)==nil then class else InstName UI -> name in [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ /* dmi */ ("eventC" ::(strcat class ".hidden")::nil):: ("eventC" ::(strcat class ".shown")::nil):: ("eventC" ::(strcat class ".getTerm")::nil):: ("event" ::(strcat class ".toColorTerm")::nil):: /* srv */ ("event" ::(strcat class ".getColorToColorTerm")::nil):: /* srv */ ("eventC" ::(strcat class ".in")::nil):: ("eventC" ::(strcat class ".log")::nil):: ("eventC" ::(strcat class ".message")::nil):: ("eventC" ::(strcat class ".away")::nil):: ("eventC" ::(strcat class ".back")::nil):: ("eventC" ::(strcat class ".helpFR")::nil):: ("eventC" ::(strcat class ".helpUK")::nil):: ("eventC" ::(strcat class ".custom")::nil):: (suppactions l) ] ;; fun IniPlug(file) = set plugin = file; set class = getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit ;;