/* Site Map Editor v1.0 - DMS - Jun. '98 - by Marc BARILLEY */ /* Rev. 1.0 - Aug. '98 - by Marc BARILLEY */ /* Rev. 1.1 - Sep. '98 - by Marc BARILLEY */ /* Rev. - Sep. '01 - by Jérôme ICARD (Païkan) */ var DEF_OUTLINECOLOR = 0;; var DEF_USERCOLOR = 0x0000ff;; var DEF_USERSIZE = 5;; typeof editWin=ObjWin;; typeof mapfile = ObjText;; typeof openmapfile = ObjButton;; typeof altmapFile = ObjText;; typeof openAltmapFile = ObjButton;; typeof viewwin = ObjWin;; typeof Win = ObjWin;; typeof map = ObjBitmap;; typeof workmap = ObjBitmap;; typeof helpstatus = ObjText;; typeof mousestatus = ObjText;; typeof banner = ObjText;; typeof list = ObjList;; typeof xstat = ObjText;; typeof xedit = ObjText;; typeof ystat = ObjText;; typeof yedit = ObjText;; typeof wstat = ObjText;; typeof wedit = ObjText;; typeof hstat = ObjText;; typeof hedit = ObjText;; typeof del = ObjButton;; typeof rename = ObjButton;; typeof outlinemap = ObjBitmap;; typeof outlinebutton = ObjButton;; typeof outlinecheck = ObjCheck;; typeof avatarCheck = ObjCheck;; typeof meWin = ObjWin;; typeof meBanner = ObjText;; typeof meDot = ObjCheck;; typeof meSize = ObjText;; typeof meDotMap = ObjBitmap;; typeof meDotColor = ObjButton;; typeof meBitmap = ObjCheck;; typeof meFile = ObjText;; typeof meOpen = ObjButton;; typeof otherWin = ObjWin;; typeof otherBanner = ObjText;; typeof otherDot = ObjCheck;; typeof otherSize = ObjText;; typeof otherDotMap = ObjBitmap;; typeof otherDotColor = ObjButton;; typeof otherBitmap = ObjCheck;; typeof otherFile = ObjText;; typeof otherOpen = ObjButton;; typeof numberCheck = ObjCheck;; struct Rect = [ aliasRect : S, xRect : I, yRect : I, wRect : I, hRect : I, outlnRect : I, outlnColorRect : I, avatarRect : I, meDotRect : I, meSizeRect : I, meColorRect : I, meBitmapRect : I, meFileRect : S, otherDotRect : I, otherSizeRect : I, otherColorRect : I, otherBitmapRect : I, otherFileRect : S, numberRect : I ] mkRect;; typeof aliases = [Rect r1];; typeof oldindex = I;; typeof x1 = I;; typeof y1 = I;; typeof x2 = I;; typeof y2 = I;; var mouseMove = 0;; var wMap = 140;; var hMap = 190;; var curentPos=0;; var bool = 0;; /* internal */ fun aliasByAlias (r, s)= !strcmp r.aliasRect s;; fun aliasByCoord (r, x_y)= let x_y -> [x y] in (x>=r.xRect)&&(x<=r.xRect+r.wRect)&&(y>=r.yRect)&&(y<=r.yRect+r.hRect);; fun drawaliases (l)= if l==nil then workmap else let hd l -> r in { _DRAWrectangle workmap r.xRect r.yRect r.wRect r.hRect DRAW_SOLID 1 r.outlnColorRect DRAW_INVISIBLE r.outlnColorRect; drawaliases tl l; };; fun highlight (r)= let _FILLbitmap _CRbitmap _channel r.wRect-2 r.hRect-2 r.outlnColorRect -> btmp in { _SPLUSbitmap workmap r.xRect+1 r.yRect+1 r.wRect-2 r.hRect-2 btmp 0 0; _DSbitmap btmp; }; _PAINTwindow viewwin;; fun status (string)= _SETtext helpstatus string; string;; /* reflexes */ proto rflOutlineButton = fun [ObjButton [I I]] I;; fun selOutlineColor (c, index)= if c==nil then nil else let nth_list aliases index -> r in { set r.outlnColorRect = c; let _GETbitmapSize map -> [bw bh] in { _CPbitmap16 workmap 0 0 map 0 0 bw-1 bh-1 nil; _FILLbitmap outlinemap c; _SETbuttonBitmap outlinebutton outlinemap; _CBbutton outlinebutton @rflOutlineButton [c index]; }; drawaliases aliases; highlight r; }; 0;; fun rflOutlineButton (b, color_index)= let color_index -> [color index] in /* loc( _CRcolorMap _channel editWin 100 100 "Outline Color" mkfun2 @selOutlineColor index color; ) */ _CRcolorMap _channel editWin 100 100 (_locEditor "1500-MAPEDI-outlinecol" nil) mkfun2 @selOutlineColor index color; 0;; proto rflMeDotColor = fun [ObjButton [I I]] I;; fun selMeDotColor (c, index)= if c==nil then nil else { let nth_list aliases index -> r in set r.meColorRect = c; let _GETbitmapSize map -> [bw bh] in { _FILLbitmap meDotMap c; _SETbuttonBitmap meDotColor meDotMap; _CBbutton meDotColor @rflMeDotColor [c index]; }; }; 0;; fun rflMeDotColor (b, color_index)= let color_index -> [color index] in /* loc( _CRcolorMap _channel editWin 100 100 "Outline Color" mkfun2 @selMeDotColor index color; ) */ _CRcolorMap _channel editWin 100 100 (_locEditor "1500-MAPEDI-outlinecol" nil) mkfun2 @selMeDotColor index color; 0;; proto rflOtherDotColor = fun [ObjButton [I I]] I;; fun selOtherDotColor (c, index)= if c==nil then nil else { let nth_list aliases index -> r in set r.otherColorRect = c; let _GETbitmapSize map -> [bw bh] in { _FILLbitmap otherDotMap c; _SETbuttonBitmap otherDotColor otherDotMap; _CBbutton otherDotColor @rflOtherDotColor [c index]; }; }; 0;; fun rflOtherDotColor (b, color_index)= let color_index -> [color index] in /* loc( _CRcolorMap _channel editWin 100 100 "Outline Color" mkfun2 @selOtherDotColor index color; ) */ _CRcolorMap _channel editWin 100 100 (_locEditor "1500-MAPEDI-outlinecol" nil) mkfun2 @selOtherDotColor index color; 0;; fun select (index)= set curentPos = index; if oldindex==nil then nil else let _GETtext xedit -> x in let _GETtext yedit -> y in let _GETtext wedit -> w in let _GETtext hedit -> h in let _GETcheck outlinecheck -> outln in let _GETcheck avatarCheck -> avatar in let _GETcheck meDot -> medot in let _GETtext meSize -> mesize in let _GETcheck meBitmap -> mebitmap in let _GETtext meFile -> mefile in let _GETcheck otherDot -> otherdot in let _GETtext otherSize -> othersize in let _GETcheck otherBitmap -> otherbitmap in let _GETtext otherFile -> otherfile in let _GETcheck numberCheck -> number in /* if (0==strlen x) || (0==strlen y) || (0==strlen w) || (0==strlen h) || (0==strlen usersize) then nil else */ let nth_list aliases oldindex -> r in { set r.xRect = atoi x; set r.yRect = atoi y; set r.wRect = atoi w; set r.hRect = atoi h; set r.outlnRect = outln; set r.avatarRect = avatar; set r.meDotRect = medot; set r.meSizeRect = atoi mesize; set r.meBitmapRect = mebitmap; set r.meFileRect = mefile; set r.otherDotRect = otherdot; set r.otherSizeRect = atoi othersize; set r.otherBitmapRect = otherbitmap; set r.otherFileRect = otherfile; set r.numberRect = number; }; let nth_list aliases index -> r in { set oldindex = index; _SETtext xedit itoa r.xRect; _SETtext yedit itoa r.yRect; _SETtext wedit itoa r.wRect; _SETtext hedit itoa r.hRect; _SETcheck outlinecheck r.outlnRect; _FILLbitmap outlinemap r.outlnColorRect; _SETbuttonBitmap outlinebutton outlinemap; _CBbutton outlinebutton @rflOutlineButton [r.outlnColorRect index]; _SETcheck avatarCheck r.avatarRect; _SETcheck meDot r.meDotRect; _SETtext meSize itoa r.meSizeRect; _FILLbitmap meDotMap r.meColorRect; _SETbuttonBitmap meDotColor meDotMap; _CBbutton meDotColor @rflMeDotColor [r.meColorRect index]; _SETcheck meBitmap r.meBitmapRect; _SETtext meFile r.meFileRect; _SETcheck otherDot r.otherDotRect; _SETtext otherSize itoa r.otherSizeRect; _FILLbitmap otherDotMap r.otherColorRect; _SETbuttonBitmap otherDotColor otherDotMap; _CBbutton otherDotColor @rflOtherDotColor [r.otherColorRect index]; _SETcheck otherBitmap r.otherBitmapRect; _SETtext otherFile r.otherFileRect; _SETcheck numberCheck r.numberRect; let _GETbitmapSize map -> [bw bh] in _CPbitmap16 workmap 0 0 map 0 0 bw-1 bh-1 nil; drawaliases aliases; highlight r; };; /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ fun GetCheckRect ()= /*retourne un tuple correspondant aux états des differentes Check box de l'interface*/ let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in [r.outlnRect r.avatarRect r.meDotRect r.otherDotRect];; /*****************************************************************************/ fun setDisable ()= /*-------------------Enable|Disable des elements d'interface--------*/ /*-----------------------------1)zones*/ _ENtext xedit 0; _ENtext yedit 0; _ENtext wedit 0; _ENtext hedit 0; _ENbutton del 0; _ENbutton rename 0; _ENcheck outlinecheck 0; _ENbutton outlinebutton 0; /*-------------------2)Montrer les avatars*/ _ENcheck avatarCheck 0; /*-------------------mon avatar ----------*/ _ENcheck meDot 0; /*comme point*/ _ENtext meSize 0; _ENbutton meDotColor 0; _ENcheck meBitmap 0; /*comme bitmap*/ _ENtext meFile 0; _ENbutton meOpen 0; /*----------les autres avatars------------*/ _ENcheck otherDot 0; /*comme points*/ _ENtext otherSize 0; _ENbutton otherDotColor 0; _ENcheck otherBitmap 0; /*comme bitmap*/ _ENtext otherFile 0; _ENbutton otherOpen 0; _ENcheck numberCheck 0; 0 ;; /*****************************************************************************/ fun setEnableAv (Flag)= _ENcheck meDot Flag; _ENtext meSize Flag; _ENcheck meBitmap Flag; _ENtext meFile Flag; _ENcheck otherDot Flag; _ENtext otherSize Flag; _ENcheck otherBitmap Flag; _ENtext otherFile Flag; _ENbutton meDotColor Flag; _ENbutton otherDotColor Flag; _ENbutton meOpen Flag; _ENbutton otherOpen Flag; 0 ;; /*****************************************************************************/ fun setEnableMe (Flag)= if Flag then ( _ENtext meSize 1; _ENbutton meDotColor 1; _ENtext meFile 0; _ENbutton meOpen 0; 0 ) else ( _ENtext meSize 0; _ENbutton meDotColor 0; _ENtext meFile 1; _ENbutton meOpen 1; 0 ); 0 ;; /*****************************************************************************/ fun setEnableOther (Flag)= if Flag then ( _ENtext otherSize 1; _ENbutton otherDotColor 1; _ENtext otherFile 0; _ENbutton otherOpen 0; 0 ) else ( _ENtext otherSize 0; _ENbutton otherDotColor 0; _ENtext otherFile 1; _ENbutton otherOpen 1; 0 ); 0 ;; /*****************************************************************************/ fun setEnableAvRect ()= let GetCheckRect -> [ _ avRect medot otherdot ] in if avRect then ( _ENcheck otherDot 1; _ENcheck otherBitmap 1; _ENcheck meBitmap 1; _ENcheck meDot 1; if medot then setEnableMe 1 else setEnableMe 0; if otherdot then setEnableOther 1 else setEnableOther 0; 0 ) else setEnableAv 0;; /*****************************************************************************/ fun setEnablebyCheckState(Flag)= let GetCheckRect -> [ outln _ _ _ ] in if Flag then ( _ENtext xedit Flag; _ENtext yedit Flag; _ENtext wedit Flag; _ENtext hedit Flag; _ENbutton del Flag; _ENbutton rename Flag; _ENcheck outlinecheck Flag; _ENcheck avatarCheck Flag; _ENcheck numberCheck Flag; if outln then ( _ENbutton outlinebutton 1; 0 ) else ( _ENbutton outlinebutton 0; let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in ( let r.outlnColorRect -> oldoutlnColorRect in ( selOutlineColor (make_rgb 0 0 0) index; set r.outlnColorRect = oldoutlnColorRect; 0 ) ); 0 ); setEnableAvRect; 0 ) else setDisable;; /*****************************************************************************/ /*****************************************************************************/ fun rflClickList (l, blurp, index, string)= select index; setEnablebyCheckState (1);; fun rflPaintViewwin (w, blurp)= _BLTbitmap w workmap 0 0;; fun rflOkEditName (ed, wn_x1_y1_x2_y2, string)= if 0==strlen string then _DLGMessageBox _channel editWin (_locEditor "2930-MAPEDI-error" nil) status (_locEditor "2931-MAPEDI-thenamesho" nil) 0 else let wn_x1_y1_x2_y2 -> [wn x1 y1 x2 y2] in let search_in_list aliases @aliasByAlias string -> a in if a==nil then { set aliases = listcat aliases (mkRect [ string x1 y1 x2-x1-1 y2-y1-1 0 DEF_OUTLINECOLOR 1 1 DEF_USERSIZE DEF_USERCOLOR 0 "" 1 DEF_USERSIZE DEF_USERCOLOR 0 "" 1 ])::nil; _DSwindow wn; _ADDlist list _GETlistCount list string; status (_locEditor "3140-MAPEDI-zonerecord" nil); nil } else _DLGMessageBox _channel editWin (_locEditor "2930-MAPEDI-error" nil) status (_locEditor "3181-MAPEDI-thisnameal" nil) 0;; fun rflOkZoneName (b, wn_ed_x1_y1_x2_y2)= let wn_ed_x1_y1_x2_y2 -> [wn ed x1 y1 x2 y2] in rflOkEditName ed [wn x1 y1 x2 y2] _GETtext ed;; fun rflCancelZoneName (b, wn)= /* loc( status "Zone canceled"; ) */ status (_locEditor "3250-MAPEDI-zonecancel" nil); let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; _PAINTwindow viewwin; _DSwindow wn;; fun rflClickViewwin (w, blurp, x, y, b) = /* loc( status "Drag the mouse to draw a zone"; ) */ status (_locEditor "3330-MAPEDI-dragthemou" nil); _SETtext mousestatus strcatn (itoa x)::","::(itoa y)::nil; set x1 = x; set y1 = y;; fun rflUnclickViewwin (w, blurp, x, y, b) = if mouseMove then { /*-----inverse select zone------*/ if ((x-x1)>0) then nil else let x -> tmp in ( set x=x1; set x1=tmp; 0 ); if ((y-y1)>0) then nil else let y -> tmp in ( set y=y1; set y1=tmp; 0 ); /*-------------------------------*/ /* loc( status "Name the zone"; ) */ status (_locEditor "3420-MAPEDI-namethezon" nil); /* loc( let _CRwindow _channel editWin 0 140 230 55 0 "Zone Name" -> wn in ) */ let _CRwindow _channel editWin 0 140 230 55 0 (_locEditor "3430-MAPEDI-zonename" nil) -> wn in /* loc( let _CRtext _channel wn 5 5 70 20 ET_ALIGN_CENTER "Zone Name :" -> ban in ) */ let _CRtext _channel wn 5 5 70 20 ET_ALIGN_CENTER (_locEditor "3440-MAPEDI-zonename:" nil) -> ban in let _CReditLine _channel wn 80 5 145 20 ET_DOWN|ET_AHSCROLL "" -> ed in /* loc( let _CRbutton _channel wn 30 30 70 20 0 "Ok" -> okb in ) */ let _CRbutton _channel wn 30 30 70 20 0 (_locEditor "3460-MAPEDI-ok" nil) -> okb in /* loc( let _CRbutton _channel wn 130 30 70 20 0 "Cancel" -> cab in ) */ let _CRbutton _channel wn 130 30 70 20 0 (_locEditor "3470-MAPEDI-cancel" nil) -> cab in { _CBbutton okb @rflOkZoneName [wn ed x1 y1 x y]; _CBbutton cab @rflCancelZoneName wn; _CBlineOk ed @rflOkEditName [wn x1 y1 x y]; nil } } else let search_in_list aliases @aliasByCoord [x y] -> a in if a == nil then nil else let pos_in_list aliases a 0 -> index in { select index; set curentPos = index; _SELlist list index; setEnablebyCheckState (1); };; fun rflCursorMoveViewwin (w, blurp, x, y, b) = _SETtext mousestatus strcatn (itoa x)::","::(itoa y)::nil; if b==1 then { set mouseMove = 1; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; _DRAWrectangle workmap x1 y1 x-x1-1 y-y1-1 DRAW_SOLID 1 0x000000 DRAW_INVISIBLE 0x000000; _PAINTwindow w; /* loc( status "Drag the mouse to draw a zone"; ) */ status (_locEditor "3330-MAPEDI-dragthemou" nil); } else { set mouseMove = 0; /* loc( status "Click down to draw a rectangle" ) */ status (_locEditor "3830-MAPEDI-clickdownt" nil) };; fun rflOkXedit (t, blurp, string)= let _GETlist list -> [index _] in if index==nil then nil else let nth_list aliases index -> r in { if 0==strlen string then { _SETtext t itoa r.xRect; nil } else { set r.xRect = atoi string; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; highlight r; } };; fun rflOkYedit (t, blurp, string)= let _GETlist list -> [index _] in if index==nil then nil else let nth_list aliases index -> r in { if 0==strlen string then { _SETtext t itoa r.yRect; nil } else { set r.yRect = atoi string; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; highlight r; } };; fun rflOkWedit (t, blurp, string)= let _GETlist list -> [index _] in if index==nil then nil else let nth_list aliases index -> r in { if 0==strlen string then { _SETtext t itoa r.wRect; nil } else { set r.wRect = atoi string; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; highlight r; } };; fun rflOkHedit (t, blurp, string)= let _GETlist list -> [index _] in if index==nil then nil else let nth_list aliases index -> r in { if 0==strlen string then { _SETtext t itoa r.hRect; nil } else { set r.hRect = atoi string; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; highlight r; } };; fun rflDel (b, blurp)= let _GETlist list -> [index string] in if index==nil then nil else { set aliases = remove_nth_from_list aliases index; _DELlist list index; set oldindex=nil; let _GETbitmapSize map -> [mw mh] in _CPbitmap16 workmap 0 0 map 0 0 mw-1 mh-1 nil; drawaliases aliases; _PAINTwindow viewwin; setEnablebyCheckState (0); };; fun rflEditRename (t, wn_index, string)= let search_in_list aliases @aliasByAlias string -> a in if 0==strlen string then /* loc( _DLGMessageBox _channel editWin "Error" status "The name should not be empty" 0 ) */ _DLGMessageBox _channel editWin (_locEditor "2930-MAPEDI-error" nil) status (_locEditor "2931-MAPEDI-thenamesho" nil) 0 else if a!=nil then /* loc( _DLGMessageBox _channel editWin "Error" status "This name already exists" 0 ) */ _DLGMessageBox _channel editWin (_locEditor "2930-MAPEDI-error" nil) status (_locEditor "3181-MAPEDI-thisnameal" nil) 0 else let wn_index -> [wn index] in let nth_list aliases index -> r in { set r.aliasRect = string; _DELlist list index; _ADDlist list index string; set curentPos = index; _SELlist list index; _DSwindow wn; status ""; nil };; fun rflOkRename (b, wn_ed_index)= let wn_ed_index -> [wn ed index] in rflEditRename ed [wn index] _GETtext ed;; fun rflCancelRename (b, wn)= _DSwindow wn;; fun rflRename (b, blurp)= let _GETlist list -> [index string] in if index==nil then nil else { /* loc( status "Rename the zone"; ) */ status (_locEditor "5380-MAPEDI-renamethez" nil); /* loc( let _CRwindow _channel editWin 0 140 230 55 0 "Rename the zone" -> wn in ) */ let _CRwindow _channel editWin 0 140 230 55 0 (_locEditor "5380-MAPEDI-renamethez" nil) -> wn in /* loc( let _CRtext _channel wn 5 5 70 20 ET_BORDER|ET_ALIGN_CENTER "New Name" -> ban in ) */ let _CRtext _channel wn 5 5 70 20 ET_BORDER|ET_ALIGN_CENTER (_locEditor "5400-MAPEDI-newname" nil) -> ban in let _CReditLine _channel wn 80 5 145 20 ET_DOWN|ET_AHSCROLL "" -> ed in /* loc( let _CRbutton _channel wn 30 30 70 20 0 "Ok" -> okb in ) */ let _CRbutton _channel wn 30 30 70 20 0 (_locEditor "3460-MAPEDI-ok" nil) -> okb in /* loc( let _CRbutton _channel wn 130 30 70 20 0 "Cancel" -> cab in ) */ let _CRbutton _channel wn 130 30 70 20 0 (_locEditor "3470-MAPEDI-cancel" nil) -> cab in { _CBbutton okb @rflOkRename [wn ed index]; _CBbutton cab @rflCancelRename wn; _CBlineOk ed @rflEditRename [wn index]; } };; fun rflOpenMap (ob, blurp, pack)= if pack==nil then nil else { /* loc( status strcat "Loading file " _PtoScol pack; ) */ status strcat (_locEditor "5580-MAPEDI-loadingfil" nil) _PtoScol pack; let let _LDbitmap _channel pack -> buf in if buf==nil then let _LDjpeg _channel pack -> buf in if buf==nil then nil else buf else buf -> buf in { set buf = if buf==nil then _FILLbitmap _CRbitmap _channel 140 190 0xffffff else buf; let _GETbitmapSize map -> [oldbw oldbh] in let _GETbitmapSize buf -> [bw bh] in { _SETtext mapfile _PtoScol pack; _DSbitmap map; set map=buf; set wMap = bw; set hMap = bh; _DSbitmap workmap; set workmap = _CRbitmap _channel bw bh; let _GETwindowSizePosition editWin -> [w h x y] in let _GETwindowSizePosition Win -> [w2 h2 x2 y2] in ( _SIZEwindow Win if wMap<140 then 460 else wMap+370 if hMap<310 then 475+80+40 else hMap+250+80+40 x2 y2; _SIZEwindow editWin if wMap<140 then 440 else wMap+350 if hMap<310 then 475 else hMap+250 x y; 0 ); _CPbitmap16 workmap 0 0 map 0 0 wMap-1 hMap-1 nil; drawaliases aliases; _SIZEwindow viewwin wMap hMap 5 55; _PAINTwindow viewwin; } }; /* loc( status "Loading complete"; ) */ status (_locEditor "5930-MAPEDI-loadingcom" nil); };; fun rflBrowseMap (b, blurp)= /* loc( status "Select a file"; ) */ status (_locEditor "5970-MAPEDI-selectafil" nil); let getPathFile _GETtext mapfile "" -> [dir _] in _DLGrflopen _DLGOpenFile _channel editWin dir "" "image (*.bmp;*.jpg)\0*.bmp;*.jpg\0all (*.*)\0*.*\0\0" @rflOpenMap 0;; fun rflOkMapfile (t, blurp, string)= if 0==strlen string then { _DSbitmap map; set map=_FILLbitmap _CRbitmap _channel 140 190 0xffffff; set wMap = 140; set hMap = 190; _DSbitmap workmap; set workmap = _FILLbitmap _CRbitmap _channel 140 190 0xffffff; drawaliases aliases; /*_SIZEwindow mainWin 440 475 xmainwin ymainwin;*/ let _GETwindowSizePosition editWin -> [w h x y] in _SIZEwindow editWin 440 475 x y; /* end JZ */ _SIZEwindow viewwin 140 190 5 55; /* loc( status "Map erased"; ) */ status (_locEditor "6190-MAPEDI-maperased" nil); } else rflOpenMap nil blurp _checkpack string;; fun rflOpenFile (dlg, txt_f, pack)= if pack==nil then nil else let txt_f -> [txt f] in { _SETtext txt _PtoScol pack; exec f with [nil _PtoScol pack]; };; fun rflBrowseFile (b, txt_f)= let txt_f -> [txt _] in let getPathFile _GETtext txt "" -> [dir _] in _DLGrflopen _DLGOpenFile _channel editWin dir "" "image (*.bmp;*.jpg)\0*.bmp;*.jpg\0all (*.*)\0*.*\0\0" @rflOpenFile txt_f;; fun rflOutlineCheck (cb, blurp, state)= _ENbutton outlinebutton state; let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in ( set r.outlnRect = state; if !state then let r.outlnColorRect -> oldoutlnColorRect in ( selOutlineColor (make_rgb 0 0 0) index; set r.outlnColorRect = oldoutlnColorRect; 0 ) else selOutlineColor r.outlnColorRect index; );; fun rflAvatarCheck (cb, blurp, state)= let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.avatarRect = state; setEnableAvRect;; fun rflNumberCheck (cb, blurp, state)= let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.numberRect = state;; fun rflMeDot (cb, blurp, state)= setEnableMe 1; let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.meDotRect = state;; fun rflOtherDot (cb, blurp, state)= setEnableOther 1; let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.otherDotRect = state;; fun rflmeBitmap (cb, blurp, state)= _DLGMessageBox _channel nil (_locEditor "BITMAP_INFO_TITLE" nil) (_locEditor "BITMAP_INFO" nil) 0; setEnableMe 0;; fun rflotherBitmap (cb, blurp, state)= _DLGMessageBox _channel nil (_locEditor "BITMAP_INFO_TITLE" nil) (_locEditor "BITMAP_INFO" nil) 0; setEnableOther 0;; fun rflMeFile (txt, blurp)= let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.meFileRect = _GETtext txt;; fun rflOtherFile (txt, blurp)= let _GETlist list -> [index string] in if index==nil then nil else let nth_list aliases index -> r in set r.otherFileRect = _GETtext txt;; /* SCS editor */ fun makealias (l)= if l==nil then nil else let hd l -> r in ("action"::(strcat "in_" r.aliasRect)::nil):: ("action"::(strcat "out_" r.aliasRect)::nil):: ("eventC"::(strcat "click_" r.aliasRect)::nil):: ("eventC"::(strcat "rclick_" r.aliasRect)::nil):: ("eventC"::(strcat "over_" r.aliasRect)::nil):: ("alias2":: r.aliasRect:: (itoa r.xRect)::(itoa r.yRect)::(itoa r.wRect)::(itoa r.hRect):: (itoa r.outlnRect)::(itoa r.outlnColorRect):: (itoa r.avatarRect):: (itoa r.meDotRect)::(itoa r.meSizeRect)::(itoa r.meColorRect)::(itoa r.meBitmapRect)::(if (strlen r.meFileRect)==0 then "*" else r.meFileRect):: (itoa r.otherDotRect)::(itoa r.otherSizeRect)::(itoa r.otherColorRect)::(itoa r.otherBitmapRect)::(if (strlen r.otherFileRect)==0 then "*" else r.otherFileRect):: (itoa r.numberRect):: nil):: (makealias tl l);; fun save (s,n)= select curentPos; set bool=1; ("action"::"start"::"start"::nil):: ("action"::"destroy"::"destroy"::nil):: ("action"::"!changeLogin"::"changeLogin"::nil):: ("action"::"show"::"show"::nil):: ("action"::"hide"::"hide"::nil):: ("event"::"entering"::"entering"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("event"::"select"::"select"::nil):: ("eventC"::"in"::"in"::nil):: ("eventC"::"shown"::"shown"::nil):: ("eventC"::"hidden"::"hidden"::nil):: ("zoneC"::"combo"::nil):: ("zoneC"::"list"::nil):: ("zoneC"::"map"::nil):: ("zoneC"::"button"::nil):: ("registerF"::(_GETtext mapfile)::(_GETtext altmapFile)::nil):: ("rule"::"2"::"Authentification"::"2"::"loginChanged"::"1"::"Site Map"::"1"::"!changeLogin"::nil):: ("mapfile"::(_GETtext mapfile)::nil):: ("alternate"::(_GETtext altmapFile)::nil):: ("wmap"::(itoa wMap)::nil):: ("hmap"::(itoa hMap)::nil):: makealias aliases;; fun filllist (l)= if l==nil then list else let hd l -> r in { _ADDlist list _GETlistCount list r.aliasRect; filllist tl l };; fun loadAliases (l)= if l==nil then { _RSTlist list; filllist aliases } else { if !strcmp hd hd l "alias2" then set aliases = listcat aliases (mkRect [ nth_list hd l 1 atoi nth_list hd l 2 atoi nth_list hd l 3 atoi nth_list hd l 4 atoi nth_list hd l 5 atoi nth_list hd l 6 atoi nth_list hd l 7 atoi nth_list hd l 8 atoi nth_list hd l 9 atoi nth_list hd l 10 atoi nth_list hd l 11 atoi nth_list hd l 12 (if !strcmp "*" (nth_list hd l 13) then "" else (nth_list hd l 13)) atoi nth_list hd l 14 atoi nth_list hd l 15 atoi nth_list hd l 16 atoi nth_list hd l 17 (if !strcmp "*" (nth_list hd l 18) then "" else (nth_list hd l 18)) atoi nth_list hd l 19 ])::nil else if !strcmp hd hd l "alias" then set aliases = listcat aliases (mkRect [ nth_list hd l 1 atoi nth_list hd l 2 atoi nth_list hd l 3 atoi nth_list hd l 4 atoi nth_list hd l 5 atoi nth_list hd l 6 atoi nth_list hd l 7 1 1 atoi nth_list hd l 9 atoi nth_list hd l 8 0 "" 1 atoi nth_list hd l 9 atoi nth_list hd l 8 0 "" 1 ])::nil else nil; loadAliases tl l };; fun rflSizeEditWin (wn, blurp, w, h)= _SIZEtext banner w-wMap-15 20 wMap+10 50; _SIZElist list w-wMap-165 h-280 wMap+10 70; _SIZEtext xstat 20 20 w-150 75; _SIZEtext xedit 45 20 w-125 75; _SIZEtext ystat 25 20 w-75 75; _SIZEtext yedit 45 20 w-50 75; _SIZEtext wstat 25 20 w-150 100; _SIZEtext wedit 45 20 w-125 100; _SIZEtext hstat 25 20 w-75 100; _SIZEtext hedit 45 20 w-50 100; _SIZEcheck outlinecheck 120 20 w-150 125; _SIZEbutton outlinebutton 20 20 w-25 125; _SIZEbutton del 70 20 w-150 150; _SIZEbutton rename 70 20 w-75 150; _SIZEcheck avatarCheck w-wMap-15 20 wMap+10 h-205; let (w-wMap-10)/2 -> wAvWin in { _SIZEwindow meWin wAvWin 135 wMap+10 h-185; _SIZEwindow otherWin wAvWin 135 wMap+wAvWin+5 h-185; }; _SIZEcheck numberCheck w-wMap-15 20 wMap+10 h-40; _SIZEtext helpstatus w-65 20 0 h-20; _SIZEtext mousestatus 65 20 w-65 h-20; 0 ;; fun load (l) = if bool then nil else ( _SETtext mapfile getInfo l "mapfile"; _SETtext altmapFile getInfo l "alternate"; set aliases=nil; loadAliases l; rflOpenMap nil 0 _checkpack _GETtext mapfile; _PAINTwindow viewwin; 0 ); 0 ;; fun rflSizeWin(wn, blurp, w, h)= let (if w < (wMap+370) then wMap+370 else w) -> w in let if h > 310 then if h < (hMap+310) then hMap+310 else h else 310 -> h in let _GETwindowSizePosition Win -> [_ _ x2 y2] in ( rflSizeMainWin Win blurp w h; /*Templateedit1 call back */ _SIZEwindow Win w h x2 y2; 0 );; fun IniEditor(s)= let [440 475] -> [w h] in let startEditor _channel nil nil nil w h WN_MENU EDITOR_NORMAL/*TOOLBAR|INFOWIN*/ s "dms/interf/map/map.dmc" nil nil @load @save nil -> ed in let _LDbitmap _channel _checkpack "dms/interf/map/open.bmp" -> openButtonIcone in ( set Win = ed.EditorMainWin; set editWin = getEditWin ed; _CBwinSize Win @rflSizeWin ed; _CBwinSize editWin @rflSizeEditWin 0; /* loc( _CRtext _channel editWin 5 0 50 20 ET_ALIGN_RIGHT "Map File :"; ) */ _CRtext _channel editWin 5 3 95 20 ET_ALIGN_LEFT (_locEditor "8530-MAPEDI-mapfile:" nil); set mapfile = _CReditLine _channel editWin 100 3 225 20 ET_DOWN|ET_AHSCROLL ""; _CBlineOk mapfile @rflOkMapfile 0; set openmapfile = _CBbutton _CRbuttonBitmap _channel editWin openButtonIcone 330 3 20 20 0 @rflBrowseMap 0; /* loc( _CRtext _channel editWin 5 25 50 20 ET_ALIGN_RIGHT "Alt. File :"; ) */ _CRtext _channel editWin 5 28 95 20 ET_ALIGN_LEFT (_locEditor "8580-MAPEDI-alt.file:" nil); set altmapFile = _CReditLine _channel editWin 100 28 225 20 ET_DOWN|ET_AHSCROLL ""; set openAltmapFile = _CBbutton _CRbuttonBitmap _channel editWin openButtonIcone 330 28 20 20 0 @rflBrowseFile [altmapFile nil]; /* loc( set banner = _CRtext _channel editWin wMap+10 50 w-wMap-15 20 ET_ALIGN_CENTER "Zones"; ) */ set banner = _CRtext _channel editWin wMap+10 50 w-wMap-15 20 ET_ALIGN_CENTER (_locEditor "8620-MAPEDI-zones" nil); set list = _CRlist _channel editWin wMap+10 70 w-wMap-165 h-280 LB_DOWN|LB_VSCROLL; _CBlistClick list @rflClickList 0; /* loc( set xstat= _CRtext _channel editWin w-150 75 20 20 ET_ALIGN_CENTER "x"; ) */ set xstat= _CRtext _channel editWin w-150 75 20 20 ET_ALIGN_CENTER (_locEditor "8660-MAPEDI-x" nil); set xedit= _CReditLine _channel editWin w-125 75 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL ""; _CBlineOk xedit @rflOkXedit 0; /* loc( set ystat= _CRtext _channel editWin w-75 75 25 20 ET_ALIGN_CENTER "y"; ) */ set ystat= _CRtext _channel editWin w-75 75 25 20 ET_ALIGN_CENTER (_locEditor "8690-MAPEDI-y" nil); set yedit= _CReditLine _channel editWin w-50 75 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL ""; _CBlineOk yedit @rflOkYedit 0; /* loc( set wstat= _CRtext _channel editWin w-150 100 25 20 ET_ALIGN_CENTER "w"; ) */ set wstat= _CRtext _channel editWin w-150 100 25 20 ET_ALIGN_CENTER (_locEditor "8720-MAPEDI-w" nil); set wedit= _CReditLine _channel editWin w-125 100 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL ""; _CBlineOk wedit @rflOkWedit 0; /* loc( set hstat= _CRtext _channel editWin w-75 100 25 20 ET_ALIGN_CENTER "h"; ) */ set hstat= _CRtext _channel editWin w-75 100 25 20 ET_ALIGN_CENTER (_locEditor "8750-MAPEDI-h" nil); set hedit= _CReditLine _channel editWin w-50 100 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL ""; _CBlineOk hedit @rflOkHedit 0; /* loc( set outlinecheck = _CRcheck _channel editWin w-150 125 90 20 0 "Outline zone"; ) */ set outlinecheck = _CRcheck _channel editWin w-150 125 120 20 0 (_locEditor "8780-MAPEDI-outlinezon" nil); _CBcheck outlinecheck @rflOutlineCheck 0; set outlinemap = _FILLbitmap _CRbitmap _channel 20 20 DEF_OUTLINECOLOR; set outlinebutton = _CRbuttonBitmap _channel editWin outlinemap w-25 125 20 20 0; /* loc( set del = _CBbutton _CRbutton _channel editWin w-150 150 70 20 0 "Del" @rflDel 0; ) */ set del = _CBbutton _CRbutton _channel editWin w-150 150 70 20 0 (_locEditor "8820-MAPEDI-del" nil) @rflDel 0; /* loc( set rename = _CBbutton _CRbutton _channel editWin w-75 150 70 20 0 "Rename" @rflRename 0; ) */ set rename = _CBbutton _CRbutton _channel editWin w-75 150 70 20 0 (_locEditor "8830-MAPEDI-rename" nil) @rflRename 0; /* loc( set avatarCheck = _CRcheck _channel editWin wMap+10 h-205 w-wMap-15 20 0 "show avatars"; ) */ set avatarCheck = _CRcheck _channel editWin wMap+10 h-205 w-wMap-15 20 0 (_locEditor "8850-MAPEDI-showavatar" nil); _SETcheck avatarCheck 1; _CBcheck avatarCheck @rflAvatarCheck 0; let (w-wMap-10)/2 -> wAvWin in { set meWin = _CRwindow _channel editWin wMap+10 h-185 wAvWin 135 WN_CHILD ""; set meBanner = _CRtext _channel meWin 0 0 wAvWin 15 ET_ALIGN_CENTER (_locEditor "9080-MAPEDI-'me'" nil); /* loc( set meDot = _CRcheck _channel meWin 5 15 wAvWin 20 CH_RADIO "as a dot"; ) */ set meDot = _CRcheck _channel meWin 5 15 wAvWin 20 CH_RADIO (_locEditor "8930-MAPEDI-asadot" nil); _SETcheck meDot 1; _CBcheck meDot @rflMeDot 0; /* loc( _CRtext _channel meWin 15 40 30 20 ET_ALIGN_LEFT "size"; ) */ _CRtext _channel meWin 15 40 30 20 ET_ALIGN_LEFT (_locEditor "8960-MAPEDI-size" nil); set meSize = _CReditLine _channel meWin 50 40 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL "2"; /* loc( _CRtext _channel meWin 15 65 30 20 ET_ALIGN_LEFT "color"; ) */ _CRtext _channel meWin 15 65 30 20 ET_ALIGN_LEFT (_locEditor "8980-MAPEDI-color" nil); set meDotMap = _FILLbitmap _CRbitmap _channel 45 20 DEF_USERCOLOR; set meDotColor = _CRbuttonBitmap _channel meWin meDotMap 50 65 45 20 0; /* loc( set meBitmap = _CRcheck _channel meWin 5 90 wAvWin 20 CH_RADIO "as a bitmap"; ) */ set meBitmap = _CBcheck _CRcheck _channel meWin 5 90 wAvWin 20 CH_RADIO (_locEditor "9010-MAPEDI-asabitmap" nil) @rflmeBitmap 0; set meFile = _CReditLine _channel meWin 15 115 wAvWin-45 20 ET_DOWN|ET_AHSCROLL ""; _CBtext meFile @rflMeFile 0; set meOpen = _CRbuttonBitmap _channel meWin openButtonIcone wAvWin-25 115 21 19 0; _CBbutton meOpen @rflBrowseFile [meFile @rflMeFile]; set otherWin = _CRwindow _channel editWin wMap+wAvWin+5 h-185 wAvWin 135 WN_CHILD ""; /* loc( set otherBanner = _CRtext _channel otherWin 0 0 wAvWin 15 ET_ALIGN_CENTER "'others'"; ) */ set otherBanner = _CRtext _channel otherWin 0 0 wAvWin 15 ET_ALIGN_CENTER (_locEditor "9080-MAPEDI-'others'" nil); /* loc( set otherDot = _CRcheck _channel otherWin 5 15 wAvWin 20 CH_RADIO "as dots"; ) */ set otherDot = _CRcheck _channel otherWin 5 15 wAvWin 20 CH_RADIO (_locEditor "9090-MAPEDI-asdots" nil); _SETcheck otherDot 1; _CBcheck otherDot @rflOtherDot 0; /* loc( _CRtext _channel otherWin 15 40 30 20 ET_ALIGN_LEFT "size"; ) */ _CRtext _channel otherWin 15 40 30 20 ET_ALIGN_LEFT (_locEditor "8960-MAPEDI-size" nil); set otherSize = _CReditLine _channel otherWin 50 40 45 20 ET_DOWN|ET_NUMBER|ET_AHSCROLL "2"; /* loc( _CRtext _channel otherWin 15 65 30 20 ET_ALIGN_LEFT "color"; ) */ _CRtext _channel otherWin 15 65 30 20 ET_ALIGN_LEFT (_locEditor "8980-MAPEDI-color" nil); set otherDotMap = _FILLbitmap _CRbitmap _channel 45 20 DEF_USERCOLOR; set otherDotColor = _CRbuttonBitmap _channel otherWin otherDotMap 50 65 45 20 0; /* loc( set otherBitmap = _CRcheck _channel otherWin 5 90 wAvWin 20 CH_RADIO "as bitmaps"; ) */ set otherBitmap = _CBcheck _CRcheck _channel otherWin 5 90 wAvWin 20 CH_RADIO (_locEditor "9170-MAPEDI-asbitmaps" nil) @rflotherBitmap 0; set otherFile = _CReditLine _channel otherWin 15 115 wAvWin-45 20 ET_DOWN|ET_AHSCROLL ""; _CBtext otherFile @rflOtherFile 0; set otherOpen = _CRbuttonBitmap _channel otherWin openButtonIcone wAvWin-25 115 21 19 0; _CBbutton otherOpen @rflBrowseFile [otherFile @rflOtherFile]; }; /* loc( set numberCheck = _CRcheck _channel editWin wMap+10 h-40 w-wMap-15 20 0 "show numbers"; ) */ set numberCheck = _CRcheck _channel editWin wMap+10 h-40 w-wMap-15 20 0 (_locEditor "9240-MAPEDI-shownumber" nil); _SETcheck numberCheck 1; _CBcheck numberCheck @rflNumberCheck 0; set viewwin = _CRwindow _channel editWin 5 55 140 190 WN_CHILD "lol"; _CBwinPaint viewwin @rflPaintViewwin 0; _CBwinClick viewwin @rflClickViewwin 0; _CBwinUnclick viewwin @rflUnclickViewwin 0; _CBcursorMove viewwin @rflCursorMoveViewwin 0; set helpstatus = _CRtext _channel editWin 0 h-20 w-65 20 ET_DOWN|ET_ALIGN_LEFT ""; set mousestatus = _CRtext _channel editWin w-65 h-20 65 20 ET_DOWN|ET_ALIGN_LEFT ""; set map = _FILLbitmap _CRbitmap _channel 140 190 0xffffff; set workmap = _FILLbitmap _CRbitmap _channel 140 190 0xffffff; setDisable; if s==nil then nil else openDMI ed; _PAINTwindow viewwin ); 0;;