fun LoadBitmap(Channel,file)= { let _checkpack file -> pack in if pack==nil then nil else { let _LDbitmap Channel pack -> bmp in if bmp==nil then { let _LDjpeg Channel pack -> jpeg in if jpeg==nil then nil else jpeg } else bmp; }; };; fun TransparentColor(Bmp,TransparencyXcoord,TransparencyYcoord)= { if (TransparencyXcoord==(-1)) || (TransparencyYcoord==(-1)) then nil else _GETpixel16 Bmp TransparencyXcoord TransparencyYcoord };; /****************************************************************************************/ /*--------------------------- Fatal error function -------------------------------------*/ /****************************************************************************************/ /* Unplugged channel to keep the error window opened */ typeof Unplugged=Chn;; /* Click event associated to fatal error message window */ fun FatalErrorClickEvent(MessBox,Param,Click)= _killchannel Unplugged; _closemachine ;; /* Fatal error function WinName : String to add the beginning of the window head message Message : String that represents the error message */ fun FatalError(WinName,Message)= set Unplugged=_openchannel nil "" _envchannel _channel; _chgchn _channel Unplugged; _killchannel _channel; let _DLGMessageBox Unplugged nil strcat WinName " Fatal Error" Message 0 -> MessBox in _DLGrflmessage MessBox @FatalErrorClickEvent 0 ;; fun AddTextOnButton(GlobalBmp,ListBmpCoordinates,IsThereAMask,Text,Font,TextMiddleCoordinates,TextColor,ShadowFlag,ShadowColor)= { if (ListBmpCoordinates==nil)||(IsThereAMask&&((tl ListBmpCoordinates)==nil)) then GlobalBmp else { let [ (_GETstringSize Font Text) TextMiddleCoordinates hd ListBmpCoordinates ] -> [ [MessageXSize MessageYSize] [PositionTextX PositionTextY] [GlobalX GlobalY] ] in { if ShadowFlag then { _DRAWtext GlobalBmp Font (GlobalX+PositionTextX+ShadowFlag) (GlobalY+PositionTextY+ShadowFlag) (TD_TOP+TD_CENTER) ShadowColor Text; } else nil; _DRAWtext GlobalBmp Font PositionTextX PositionTextY (TD_TOP+TD_CENTER) TextColor Text; }; AddTextOnButton GlobalBmp tl ListBmpCoordinates IsThereAMask Text Font TextMiddleCoordinates TextColor ShadowFlag ShadowColor; }; };;