/* TermColor - DMS - Aug 99 - by Sebastien DENEUX*/ /* add choice textColorEditLine - by iri - june 2003 - colorTerm 2.2 */ /* add choice otherColorText - by iri - september 2003 - colorTerm 2.3 */ /* add button "away" - by arkeon - october 2003 - colorTerm 2.3 */ var backColor = 0xffffff;; var loginNameColor=0;; /*black*/ var System1MsgTextColor=0xff;;/*red*/ var System2MsgTextColor=0xff0000;; /*blue*/ var ActionsMsgColor=0xff;;/*red*/ typeof usersMsgColors=[S r1];; /*colors used when default colors for other users is checked*/ var defOtherUser1MsgTextColor=0;;/*black*/ var defOtherUser2MsgTextColor=0x505050;;/*dark gray*/ /* begin iri */ var textColorEditLine=0;; /* black */ var otherColorText=0;; /* black */ /* end iri */ typeof awayCheck=ObjCheck;; /* Arkeon */ typeof defaultMacrosFile=ObjText;; typeof openMacrosFile=ObjButton;; typeof editWin=ObjWin;; /*-------------*/ fun save (filename, n)= ("registerF"::(_GETtext defaultMacrosFile)::nil):: ("action"::"start"::"start"::nil):: ("action"::"destroy"::"destroy"::nil):: ("action"::"broadMsg"::"broadMsg"::nil):: ("actionC"::"privateMsg"::"privateMsg"::nil):: ("action"::"broadInfo"::"broadInfo"::nil):: ("actionC"::"privateInfo"::"privateInfo"::nil):: ("actionC"::"!addCommand"::"!addCommand"::nil):: ("action"::"getDialogS"::nil):: ("actionC"::"getDialog"::nil):: ("event"::"entering"::"entering"::nil):: ("event"::"in"::"in"::nil):: ("event"::"destroyed"::"destroyed"::nil):: ("eventC"::"command"::nil):: ("eventC"::"Away"::nil):: /* Arkeon */ ("eventC"::"Back"::nil):: /* Arkeon */ ("actionC"::"registerExtMacro"::"registerExtMacro"::nil):: ("actionC"::"unregisterExtMacro"::"unregisterExtMacro"::nil):: ("eventC"::"extMacroCommand"::nil):: ("actionC"::"IgnoreFlag"::"IgnoreFlag"::nil):: ("actionC"::"IgnChgLogin"::"IgnChgLogin"::nil):: ("actionC"::"IgnLogout"::"IgnLogout"::nil):: ("action"::"!ChgLogin"::"!ChgLogin"::nil):: ("zoneC"::"Term"::nil):: ("backColor"::(itoa backColor)::nil):: ("System1MsgTextColor"::(itoa System1MsgTextColor)::nil):: ("System2MsgTextColor"::(itoa System2MsgTextColor)::nil):: ("loginNameColor"::(itoa loginNameColor)::nil):: ("ActionsMsgColor"::(itoa ActionsMsgColor)::nil):: ("defOtherUser1MsgTextColor"::(itoa defOtherUser1MsgTextColor)::nil):: ("defOtherUser2MsgTextColor"::(itoa defOtherUser2MsgTextColor)::nil):: /* begin iri */ ("textColorEditLine"::(itoa textColorEditLine)::nil):: ("otherColorText"::(itoa otherColorText)::nil):: /* end iri */ ("awayCheck"::(let _GETcheck awayCheck -> x in if x then "on" else "off")::nil):: /* Arkeon */ ("usersMsgColors"::(strbuild [usersMsgColors nil])::nil):: ("defaultMacrosFile"::(_GETtext defaultMacrosFile)::nil):: nil;; /*-------------*/ fun load (l)= _SETtext defaultMacrosFile getInfo l "defaultMacrosFile"; set backColor = atoi getInfo l "backColor"; set System1MsgTextColor = atoi getInfo l "System1MsgTextColor"; set System2MsgTextColor = atoi getInfo l "System2MsgTextColor"; set loginNameColor = atoi getInfo l "loginNameColor"; set ActionsMsgColor = atoi getInfo l "ActionsMsgColor"; set usersMsgColors = hd strextr getInfo l "usersMsgColors"; set defOtherUser1MsgTextColor = atoi getInfo l "defOtherUser1MsgTextColor"; set defOtherUser2MsgTextColor = atoi getInfo l "defOtherUser2MsgTextColor"; /* begin iri */ set textColorEditLine = atoi getInfo l "textColorEditLine"; set otherColorText = atoi getInfo l "otherColorText"; /* end iri */ _SETcheck awayCheck if !strcmpi getInfo l "awayCheck" "on" then 1 else 0; /* Arkeon */ 0;; /*-------------*/ fun _paintE(a,b)= _PAINTrectangle editWin 330 20 15 15 DRAW_SOLID 1 0 DRAW_SOLID backColor; _PAINTrectangle editWin 330 45 15 15 DRAW_SOLID 1 0 DRAW_SOLID System1MsgTextColor; _PAINTrectangle editWin 330 70 15 15 DRAW_SOLID 1 0 DRAW_SOLID System2MsgTextColor; _PAINTrectangle editWin 330 95 15 15 DRAW_SOLID 1 0 DRAW_SOLID loginNameColor; _PAINTrectangle editWin 330 120 15 15 DRAW_SOLID 1 0 DRAW_SOLID ActionsMsgColor; _PAINTrectangle editWin 190 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 0)); _PAINTrectangle editWin 210 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 1)); _PAINTrectangle editWin 230 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 2)); _PAINTrectangle editWin 250 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 3)); _PAINTrectangle editWin 270 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 4)); _PAINTrectangle editWin 290 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 5)); _PAINTrectangle editWin 310 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 6)); _PAINTrectangle editWin 330 145 15 15 DRAW_SOLID 1 0 DRAW_SOLID (atoi (nth_list usersMsgColors 7)); _PAINTrectangle editWin 330 185 15 15 DRAW_SOLID 1 0 DRAW_SOLID defOtherUser1MsgTextColor; _PAINTrectangle editWin 330 210 15 15 DRAW_SOLID 1 0 DRAW_SOLID defOtherUser2MsgTextColor; /* begin iri */ _PAINTrectangle editWin 330 235 15 15 DRAW_SOLID 1 0 DRAW_SOLID textColorEditLine; _PAINTrectangle editWin 330 260 15 15 DRAW_SOLID 1 0 DRAW_SOLID otherColorText;; /* end iri */ /*-------------*/ fun is_in_box(x,y,bx,by,bw,bh)= (x>=bx) && (x<=(bx+bw)) && (y>=by) && (y<=(by+bh));; /*-------------*/ fun _endColor1(a)=if a!=nil then set backColor=a else nil;; fun _endColor2(a)=if a!=nil then set System1MsgTextColor=a else nil;; fun _endColor3(a)=if a!=nil then set System2MsgTextColor=a else nil;; fun _endColor4(a)=if a!=nil then set loginNameColor=a else nil;; fun _endColor5(a)=if a!=nil then set ActionsMsgColor=a else nil;; fun _endColor6(a,b)=if a!=nil then (set usersMsgColors = (replace_nth_in_list usersMsgColors b (itoa a));0) else nil;; fun _endColor7(a)=if a!=nil then set defOtherUser1MsgTextColor=a else nil;; fun _endColor8(a)=if a!=nil then set defOtherUser2MsgTextColor=a else nil;; /* begin iri */ fun _endColor9(a)=if a!=nil then set textColorEditLine=a else nil;; fun _endColor10(a) = if a!=nil then set otherColorText=a else nil;; /* end iri */ /*-------------*/ fun _clickE(a,b,x,y,button)= if button==1 then ( /* loc( if is_in_box x y 330 20 15 15 then _CRcolorMap _channel editWin 100 100 "Choose background color" @_endColor1 backColor else nil; ) */ if is_in_box x y 330 20 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1110-TERMED-chooseback" nil) @_endColor1 backColor else nil; /* loc( if is_in_box x y 330 45 15 15 then _CRcolorMap _channel editWin 100 100 "Choose system messages > color" @_endColor2 System1MsgTextColor else nil; ) */ if is_in_box x y 330 45 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1120-TERMED-choosesyst" nil) @_endColor2 System1MsgTextColor else nil; /* loc( if is_in_box x y 330 70 15 15 then _CRcolorMap _channel editWin 100 100 "Choose system messages >> color" @_endColor3 System2MsgTextColor else nil; ) */ if is_in_box x y 330 70 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1130-TERMED-choosesyst" nil) @_endColor3 System2MsgTextColor else nil; /* loc( if is_in_box x y 330 95 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages login names color" @_endColor4 loginNameColor else nil; ) */ if is_in_box x y 330 95 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1140-TERMED-chooseuser" nil) @_endColor4 loginNameColor else nil; /*we test if the currnet color is nil for compatibility with version 1.0*/ /* loc( if is_in_box x y 330 120 15 15 then _CRcolorMap _channel editWin 100 100 "Choose actions messages color" @_endColor5 (if ActionsMsgColor==nil then 0 else ActionsMsgColor) else nil; ) */ if is_in_box x y 330 120 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1170-TERMED-chooseacti" nil) @_endColor5 (if ActionsMsgColor==nil then 0 else ActionsMsgColor) else nil; let (atoi (nth_list usersMsgColors 0)) -> currentCol in /* loc( if is_in_box x y 190 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 1" mkfun2 @_endColor6 0 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 190 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1200-TERMED-chooseuser" nil) mkfun2 @_endColor6 0 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 1)) -> currentCol in /* loc( if is_in_box x y 210 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 2" mkfun2 @_endColor6 1 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 210 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1230-TERMED-chooseuser" nil) mkfun2 @_endColor6 1 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 2)) -> currentCol in /* loc( if is_in_box x y 230 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 3" mkfun2 @_endColor6 2 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 230 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1260-TERMED-chooseuser" nil) mkfun2 @_endColor6 2 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 3)) -> currentCol in /* loc( if is_in_box x y 250 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 4" mkfun2 @_endColor6 3 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 250 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1290-TERMED-chooseuser" nil) mkfun2 @_endColor6 3 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 4)) -> currentCol in /* loc( if is_in_box x y 270 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 5" mkfun2 @_endColor6 4 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 270 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1320-TERMED-chooseuser" nil) mkfun2 @_endColor6 4 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 5)) -> currentCol in /* loc( if is_in_box x y 290 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 6" mkfun2 @_endColor6 5 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 290 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1350-TERMED-chooseuser" nil) mkfun2 @_endColor6 5 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 6)) -> currentCol in /* loc( if is_in_box x y 310 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 7" mkfun2 @_endColor6 6 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 310 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1380-TERMED-chooseuser" nil) mkfun2 @_endColor6 6 (if currentCol==nil then 0 else currentCol) else nil; let (atoi (nth_list usersMsgColors 7)) -> currentCol in /* loc( if is_in_box x y 330 145 15 15 then _CRcolorMap _channel editWin 100 100 "Choose user messages random color 8" mkfun2 @_endColor6 7 (if currentCol==nil then 0 else currentCol) else nil; ) */ if is_in_box x y 330 145 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1410-TERMED-chooseuser" nil) mkfun2 @_endColor6 7 (if currentCol==nil then 0 else currentCol) else nil; /* loc( if is_in_box x y 330 185 15 15 then _CRcolorMap _channel editWin 100 100 "Choose other users default color" @_endColor7 defOtherUser1MsgTextColor else nil; ) */ if is_in_box x y 330 185 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1430-TERMED-chooseothe" nil) @_endColor7 defOtherUser1MsgTextColor else nil; /* loc( if is_in_box x y 330 210 15 15 then _CRcolorMap _channel editWin 100 100 "Choose other users alternate default color" @_endColor8 defOtherUser2MsgTextColor else nil; ) */ if is_in_box x y 330 210 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1440-TERMED-chooseothe" nil) @_endColor8 defOtherUser2MsgTextColor else nil; /* begin iri */ if is_in_box x y 330 235 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1860-TERMED-background" nil) @_endColor9 textColorEditLine else nil; if is_in_box x y 330 260 15 15 then _CRcolorMap _channel editWin 100 100 (_locEditor "1865-TERMED-otherColor" nil) @_endColor10 otherColorText else nil; /* end iri */ 0; ) else 0;; /*----------------*/ fun rflOpenFile (dlg, objtxt_f, pack)= if pack==nil then nil else let objtxt_f -> [txt f] in (_SETtext txt _PtoScol pack; exec f with [nil _PtoScol pack]);; /*----------------*/ /*open a dialog box to choose the defautl macros file*/ fun rflBrowseFile (blurp, objtxt_f)= let objtxt_f -> [objtxt _] in let getPathFile _GETtext objtxt "" -> [dir _] in _DLGrflopen _DLGOpenFile _channel editWin dir "" "text file (*.txt)\0*.txt\0all (*.*)\0*.*\0\0" @rflOpenFile objtxt_f;; /*-------------*/ fun IniEditor (s)= /*init users default colors*/ set usersMsgColors="2012718"::"606062"::"11493968"::"2924667"::"5909956"::"5606399"::"12825357"::"16739674"::nil; let startEditor /* begin iri */ _channel nil nil nil 355 350 WN_NORMAL EDITOR_NORMAL /* end iri */ s "dms/interf/colorterm/term.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; /* loc( _CRtext _channel editWin 5 20 180 20 ET_ALIGN_LEFT "BackGround color"; ) */ _CRtext _channel editWin 5 20 180 20 ET_ALIGN_LEFT (_locEditor "1870-TERMED-background" nil); /* loc( _CRtext _channel editWin 5 45 180 20 ET_ALIGN_LEFT "System messages > color"; ) */ _CRtext _channel editWin 5 45 180 20 ET_ALIGN_LEFT (_locEditor "1880-TERMED-systemmess" nil); /* loc( _CRtext _channel editWin 5 70 180 20 ET_ALIGN_LEFT "System messages >> color"; ) */ _CRtext _channel editWin 5 70 180 20 ET_ALIGN_LEFT (_locEditor "1890-TERMED-systemmess" nil); /* loc( _CRtext _channel editWin 5 95 180 20 ET_ALIGN_LEFT "Users messages login names color"; ) */ _CRtext _channel editWin 5 95 180 20 ET_ALIGN_LEFT (_locEditor "1900-TERMED-usersmessa" nil); /* loc( _CRtext _channel editWin 5 120 180 20 ET_ALIGN_LEFT "Actions messages color"; ) */ _CRtext _channel editWin 5 120 180 20 ET_ALIGN_LEFT (_locEditor "1910-TERMED-actionsmes" nil); /* loc( _CRtext _channel editWin 5 145 180 20 ET_ALIGN_LEFT "Users messages random colors"; ) */ _CRtext _channel editWin 5 145 180 20 ET_ALIGN_LEFT (_locEditor "1920-TERMED-usersmessa" nil); /* loc( _CRtext _channel editWin 5 185 180 20 ET_ALIGN_LEFT "Other Users default color"; ) */ _CRtext _channel editWin 5 185 180 20 ET_ALIGN_LEFT (_locEditor "1930-TERMED-otherusers" nil); /* loc( _CRtext _channel editWin 5 210 180 20 ET_ALIGN_LEFT "Other Users alternate default color"; ) */ _CRtext _channel editWin 5 210 180 20 ET_ALIGN_LEFT (_locEditor "1940-TERMED-otherusers" nil); /* begin iri */ _CRtext _channel editWin 5 235 180 20 ET_ALIGN_LEFT (_locEditor "1860-TERMED-background" nil); _CRtext _channel editWin 5 260 180 20 ET_ALIGN_LEFT (_locEditor "1865-TERMED-otherColor" nil); _CRtext _channel editWin 5 285 180 20 0 (_locEditor "1865-TERMED-awaybutton" nil); set awayCheck = _CRcheck _channel editWin 330 285 20 20 0 ""; /* Arkeon */ _CRtext _channel editWin 5 315 100 20 ET_ALIGN_LEFT (_locEditor "1960-TERMED-defaultmac" nil); set defaultMacrosFile= _CReditLine _channel editWin 120 315 200 20 ET_DOWN|ET_AHSCROLL "Dms/Interf/ColorTerm/defaultMacros.txt"; set openMacrosFile = _CBbutton _CRbuttonBitmap _channel editWin _LDbitmap _channel _checkpack "dms/interf/colorterm/open.bmp" 325 315 20 20 0 @rflBrowseFile [defaultMacrosFile nil]; /* end iri */ _CBwinPaint editWin @_paintE nil; _CBwinClick editWin @_clickE nil; if s==nil then nil else openDMI ed ); 0;;