/* ADS - DMS - aout 00 - by Ariane Bitoun */ /* Modified - Juin 2001 - by Emmanuel Tollé */ /* Lecture - Juillet 2001 - by Julien ZORKO */ /* correction - Juillet 2001 - by Emmanuel Tollé */ typeof font = ObjFont;; typeof contads = ObjWin;; typeof conted = ObjWin;; typeof complistSeq = CompList;; typeof complistMed = CompList;; typeof indexCurSeq = I;; typeof indexCurMed = I;; typeof indexCurLink = I;; typeof windowFlag = I;; typeof ButtonBmp = ObjBitmap;; typeof ButtonBmp8 = ObjBitmap8;; typeof SlideBmp = ObjBitmap;; typeof SlideBmp8 = ObjBitmap8;; typeof ComboBmp = ObjBitmap;; typeof ComboBmp8 = ObjBitmap8;; typeof ContToolTip = ObjContainer;; typeof TextToolTip = CompText;; typeof Path = S;; typeof PathPic = S;; typeof ListSeq = ObjListTab;; typeof ListLink = ObjListTab;; typeof ListLinkTemp = ObjListTab;; typeof ListMed = ObjListTab;; typeof ListSeq2 = [S r1];; typeof ListLink2 = [[S S] r1];; typeof ListMed2 = [S r1];; typeof LabelListLink = ObjText;; var TYP_IMAGE = 0;; var TYP_VIDEO = 1;; var ORIG_IN = 0;; var ORIG_OUT_REAL = 1 ;; var listSource = ["Insourcing" 0]::["Outsourcing-Realmedia" 1]::nil;; /*A modifier le jour ou on desire rajouter une nouvelle source*/ struct MyMedia = [IDMed:I, nameMed:S, pathMed:S, urlMed:S, typeMed:I, srvtypeMed:I, urltypeMed:I, origMed:I ]mkMyMedia;; struct Link = [ IDLink:I, IDseqLink:I, IDmedLink :I, periodLink:I ]mkLink;; struct Sequence = [IDSeq:I, nameSeq:S, descrSeq:S, linkIdSeq:I, /* TODO ne sert a rien!!! :-)*/ typeSeq:I ] mkSeq;; typeof sequenceList = [Sequence r1];; typeof mediaList = [MyMedia r1];; typeof mediaListTemp = [MyMedia r1];; typeof linkList = [Link r1];; /**************************************************/ defcom CSave = Save I I S;; defcom streamedservercom = getstreamedmessage S S;; var MessageMaxSize = 8192;; var FKW_INULL = -1;; var mot_clef_int_nul = "-1";; var FKW_SNULL = "arianenil";; var mot_clef_Name = "BddName";; var mot_clef_Descr = "BddDescr";; var mot_clef_ID = "BddID";; var mot_clef_ID1 = "BddID1";; var mot_clef_ID2 = "BddID2";; var mot_clef_period = "BddPeriod";; var mot_clef_seq_fake = "fake";; var mot_clef_url = "BddUrl";; var mot_clef_path = "BddPath";; var mot_clef_type = "BddType";; var mot_clef_type1 = "BddType1";; var mot_clef_type2 = "BddType2";; var mot_clef_file = "Bddfile";; var SELECT_SEQ = 1;; var SELECT_MED = 2;; var SELECT_LINK = 3;; var INSERT_SEQ = 4;; var DELETE_SEQ = 5;; var UPDATE_SEQ = 6;; var DELETE_LINK = 7;; var UPDATE_LINK = 8;; var ADD_LINK = 9;; var DELETE_MED = 10;; var UPDATE_MED = 11;; var ADD_MED = 12;; var TYPE_IMG = 0;; var TYPE_SRV_LOC = 0;; var TYPE_SRV_DIST = 1;; var URL_DIRECT = 0;; var URL_INDIRECT = 1;; var NAME_SAME = 1;; var NAME_NOTSAME = 0;; proto Extract_list_of_link = fun [I [Link r1] ] [Link r1];; /*********************************************************************************************************************************************/ /***************************************** UTILITAIRES ***************************************************************************************/ /*********************************************************************************************************************************************/ /******************************************************************************* Function that add a state to the final bitmap of the button tmpBmp -> ObjBitmap : a temporary bitmap used for create the final alphabitmap hTmp -> I : the height of start for the _SCPbitmap function wBmp -> I : the width of start of the state in the source bitmap hBmp -> I : the height of start of the state in the source bitmap w -> I : the width of the final alphabitmap h -> I : the height of a state in the final alphabitmap (one fifth of the final alphabitmap for a 3 state button plus disable state and a mask <- nothing : *******************************************************************************/ fun AddBmp (tmpBmp, hTmp, wBmp, hBmp, w, h) = /* construction of a final bitmap with the elements of the file */ _SCPbitmap tmpBmp 0 hTmp 9 hTmp+9 ButtonBmp wBmp hBmp wBmp+9 hBmp+9 nil; _SCPbitmap tmpBmp 10 hTmp w-11 hTmp+9 ButtonBmp wBmp+10 hBmp wBmp+11 hBmp+9 nil; _SCPbitmap tmpBmp w-10 hTmp w-1 hTmp+9 ButtonBmp wBmp+12 hBmp wBmp+22 hBmp+9 nil; _SCPbitmap tmpBmp 0 hTmp+10 9 hTmp+h-11 ButtonBmp wBmp hBmp+10 wBmp+9 hBmp+11 nil; _SCPbitmap tmpBmp 10 hTmp+10 w-11 hTmp+h-11 ButtonBmp wBmp+10 hBmp+10 wBmp+11 hBmp+11 nil; _SCPbitmap tmpBmp w-10 hTmp+10 w-1 hTmp+h-11 ButtonBmp wBmp+12 hBmp+10 wBmp+22 hBmp+11 nil; _SCPbitmap tmpBmp 0 hTmp+h-10 9 hTmp+h-1 ButtonBmp wBmp hBmp+12 wBmp+9 hBmp+22 nil; _SCPbitmap tmpBmp 10 hTmp+h-10 w-11 hTmp+h-1 ButtonBmp wBmp+10 hBmp+12 wBmp+11 hBmp+22 nil; _SCPbitmap tmpBmp w-10 hTmp+h-10 w-1 hTmp+h-1 ButtonBmp wBmp+12 hBmp+12 wBmp+22 hBmp+22 nil ;; /******************************************************************************* Function that add a state to the final bitmap of the button tmpBmp8 -> ObjBitmap8 : a temporary bitmap8 used for create the final alphabitmap hTmp -> I : the height of start for the _SCPbitmap8 function wBmp -> I : the width of start of the state in the source bitmap8 hBmp -> I : the height of start of the state in the source bitmap8 w -> I : the width of the final alphabitmap h -> I : the height of a state in the final alphabitmap (one fifth of the final alphabitmap for a 3 state button plus disable state and a mask <- nothing : *******************************************************************************/ fun AddBmp8 (tmpBmp8, hTmp, wBmp, hBmp, w, h) = /* construction of a final bitmap with the elements of the file */ _SCPbitmap8 tmpBmp8 0 hTmp 9 hTmp+9 ButtonBmp8 wBmp hBmp wBmp+9 hBmp+9 nil; _SCPbitmap8 tmpBmp8 10 hTmp w-11 hTmp+9 ButtonBmp8 wBmp+10 hBmp wBmp+11 hBmp+9 nil; _SCPbitmap8 tmpBmp8 w-10 hTmp w-1 hTmp+9 ButtonBmp8 wBmp+12 hBmp wBmp+21 hBmp+9 nil; _SCPbitmap8 tmpBmp8 0 hTmp+10 9 hTmp+h-11 ButtonBmp8 wBmp hBmp+10 wBmp+9 hBmp+11 nil; _SCPbitmap8 tmpBmp8 10 hTmp+10 w-11 hTmp+h-11 ButtonBmp8 wBmp+10 hBmp+10 wBmp+11 hBmp+11 nil; _SCPbitmap8 tmpBmp8 w-10 hTmp+10 w-1 hTmp+h-11 ButtonBmp8 wBmp+12 hBmp+10 wBmp+21 hBmp+11 nil; _SCPbitmap8 tmpBmp8 0 hTmp+h-10 9 hTmp+h-1 ButtonBmp8 wBmp hBmp+12 wBmp+9 hBmp+21 nil; _SCPbitmap8 tmpBmp8 10 hTmp+h-10 w-11 hTmp+h-1 ButtonBmp8 wBmp+10 hBmp+12 wBmp+11 hBmp+21 nil; _SCPbitmap8 tmpBmp8 w-10 hTmp+h-10 w-1 hTmp+h-1 ButtonBmp8 wBmp+12 hBmp+12 wBmp+21 hBmp+21 nil ;; /******************************************************************************* Draw a vertical slide bar w -> I : width of the slide bar h -> I : height of the slide bar <- AlphaBitmap : the alphabitmap containing the slide bar *******************************************************************************/ fun DessineSlideV (w, h) = /* set the transparency color of the source file */ let make_rgb 0 0 255 -> trans in /* creation of the two destination bitmap */ let _CRbitmap _channel w*3 h+18 -> tempBmp in let _CRbitmap8 _channel w*3 h+18 -> tempBmp8 in ( /* construction of the two final bitmap with the elements of the file */ _SCPbitmap tempBmp 0 0 15 12 SlideBmp 34 16 49 28 nil; _SCPbitmap tempBmp 16 0 31 12 SlideBmp 34 16 49 28 nil; _SCPbitmap tempBmp 32 0 47 12 SlideBmp 51 16 66 28 nil; _SCPbitmap tempBmp 0 13 15 15 SlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 16 13 31 15 SlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 32 13 47 15 SlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 0 16 15 h-18 SlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 16 16 31 h-18 SlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 32 16 47 h-18 SlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 0 h-17 15 h-14 SlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 16 h-17 31 h-14 SlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 32 h-17 47 h-14 SlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 0 h-13 15 h-1 SlideBmp 34 30 49 42 nil; _SCPbitmap tempBmp 16 h-13 31 h-1 SlideBmp 34 30 49 42 nil; _SCPbitmap tempBmp 32 h-13 47 h-1 SlideBmp 51 30 66 42 nil; _SCPbitmap tempBmp 0 h 15 h+17 SlideBmp 18 16 33 33 nil; _SCPbitmap tempBmp 16 h 31 h+17 SlideBmp 18 16 33 33 nil; _SCPbitmap tempBmp 32 h 47 h+17 SlideBmp 18 16 33 33 nil; _SCPbitmap8 tempBmp8 0 0 15 12 SlideBmp8 34 16 49 28 nil; _SCPbitmap8 tempBmp8 16 0 31 12 SlideBmp8 34 16 49 28 nil; _SCPbitmap8 tempBmp8 32 0 47 12 SlideBmp8 51 16 66 28 nil; _SCPbitmap8 tempBmp8 0 13 15 15 SlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 16 13 31 15 SlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 32 13 47 15 SlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 0 16 15 h-18 SlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 16 16 31 h-18 SlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 32 16 47 h-18 SlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 0 h-17 15 h-14 SlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 16 h-17 31 h-14 SlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 32 h-17 47 h-14 SlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 0 h-13 15 h-1 SlideBmp8 34 30 49 42 nil; _SCPbitmap8 tempBmp8 16 h-13 31 h-1 SlideBmp8 34 30 49 42 nil; _SCPbitmap8 tempBmp8 32 h-13 47 h-1 SlideBmp8 51 30 66 42 nil; _SCPbitmap8 tempBmp8 0 h 15 h+17 SlideBmp8 18 16 33 33 nil; _SCPbitmap8 tempBmp8 16 h 31 h+17 SlideBmp8 18 16 33 33 nil; _SCPbitmap8 tempBmp8 32 h 47 h+17 SlideBmp8 18 16 33 33 nil; /* creation of the new alphabitmap */ let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 trans -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create the button alphabitmap text -> S : the text written on the button w -> I : the width of the button and the alphabitmap hght -> I : the height of the alphabitmap, 5 time the height of the button for a 3 states button plus disable state and a mask <- AlphaBitmap : the final AlphaBitmap of the button *******************************************************************************/ fun DrawRollOver (text, w, hght) = let hght/5 -> h in /* creation of the two destination bitmap */ let _CRbitmap _channel w 5*h -> tempBmp in let _CRbitmap8 _channel w 5*h -> tempBmp8 in ( AddBmp tempBmp 0 2 40 w h; AddBmp tempBmp h 25 40 w h; AddBmp tempBmp 2*h 48 40 w h; AddBmp tempBmp 3*h 2 88 w h; AddBmp tempBmp 4*h 25 88 w h; AddBmp8 tempBmp8 0 2 40 w h; AddBmp8 tempBmp8 h 25 40 w h; AddBmp8 tempBmp8 2*h 48 40 w h; AddBmp8 tempBmp8 3*h 2 88 w h; AddBmp8 tempBmp8 4*h 25 88 w h; let _GETstringSize font text -> [wtxt htxt] in /* calculation of the position of the text */ let if w>wtxt then (w-wtxt)/2 else 0 -> xpos in let if h>htxt then (h-htxt)/2 else 0 -> ypos in ( /* draw of the text in the different state of the bitmap */ _DRAWtext tempBmp font xpos ypos make_rgb 0 255 255 TD_TOP|TD_LEFT text; _DRAWtext tempBmp font xpos ypos+h 0 TD_TOP|TD_LEFT text; _DRAWtext tempBmp font xpos ypos+2*h 0 TD_TOP|TD_LEFT text; _DRAWtext tempBmp font xpos ypos+3*h 0 TD_TOP|TD_LEFT text ); /* creation of the final alphabitmap */ let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 make_rgb 0 0 255 -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create the compcheck alphabitmap w -> I : the width of the compcheck and the alphabitmap hght -> I : the height of the alphabitmap, 5 time the height of the compcheck for a 3 states check plus disable state and a mask <- AlphaBitmap : the final AlphaBitmap of the compcheck *******************************************************************************/ fun DrawCheck (w, hght) = let hght/5 -> h in let _CRbitmap _channel w hght -> tempBmp in let _CRbitmap8 _channel w hght -> tempBmp8 in ( _SCPbitmap tempBmp 0 0 21 21 ButtonBmp 2 40 23 61 nil; _SCPbitmap tempBmp 0 22 21 43 ButtonBmp 25 40 46 61 nil; _SCPbitmap tempBmp 0 44 21 65 ButtonBmp 48 40 69 61 nil; _SCPbitmap tempBmp 0 66 21 87 ButtonBmp 2 88 23 109 nil; _SCPbitmap tempBmp 0 88 21 109 ButtonBmp 25 88 46 109 nil; _SCPbitmap tempBmp 22 0 43 21 ButtonBmp 2 64 23 85 nil; _SCPbitmap tempBmp 22 22 43 43 ButtonBmp 25 64 46 85 nil; _SCPbitmap tempBmp 22 44 43 65 ButtonBmp 48 64 69 85 nil; _SCPbitmap tempBmp 22 66 43 87 ButtonBmp 48 88 69 109 nil; _SCPbitmap tempBmp 22 88 43 109 ButtonBmp 25 88 46 109 nil; _SCPbitmap8 tempBmp8 0 0 21 21 ButtonBmp8 2 40 23 61 nil; _SCPbitmap8 tempBmp8 0 22 21 43 ButtonBmp8 25 40 46 61 nil; _SCPbitmap8 tempBmp8 0 44 21 65 ButtonBmp8 48 40 69 61 nil; _SCPbitmap8 tempBmp8 0 66 21 87 ButtonBmp8 2 88 23 109 nil; _SCPbitmap8 tempBmp8 0 88 21 109 ButtonBmp8 25 88 46 109 nil; _SCPbitmap8 tempBmp8 22 0 43 21 ButtonBmp8 2 64 23 85 nil; _SCPbitmap8 tempBmp8 22 22 43 43 ButtonBmp8 25 64 46 85 nil; _SCPbitmap8 tempBmp8 22 44 43 65 ButtonBmp8 48 64 69 85 nil; _SCPbitmap8 tempBmp8 22 66 43 87 ButtonBmp8 48 88 69 109 nil; _SCPbitmap8 tempBmp8 22 88 43 109 ButtonBmp8 25 88 46 109 nil; let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 make_rgb 0 0 255 -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create the combo alphabitmap w -> I : the width of the combo and the alphabitmap hght -> I : the height of the alphabitmap, 3 time the height of the combo <- AlphaBitmap : the final AlphaBitmap of the combo *******************************************************************************/ fun DrawCombo (w, hght) = let hght/3 -> h in let _CRbitmap _channel w hght -> tempBmp in let _CRbitmap8 _channel w hght -> tempBmp8 in ( _SCPbitmap tempBmp 0 0 14 21 ComboBmp 33 15 47 36 nil; _SCPbitmap tempBmp 0 22 14 43 ComboBmp 33 15 47 36 nil; _SCPbitmap tempBmp 0 44 14 65 ComboBmp 33 15 47 36 nil; _SCPbitmap tempBmp 15 0 29 21 ComboBmp 33 15 47 36 nil; _SCPbitmap tempBmp 15 22 29 43 ComboBmp 33 15 47 36 nil; _SCPbitmap tempBmp 15 44 29 65 ComboBmp 33 15 47 36 nil; _SCPbitmap8 tempBmp8 0 0 14 21 ComboBmp8 33 15 47 36 nil; _SCPbitmap8 tempBmp8 0 22 14 43 ComboBmp8 33 15 47 36 nil; _SCPbitmap8 tempBmp8 0 44 14 65 ComboBmp8 33 15 47 36 nil; _SCPbitmap8 tempBmp8 15 0 29 21 ComboBmp8 33 15 47 36 nil; _SCPbitmap8 tempBmp8 15 22 29 43 ComboBmp8 33 15 47 36 nil; _SCPbitmap8 tempBmp8 15 44 29 65 ComboBmp8 33 15 47 36 nil; let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 make_rgb 0 0 255 -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create a background alphabitmap w -> I : the width of the alphabitmap h -> I : the height of the alphabitmap <- AlphaBitmap : the final AlphaBitmap of the background *******************************************************************************/ fun DessineFond2 (w, h) = let _CRbitmap _channel w h -> tempBmp in let _CRbitmap8 _channel w h -> tempBmp8 in ( _SCPbitmap tempBmp 0 0 13 21 ComboBmp 3 15 16 36 nil; _SCPbitmap tempBmp 14 0 w-7 21 ComboBmp 17 15 22 36 nil; _SCPbitmap tempBmp w-6 0 w-1 21 ComboBmp 23 15 28 36 nil; _SCPbitmap tempBmp 0 22 13 43 ComboBmp 3 15 16 36 nil; _SCPbitmap tempBmp 14 22 w-7 43 ComboBmp 17 15 22 36 nil; _SCPbitmap tempBmp w-6 22 w-1 43 ComboBmp 23 15 28 36 nil; _SCPbitmap tempBmp 0 44 13 65 ComboBmp 3 15 16 36 nil; _SCPbitmap tempBmp 14 44 w-7 65 ComboBmp 17 15 22 36 nil; _SCPbitmap tempBmp w-6 44 w-1 65 ComboBmp 23 15 28 36 nil; _SCPbitmap8 tempBmp8 0 0 13 21 ComboBmp8 3 15 16 36 nil; _SCPbitmap8 tempBmp8 14 0 w-7 21 ComboBmp8 17 15 22 36 nil; _SCPbitmap8 tempBmp8 w-6 0 w-1 21 ComboBmp8 23 15 28 36 nil; _SCPbitmap8 tempBmp8 0 22 13 43 ComboBmp8 3 15 16 36 nil; _SCPbitmap8 tempBmp8 14 22 w-7 43 ComboBmp8 17 15 22 36 nil; _SCPbitmap8 tempBmp8 w-6 22 w-1 43 ComboBmp8 23 15 28 36 nil; _SCPbitmap8 tempBmp8 0 44 13 65 ComboBmp8 3 15 16 36 nil; _SCPbitmap8 tempBmp8 14 44 w-7 65 ComboBmp8 17 15 22 36 nil; _SCPbitmap8 tempBmp8 w-6 44 w-1 65 ComboBmp8 23 15 28 36 nil; let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 make_rgb 0 0 255 -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create the combo bitmap x -> I : x position of the combo y -> I : y position of the combo w -> I : the width of the combo h -> I : the height of the combo cont -> ObjContainer : container of the combo <- CompBitmap : the final CompBitmap of the combo *******************************************************************************/ fun CreateBitmapCombo (x, y, w, h, cont) = _CRcompBitmap _channel cont nil [x y] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LW_FLEX|OBJ_MW_FLEX|OBJ_RW_FLEX|OBJ_LH_FLEX|OBJ_MH_FLEX|OBJ_RH_FLEX OBJ_CONTAINER_CLICK|OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_DBLCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_MOVE DessineFond2 w h 0 0 w h ;; /******************************************************************************* Function that create a background alphabitmap w -> I : the width of the alphabitmap h -> I : the height of the alphabitmap <- AlphaBitmap : the final AlphaBitmap of the background *******************************************************************************/ fun DessineFond (w, h) = let _CRbitmap _channel w h -> tempBmp in let _CRbitmap8 _channel w h -> tempBmp8 in ( _SCPbitmap tempBmp 0 0 13 9 ButtonBmp 2 15 15 24 nil; _SCPbitmap tempBmp 14 0 w-15 9 ButtonBmp 16 15 21 24 nil; _SCPbitmap tempBmp w-14 0 w-1 9 ButtonBmp 22 15 35 24 nil; _SCPbitmap tempBmp 0 10 13 h-11 ButtonBmp 2 25 15 26 nil; _SCPbitmap tempBmp 14 10 w-15 h-11 ButtonBmp 16 25 21 26 nil; _SCPbitmap tempBmp w-14 10 w-1 h-11 ButtonBmp 22 25 35 26 nil; _SCPbitmap tempBmp 0 h-10 13 h-1 ButtonBmp 2 27 15 36 nil; _SCPbitmap tempBmp 14 h-10 w-15 h-1 ButtonBmp 16 27 21 36 nil; _SCPbitmap tempBmp w-14 h-10 w-1 h-1 ButtonBmp 22 27 35 36 nil; _SCPbitmap8 tempBmp8 0 0 13 9 ButtonBmp8 2 15 15 24 nil; _SCPbitmap8 tempBmp8 14 0 w-15 9 ButtonBmp8 16 15 21 24 nil; _SCPbitmap8 tempBmp8 w-14 0 w-1 9 ButtonBmp8 22 15 35 24 nil; _SCPbitmap8 tempBmp8 0 10 13 h-11 ButtonBmp8 2 25 15 26 nil; _SCPbitmap8 tempBmp8 14 10 w-15 h-11 ButtonBmp8 16 25 21 26 nil; _SCPbitmap8 tempBmp8 w-14 10 w-1 h-11 ButtonBmp8 22 25 35 26 nil; _SCPbitmap8 tempBmp8 0 h-10 13 h-1 ButtonBmp8 2 27 15 36 nil; _SCPbitmap8 tempBmp8 14 h-10 w-15 h-1 ButtonBmp8 16 27 21 36 nil; _SCPbitmap8 tempBmp8 w-14 h-10 w-1 h-1 ButtonBmp8 22 27 35 36 nil; let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 make_rgb 0 0 255 -> alphaBmp in ( _DSbitmap tempBmp; _DSbitmap8 tempBmp8; alphaBmp ) ) ;; /******************************************************************************* Function that create a text bitmap x -> I : x position of the text y -> I : y position of the text w -> I : the width of the text h -> I : the height of the text cont -> ObjContainer : container of the texte <- AlphaBitmap : the final CompBitmap of the text *******************************************************************************/ fun CreateBitmapTexte (x, y, w, h, cont) = _CRcompBitmap _channel cont nil [x y] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LW_FLEX|OBJ_MW_FLEX|OBJ_RW_FLEX|OBJ_LH_FLEX|OBJ_MH_FLEX|OBJ_RH_FLEX OBJ_CONTAINER_CLICK|OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_DBLCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_MOVE DessineFond w h 0 0 w h ;; /*----------------------------------------------------*/ fun My_Remove_Indexlist (list, indexlist) = if indexlist == nil then list else let hd indexlist -> curindex in ( set list = remove_nth_from_list list curindex; My_Remove_Indexlist list tl indexlist ) ;; /*----------------------------------------------------*/ /*Find the index of a sequence in a list by id*/ fun My_find_index_sequence (id, lst, n) = if lst == nil then nil else let hd lst -> firstsequence in if firstsequence.IDSeq == id then n else My_find_index_sequence id (tl lst) (n+1) ;; /*----------------------------------------------------*/ /*Find the index of a media in a list by id*/ fun My_find_index_seqlink (id, lst, n) = if lst == nil then nil else let hd lst -> firstlink in if firstlink.IDseqLink == id then n::(My_find_index_seqlink id (tl lst) (n+1)) else My_find_index_seqlink id (tl lst) (n+1) ;; /*----------------------------------------------------*/ /*Find the index of a media in a list by id*/ fun My_find_index_media (id, lst, n) = if lst == nil then nil else let hd lst -> firstmedia in if firstmedia.IDMed == id then n else My_find_index_media id (tl lst) (n+1) ;; /*----------------------------------------------------*/ /*Find the index of a media in a list by id*/ fun My_find_index_medlink (id, lst, n) = if lst == nil then nil else let hd lst -> firstlink in if firstlink.IDmedLink == id then n::(My_find_index_medlink id (tl lst) (n+1)) else My_find_index_medlink id (tl lst) (n+1) ;; /*----------------------------------------------------*/ /*Find the index of a media in a list by id*/ fun My_find_index_link (id,lst,n)= if lst==nil then (nil) else let hd lst -> firstlink in if firstlink.IDLink==id then (n) else (My_find_index_link id (tl lst) (n+1)) ;; /*----------------------------------------------------*/ /*Looks for the last occurence of a character in a string, and send back this occurence index */ fun Find_last_char (string, char, index) = let strfind char string index ->n in if n == nil then index -1 else Find_last_char string char n+1 ;; /*----------------------------------------------------*/ /*count the number of links on an image*/ fun Count_number_of_link (idmedia, listlink, n) = if listlink == nil then n else ( let hd listlink -> cur_link in if cur_link.IDmedLink == idmedia then set n = n+1 else nil; Count_number_of_link idmedia tl listlink n ) ;; /*----------------------------------------------------*/ /*finds the id of the "fake sequence"*/ fun Find_ID_fake_seq (listseq) = if listseq == nil then nil else let hd listseq -> cur_seq in if !strcmp mot_clef_seq_fake cur_seq.nameSeq then cur_seq.IDSeq else Find_ID_fake_seq tl listseq ;; /*----------------------------------------------------*/ /*extracts a list of all the links attached to a sequence*/ fun Extract_list_of_link (idseq, listlink) = if listlink == nil then nil else let hd listlink -> cur_link in if cur_link.IDseqLink == idseq then cur_link::(Extract_list_of_link idseq tl listlink) else Extract_list_of_link idseq tl listlink ;; /*----------------------------------------------------*/ /*finds the index of the "fake sequence"*/ fun Find_Index_fake_seq (listseq, n) = if listseq == nil then nil else let hd listseq -> cur_seq in if !strcmp mot_clef_seq_fake cur_seq.nameSeq then n else Find_Index_fake_seq (tl listseq) (n+1) ;; /*-----------------------------------------------------------------------------*/ fun _cbcheckclick (objCheck, param, posx, posy, btn, mask) = let param -> [cont objcheckV objcheckI] in let ( if objCheck == objcheckV then objcheckI else objcheckV ) -> objCheck in let ( if (_GETcompCheckState objCheck) == CHK_CHECKED then CHK_UNCHECKED else CHK_CHECKED ) -> newvalue in ( _SETcompCheckState objCheck newvalue; _PAINTcontainer cont ) ;; /*********************************************************************************************************************************************/ /***************************************** FONCTIONS GENERALES *******************************************************************************/ /*********************************************************************************************************************************************/ /*-----------------------------------------------------------------------------*/ /* Extrait l'origine d'une sequence a partir d'un combo*/ fun GetOrig (objCombo) = let _GETcompComboClicked objCombo -> [_[label _ ]] in switch listSource label ;; /*----------------------------------------------------*/ fun GetTypesSrvUrl (typemed, orig) = if typemed == TYPE_IMG then if orig == ORIG_IN then [TYPE_SRV_LOC URL_DIRECT] else [TYPE_SRV_DIST URL_DIRECT] else if typemed == TYP_VIDEO then if orig == ORIG_IN then [TYPE_SRV_LOC URL_DIRECT] else [TYPE_SRV_DIST URL_INDIRECT] else nil ;; /*-----------------------------------------------------------------------------*/ /*A partir du path total, recupere sous forme de tuple le chemin et le nom du fichier*/ fun GetFilePath (path) = let Find_last_char path "/" 0 ->n in if n == 0 then [FKW_SNULL FKW_SNULL] else let substr path 0 n+1 -> filepath in let substr path n+1 (strlen path)-n -> filename in let ( if (filepath == nil) || (!strcmp filepath "") then FKW_SNULL else filepath ) -> filepath in let ( if (filename == nil) || (!strcmp filename "") then FKW_SNULL else filename ) -> filename in [filepath filename] ;; /*----------------------------------------------------*/ /*Fait le somme des flags afin de determiner la hauteur de la fenetre a afficher*/ fun Sum_list_flag (list) = if list == nil then 0 else (hd list)+(Sum_list_flag tl list) ;; /*-----------------------------------------------------------------------------*/ /*Remplace l'entier nul par ""*/ fun DisplayInteger (intt) = if intt == FKW_INULL then "" else itoa intt ;; /*-----------------------------------------------------------------------------*/ /*Remplace un texte vide par le motclef nul*/ fun ReplaceNullS (txt) = if (txt == nil)||(!strcmp txt "") then FKW_SNULL else txt ;; /*-----------------------------------------------------------------------------*/ /*Permet la lecture dans un objet texte et remplace le vide par le nul*/ fun FillString (objtxt) = let _GETcompText objtxt -> txt in ReplaceNullS txt ;; /*-----------------------------------------------------------------------------*/ /*Permet la lecture dans un objet texte et remplace le vide par le nul*/ fun FillInteger (objtxt) = let _GETcompText objtxt -> txt in if (txt == nil) || (!strcmp txt "") || (!strcmp txt "0") then FKW_INULL else atoi txt ;; /*Find a media's position in the media's list*/ fun FindPosMed (listmedia, nom, compteur) = let nth_list listmedia compteur -> med in if listmedia == nil then nil else if med.nameMed == nom then compteur else FindPosMed listmedia nom compteur+1 ;; /*Add an item to a list*/ fun AddListTab (listtab, liste, compteur) = let hd liste -> [nom image] in if liste == nil then nil else ( AddListTab listtab tl liste compteur+1; _ADDlistTabItem listtab 0 0 nom; if listtab == ListSeq then ( set ListSeq2 = listcat nom::nil ListSeq2; 0 ) else if listtab == ListMed then ( set ListMed2 = listcat nom::nil ListMed2; let FindPosMed mediaList nom 0 -> pos in let nth_list mediaList pos -> med in set mediaListTemp = listcat med::nil mediaListTemp; 0 ) else nil ) ;; /*Add a link to the link's list*/ fun AddListLink (listlink, liste, compteur) = let hd liste -> tete in let hd tete -> [nom image] in let hd tl tete -> [temps _] in if liste == nil then nil else ( AddListLink listlink tl liste compteur+1; _ADDlistTabItem listlink 0 0 nom; set ListLink2 = listcat [nom temps]::nil ListLink2; _SETlistTabItem listlink 0 1 temps; 0 ) ;; /*----------------------------------------------------*/ /*Passage d'une liste de séquences a une liste de chaines de caractere (pour l'affichage)*/ fun ListSeqToTuple (listSeq) = if listSeq==nil then nil else let hd listSeq -> instseq in if !strcmp instseq.nameSeq mot_clef_seq_fake then (ListSeqToTuple tl listSeq) else let 0 -> pic in [instseq.nameSeq pic]::(ListSeqToTuple tl listSeq) ;; /*----------------------------------------------------*/ /*Passage d'une liste de media a une liste de tuple [intitulé image] (pour l'affichage)*/ fun ListMedToTuple (listMed) = if listMed == nil then nil else let hd listMed -> instmed in let nth_list sequenceList indexCurSeq -> instseq in let instseq.typeSeq -> type in if instmed.typeMed == type then let 0 -> pic in [instmed.nameMed pic]::(ListMedToTuple tl listMed) else ListMedToTuple tl listMed ;; /*----------------------------------------------------*/ /*Passage d'une liste de media a une liste de tuple (pour l'affichage)*/ proto ListLinkToSr1r1=fun [ Sequence [Link r1] ] [[[S /*BitmapIndex*/ I] r1]r1];; fun ListLinkToSr1r1 (seq, listlink) = if listlink == nil then nil else ( let hd listlink -> cur_link in if cur_link.IDseqLink == seq.IDSeq then let nth_list mediaList (My_find_index_media cur_link.IDmedLink mediaList 0) -> curmedia in let 0 -> pic in ( if seq.typeSeq == nil then set seq.typeSeq = curmedia.typeMed else nil; ([curmedia.nameMed pic]::[itoa (cur_link.periodLink) nil]::nil)::ListLinkToSr1r1 seq (tl listlink) ) else ListLinkToSr1r1 seq (tl listlink); ) ;; /*----------------------------------------------------*/ /*Affihe la liste des media contenu dans la sequence positionée a l'index indexSeq dans la liste de sequences*/ fun DisplayDataLink(seq)= _RSTlistTab ListLink; AddListLink ListLink (ListLinkToSr1r1 seq linkList) 0; let nth_list sequenceList indexCurSeq -> curseq in let ( if curseq.typeSeq == TYP_IMAGE then _loc this "KW_TYPE_IMG2" nil else if curseq.typeSeq == TYP_VIDEO then _loc this "KW_TYPE_VID2" nil else "" ) -> type in if curseq.nameSeq == nil then _SETtext LabelListLink "" else if type == nil then _SETtext LabelListLink (_loc this "KW_SEQ" curseq.nameSeq::nil) else _SETtext LabelListLink (_loc this "KW_LIST_SEQ" type::curseq.nameSeq::nil); _PAINTwindow contads ;; fun DisplayDataLinkTemp (seq) = _RSTlistTab ListLinkTemp; set ListLink2 = nil; AddListLink ListLinkTemp (ListLinkToSr1r1 seq linkList) 0; set indexCurLink = if (_GETlistTabCount ListLink)>0 then 0 else nil; _PAINTwindow conted ;; /*----------------------------------------------------*/ /*Affihe la liste des media contenu dans la sequence positionée a l'index indexSeq dans la liste de sequences*/ fun DisplayDataMed () = _RSTlistTab ListMed; set mediaListTemp = nil; AddListTab ListMed ListMedToTuple mediaList 0; set indexCurMed = if (_GETlistTabCount ListMed)>0 then 0 else nil; _SELlistTabItem ListMed indexCurMed; _PAINTwindow conted ;; /*----------------------------------------------------*/ /*Affiche la liste des séquence*/ fun DisplayDataSeq () = _RSTlistTab ListSeq; set ListSeq2 = nil; let Find_Index_fake_seq sequenceList 0 -> index_fake_seq in let nth_list sequenceList index_fake_seq ->fake_seq in set sequenceList = listcat (remove_nth_from_list sequenceList index_fake_seq) fake_seq::nil; AddListTab ListSeq (ListSeqToTuple sequenceList) 0; if indexCurSeq != nil then nil else set indexCurSeq = if (_GETlistTabCount ListSeq)>0 then 0 else nil; _SELlistTabItem ListSeq indexCurSeq; _PAINTwindow contads ;; /*----------------------------------------------------*/ /*Callback of popup's cancel button*/ fun _cancelCB (object, cont, posx, posy, btn, mask) = _DScontainer cont; /*TODO : appeller _destroyPopupSeq*/ set windowFlag = 0 ;; /*----------------------------------------------------*/ /*Remove a link of the list*/ fun RemoveLink (indexlink, indexseq) = let nth_list sequenceList indexseq -> curseq in let nth_list (Extract_list_of_link curseq.IDSeq linkList) indexCurLink -> curlink in let Count_number_of_link curlink.IDmedLink linkList 0 -> nbmed in ( _DMSsend this CSave [1 DELETE_LINK (strbuild (mot_clef_ID::(itoa curlink.IDLink)::nil)::nil)];/*suppression du lien*/ if nbmed>1 then _DMSsend this CSave [1 DELETE_LINK (strbuild (mot_clef_ID::(itoa curlink.IDLink)::nil)::nil)]/*suppression du lien*/ else _DMSsend this CSave [1 UPDATE_LINK (strbuild (mot_clef_ID::(itoa curlink.IDLink) ::nil)::(mot_clef_ID1::(itoa Find_ID_fake_seq sequenceList)::nil)::(mot_clef_period::"-1"::nil)::nil)]; ); 0 ;; /*********************************************************************************************************************************************/ /***************************************** SEQUENCE POPUP ************************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ /*destruction "propre" de certains objets du container TODO utile ???*/ fun _destroyPopupSeq (cont, Listobj) = _DScontainer cont; set windowFlag = 0 ;; /*Callback of the Ok button of the Conflict popup*/ fun _OkPopupConflict (object, cont, posx, posy, btn, mask) = _DScontainer cont; set windowFlag=0 ;; /*Callback of key up event for the conflict popup*/ fun cbKeyUp_Conflict (cont, param, key) = if key == 28 || key == 284 then _OkPopupConflict nil cont nil nil nil nil else nil ;; /*Creation of a conflict popup*/ fun PopupConflict (cont, listobj) = let listobj -> [txtName txtDescr objCheckImage objCheckVideo] in ( _DScompText txtName; _DScompText txtDescr; _DScompCheck objCheckImage; _DScompCheck objCheckVideo ); _DScontainer cont; let _CRcontainerFromObjWin _channel contads 100 100 300 150 CO_MENU make_rgb 190 197 197 (_loc this "KW_CONFLICT" nil) -> cont in ( _CRcompText _channel cont nil [10 10] OBJ_ENABLE|OBJ_DISABLE|CT_LABEL|CT_CENTER OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 280 20 (_loc this "KW_MESS" nil) font [0 nil nil nil] [nil nil] nil nil; _CRcompText _channel cont nil [10 40] OBJ_ENABLE|OBJ_DISABLE|CT_LABEL|CT_CENTER OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 280 20 (_loc this "KW_MESS2" nil) font [0 nil nil nil] [nil nil] nil nil; _CRcompText _channel cont nil [10 70] OBJ_ENABLE|OBJ_DISABLE|CT_LABEL|CT_CENTER OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 280 20 (_loc this "KW_MESS3" nil) font [0 nil nil nil] [nil nil] nil nil; let _CRcompRollOver _channel cont nil [125 125] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) 50 5*20 -> button in _CBcompRollOverClick button @_OkPopupConflict cont; _CBcontainerPreDestroy cont @_destroyPopupSeq nil; _CBcontainerKeyUp cont @cbKeyUp_Conflict nil; _PAINTcontainer cont ); 0 ;; /*----------------------------------------------------*/ /*Envoie l'ordre de création d'une séquence a partir d'une liste de parametres*/ fun CreateSeq (infolist) = _DMSsend this CSave [1 INSERT_SEQ strbuild infolist]; 0 ;; /*----------------------------------------------------*/ /*Envoie l'ordre de modification d'une séquence a partir d'une liste de parametres*/ fun UpdateSeq (infolist) = _DMSsend this CSave [1 UPDATE_SEQ strbuild infolist]; 0 ;; /*Compare a single name and a list of name*/ fun CompareNom (nom, liste, nomseq) = if liste == nil then NAME_NOTSAME else let hd liste -> seq in if !strcmp nom seq.nameSeq then if !strcmp nom nomseq then NAME_NOTSAME else NAME_SAME else CompareNom nom tl liste nomseq ;; /*-----------------------------------------------------------------------------*/ /*Callback of Ok button of the sequence popup*/ fun _okPopupSeq (object, parameter, posx, posy, btn, mask) = let parameter -> [Listobj cont seq] in let Listobj -> [txtName txtDescr objCheckImage objCheckVideo] in let _GETcompText txtName -> seq_name in let _GETcompText txtDescr -> seq_descr in let _GETcompCheckState objCheckImage -> checkim in let _GETcompCheckState objCheckVideo -> checkvi in let ( if checkim == CHK_CHECKED then 0 else if checkvi == CHK_CHECKED then 1 else nil ) -> seq_type_tmp in let itoa seq_type_tmp -> seq_type in let CompareNom seq_name sequenceList seq.nameSeq -> valid in if valid == NAME_SAME then PopupConflict cont Listobj else if (!strcmp seq_name "" )||(!strcmp seq_name mot_clef_seq_fake) then nil else ( if !strcmp seq_descr "" then set seq_descr = FKW_SNULL else nil; if seq != nil /*update of the sequence*/ then let (mot_clef_ID::(itoa seq.IDSeq)::nil)::(mot_clef_Name::seq_name::nil) ::(mot_clef_Descr::seq_descr::nil)::(mot_clef_type::seq_type::nil)::nil -> lstparam in UpdateSeq lstparam else /*Ajout*/ CreateSeq ((mot_clef_Name::seq_name::nil)::(mot_clef_Descr::seq_descr::nil) ::(mot_clef_type::seq_type::nil)::nil); _destroyPopupSeq cont Listobj; ); 0 ;; /*-----------------------------------------------------------------------------*/ /*Initialise le combo permettant le choix de l'origine de la séquence*/ fun InitCombo (objcomb, position, lstlabel) = if lstlabel == nil then 0 else ( let hd lstlabel ->[label _]in _ADDcompCombo objcomb position [label nil]; InitCombo objcomb (position +1) tl lstlabel ) ;; /*Callback of key up event in the sequence popup*/ fun cbKeyUp_PopupSeq (cont, param, key) = if key == 28 || key == 284 then _okPopupSeq nil param nil nil nil nil else if key == 1 then _cancelCB nil cont nil nil nil nil else nil ;; /*-----------------------------------------------------------------------------*/ /*Creation of the sequence popup*/ fun CreationPopupSeq (titre, contpere, seq) = set windowFlag = 1; let ( if seq.typeSeq == nil then OBJ_VISIBLE|OBJ_ENABLE else OBJ_VISIBLE|OBJ_DISABLE ) -> flagtype in let 25 -> step in let 20 -> h_button in let 50 -> w_button in let 400 -> contLargeur in let 9*step -> hauteur in let hauteur + 20 + h_button-> contHauteur in let _CRcontainerFromObjCont _channel nil 100 100 400 265 CO_MENU make_rgb 190 197 197 titre -> cont in let 2*step-> coordy in let _CRcompText _channel cont nil [10 10] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 145 25 (strcat (_loc this "KW_NAME" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [10 45] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 145 25 (strcat (_loc this "KW_DESCRIPTION" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [10 175] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 145 25 (strcat (_loc this "KW_TYPE" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [175 175] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 65 25 (strcat (_loc this "KW_TYPE_IMG" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [175 205] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 65 25 (strcat (_loc this "KW_TYPE_VID" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let CreateBitmapTexte 155 10 235 25 cont-> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 225 15 seq.nameSeq font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> txtName in let _CRcompCheck _channel cont nil [280 175] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawCheck 44 5*22 -> objCheckImage in let _CRcompCheck _channel cont nil [280 205] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawCheck 44 5*22 -> objCheckVideo in let [215 120] -> [w h] in let CreateBitmapTexte 155 45 w h cont -> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [10 10] OBJ_VISIBLE|OBJ_ENABLE|CT_MULTIEDITLINE|CT_WORDWRAP OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN w-20 h-20 /*seq.nameSeq*/ seq.descrSeq font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] [[w 0-10] OBJ_MH_FLEX|OBJ_LW_FLEX|SLB_ROLLOVER DessineSlideV 16 h [15 h-15 h]] nil -> txtDescr in let _CRcompRollOver _channel cont nil [110 240] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) 80 5*20 -> okCompRollOver in let _CRcompRollOver _channel cont nil [210 240] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_CANCEL" nil) 80 5*20 -> cancelCompRollOver in ( if seq == nil then _SETcompCheckState objCheckImage CHK_CHECKED else if seq.typeSeq == TYP_IMAGE then _SETcompCheckState objCheckImage CHK_CHECKED else _SETcompCheckState objCheckVideo CHK_CHECKED; _CBcontainerPreDestroy cont @_destroyPopupSeq nil /*[txtName txtDescr objCheckImage objCheckVideo]*/; _CBcompCheckClick objCheckVideo @_cbcheckclick [cont objCheckVideo objCheckImage]; _CBcompCheckClick objCheckImage @_cbcheckclick [cont objCheckVideo objCheckImage]; _CBcompRollOverClick okCompRollOver @_okPopupSeq [[txtName txtDescr objCheckImage objCheckVideo] cont seq]; _CBcompRollOverClick cancelCompRollOver @_cancelCB cont; _CBcontainerKeyUp cont @cbKeyUp_PopupSeq [[txtName txtDescr objCheckImage objCheckVideo] cont seq]; _PAINTcontainer _SHOWcontainer cont CONTAINER_UNHIDDEN ) ;; /*********************************************************************************************************************************************/ /***************************************** LINK POPUP ****************************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ /*Callback of destruction of the link popup*/ fun _destroyPopupLink (cont, Listobj) = let Listobj -> [txttimer] in _DScompText txttimer; _DScontainer cont; set windowFlag = 1 ;; /*----------------------------------------------------*/ /*Creation of a link to a sequence*/ fun CreateLink (infolist) = _DMSsend this CSave [1 ADD_LINK (strbuild infolist)]; 0 ;; /*----------------------------------------------------*/ /*Update of a link to a sequence (timer)*/ fun UpdateLink (infolist) = _DMSsend this CSave [1 UPDATE_LINK (strbuild infolist)]; 0 ;; /*-----------------------------------------------------------------------------*/ /*Callback of Ok button of the link popup*/ fun _okPopupLink (object, parameter, posx, posy, btn, mask) = let parameter -> [Listobj cont link seq med] in let Listobj -> [txttimer] in let itoa (FillInteger txttimer) -> linktimer in ( if link != nil then let ((mot_clef_ID::(itoa link.IDLink)::nil)::(mot_clef_ID1::(itoa link.IDseqLink)::nil) ::(mot_clef_period::linktimer::nil)::nil) -> lstinfo in UpdateLink lstinfo else let ((mot_clef_ID::(itoa med.IDMed)::nil)::(mot_clef_ID1::(itoa seq.IDSeq)::nil) ::(mot_clef_period::linktimer::nil)::nil) -> lstinfo in CreateLink lstinfo; _destroyPopupLink cont Listobj ); 0 ;; /*Callback of key up event of the link popup*/ fun cbKeyUp_PopupLink (cont, param, key) = if key == 28 || key == 284 then _okPopupLink nil param nil nil nil nil else if key == 1 then _cancelCB nil cont nil nil nil nil else nil ;; /*----------------------------------------------------*/ /*Create the link popup*/ fun CreationPopupLink (titre, contpere, link, seq, med) = set windowFlag = 2; let 25 -> step in let 20 -> h_button in let 50 -> w_button in let 400 -> contLargeur in let 3*step -> hauteur in let hauteur + 20 + h_button-> contHauteur in let 2*step-> coordy in let _CRcontainerFromObjWin _channel contpere 100 100 contLargeur contHauteur CO_MENU make_rgb 190 197 197 titre -> cont in let _CRcompText _channel cont nil [10 coordy] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN (contLargeur/3-20) 25 (strcat (_loc this "KW_TIMER" nil) " :") font [0 nil nil nil] [nil nil] nil nil-> label in let CreateBitmapTexte (contLargeur/3-10) coordy-5 (2*contLargeur/3) 25 cont -> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN (2*contLargeur/3)-10 15 (DisplayInteger link.periodLink) font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil-> txtTimer in let _CRcompRollOver _channel cont nil [(contLargeur/2-w_button-10) hauteur+10] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) w_button 5*h_button -> okCompRollOver in let _CRcompRollOver _channel cont nil [(contLargeur/2+10) hauteur+10] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_CANCEL" nil) w_button 5*h_button -> cancelCompRollOver in ( _CBcompRollOverClick okCompRollOver @_okPopupLink [[txtTimer] cont link seq med]; _CBcompRollOverClick cancelCompRollOver @_cancelCB cont; _CBcontainerKeyUp cont @cbKeyUp_PopupLink [[txtTimer] cont link seq med]; _SETcompTextAuthorizedChar txtTimer "0123456789"; _CBcontainerPreDestroy cont @_destroyPopupLink [txtTimer]; _PAINTcontainer _SHOWcontainer cont CONTAINER_UNHIDDEN ) ;; /*********************************************************************************************************************************************/ /***************************************** MEDIA POPUP ***************************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ /*Callback of destruction of the media popup*/ fun _destroyPopupMed (cont, Listobj) = let Listobj -> [txtName type objcombo txtPath txtURL] in _DScontainer cont; set windowFlag = 1 ;; /*----------------------------------------------------*/ /*Create a new media*/ fun CreateMed (infolist) = _DMSsend this CSave [1 ADD_MED strbuild infolist]; 0 ;; /*----------------------------------------------------*/ /*Update a media*/ fun UpdateMed (infolist) = _DMSsend this CSave [1 UPDATE_MED strbuild infolist]; 0 ;; /*-----------------------------------------------------------------------------*/ /*Callback of Ok button of the media popup*/ fun _okPopupMed (object, parameter, posx, posy, btn, mask) = let parameter -> [Listobj modlst cont med] in let Listobj -> [txtName medtype objcombo txtPath txtURL] in let _GETcompText txtName -> medname in let GetFilePath FillString txtPath -> [medpath medfile] in let FillString txtURL -> medurl in let GetOrig objcombo -> medorig in let GetTypesSrvUrl medtype (GetOrig objcombo) -> [medtypesrv medtypeurl] in if (!strcmp medname "" ) || ((GetOrig objcombo) == nil) || (medtype == nil) then nil else ( if med != nil then let (mot_clef_ID::(itoa med.IDMed)::nil):: (mot_clef_Name::medname::nil):: (mot_clef_file::medfile::nil):: (mot_clef_path::medpath::nil):: (mot_clef_url::medurl::nil):: (mot_clef_type::(itoa medtype)::nil):: (mot_clef_type1::(itoa medorig)::nil):: /*(mot_clef_type2::(itoa medtypeurl)::nil)::*/nil -> lstinfo in UpdateMed lstinfo else let (mot_clef_ID::(itoa (Find_ID_fake_seq sequenceList))::nil):: (mot_clef_Name::medname::nil):: (mot_clef_file::medfile::nil):: (mot_clef_path::medpath::nil):: (mot_clef_url::medurl::nil):: (mot_clef_type::(itoa medtype)::nil):: (mot_clef_type1::(itoa medorig)::nil):: nil -> lstinfo in CreateMed lstinfo; _destroyPopupMed cont Listobj ); 0 ;; /*Callback of key up event of the media popup*/ fun cbKeyUp_PopupMed (cont, param, key) = if key == 28 || key == 284 then _okPopupMed nil param nil nil nil nil else if key == 1 then _cancelCB nil cont nil nil nil nil else nil ;; /*-----------------------------------------------------------------------------*/ /*Create the media popup*/ fun CreationPopupMed (titre, modlst, contpere, med) = set windowFlag = 2; let modlst -> [fname[ftype[forig[fpath[furl _]]]]] in let OBJ_VISIBLE|OBJ_ENABLE -> curflag in let OBJ_VISIBLE|OBJ_DISABLE -> curdisflag in let 0 -> coordy in let nil -> txtName in let nil -> txtPath in let nil -> txtURL in let nil -> objCheckImage in let nil -> objCheckVideo in let nil -> objcombo in let 25 -> step in let 20 -> h_button in let 50 -> w_button in let 400 -> contLargeur in let ((Sum_list_flag modlst)+5)*step -> hauteur in let hauteur + 20 + h_button-> contHauteur in let _CRcontainerFromObjCont _channel nil 100 100 300 265 CO_MENU make_rgb 190 197 197 titre -> cont in let _CRcompText _channel cont nil [10 10] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 80 25 (strcat (_loc this "KW_NAME" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [10 40] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 80 25 (strcat (_loc this "KW_ORIGINE" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [10 160] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 80 25 (strcat (_loc this "KW_PATH" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompText _channel cont nil [10 200] OBJ_VISIBLE|OBJ_ENABLE|CT_LABEL OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 80 25 (strcat (_loc this "KW_URLCLICK" nil) " :") font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> label in let _CRcompRollOver _channel cont nil [60 240] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) 80 5*20 -> okCompRollOver in let _CRcompRollOver _channel cont nil [160 240] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_CANCEL" nil) 80 5*20 -> cancelCompRollOver in let 80 -> h in let CreateBitmapCombo 100 40 175 22 cont -> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompCombo _channel cont node [0 0] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 190 h font [0 0 0 0] [0 0] [0 DrawCombo 2*15 3*22] [LST_LEFT 5 10 DessineFond 175 h] [SLB_ROLLOVER DessineSlideV 16 h [15 h-15 h]] -> Combo in let CreateBitmapTexte 100 10 190 25 cont-> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 180 15 med.nameMed font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> txtName in let CreateBitmapTexte 100 160 190 25 cont-> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 180 15 med.pathMed font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> txtPath in let CreateBitmapTexte 100 200 190 25 cont-> cpbitmap in let _CONVERTcompBitmapToObjNode cpbitmap -> node in let _CRcompText _channel cont node [5 5] OBJ_VISIBLE|OBJ_ENABLE|CT_EDITLINE OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 180 15 med.urlMed font [(make_rgb 0 0 0) nil nil nil] [(make_rgb 198 123 44) nil] nil nil -> txtURL in let nth_list sequenceList indexCurSeq -> curseq in ( InitCombo Combo 0 listSource; if med == nil then _SETcompComboClicked Combo 0 else if med.typeMed == TYP_IMAGE then nil else _SETcompComboClicked Combo med.origMed; _CBcontainerPreDestroy cont @_destroyPopupMed nil /*[txtName objCheckImage objCheckVideo objcombo txtPath txtURL]*/; _CBcompRollOverClick okCompRollOver @_okPopupMed [[txtName curseq.typeSeq Combo txtPath txtURL] modlst cont med]; _CBcompRollOverClick cancelCompRollOver @_cancelCB cont; _CBcontainerKeyUp cont @cbKeyUp_PopupMed [[txtName curseq.typeSeq Combo txtPath txtURL] modlst cont med]; _PAINTcontainer cont; 0 ) ;; /*********************************************************************************************************************************************/ /***************************************** MAIN WINDOW ***************************************************************************************/ /*********************************************************************************************************************************************/ /*Callback of cancel button of remove popup*/ fun cbClick_Cancel (object, param, posx, posy, btn, mask) = _DScontainer param ;; /*Predestruction callback of container (remove popup)*/ fun cbPreDestroy_container (object, param) = _DScontainer object ;; /*Callback of Ok button of remove media popup*/ fun cbClick_OkMed (object, param, posx, posy, btn, mask) = let param -> [indexmed cont] in let nth_list mediaListTemp indexmed -> curmed in ( _DMSsend this CSave [1 DELETE_MED (strbuild (mot_clef_ID::(itoa curmed.IDMed)::nil)::nil)]; cbPreDestroy_container cont nil ); 0 ;; /*Callback of key up of remove media popup*/ fun cbKeyUp_RemMed (cont, param, key) = if key == 28 || key == 284 then cbClick_OkMed nil param nil nil nil nil else if key == 1 then cbClick_Cancel nil cont nil nil nil nil else nil ;; /*----------------------------------------------------*/ /* Create the remove media popup*/ fun RemoveMed (indexmed) = let _CRcontainerFromObjCont _channel nil 200 200 150 100 CO_MENU make_rgb 190 197 197 (_loc this "KW_SUPP_MED" nil) -> container in ( _CRcompText _channel container nil [10 10] OBJ_ENABLE|OBJ_VISIBLE|CT_LABEL|CT_CENTER|CT_WORDWRAP OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 130 60 (_loc this "KW_SUPP_MED2" nil) font [0 0 0 0] nil nil nil; let _CRcompRollOver _channel container nil [15 75] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) 50 5*20 -> OkButton in let [indexmed container] -> param in ( _CBcompRollOverClick OkButton @cbClick_OkMed param; _CBcontainerKeyUp container @cbKeyUp_RemMed param ); let _CRcompRollOver _channel container nil [85 75] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_CANCEL" nil) 50 5*20 -> CancelButton in _CBcompRollOverClick CancelButton @cbClick_Cancel container; _CBcontainerPreDestroy container @cbPreDestroy_container nil; _PAINTcontainer container ) ;; /*-----------------------------------------------------------------------------*/ /*Supprime une sequence de la liste des sequence et l'ajoute dans celle des sequences supprimeés*/ fun RemoveSeq (indexseq) = let nth_list sequenceList indexseq -> seq in ( _DMSsend this CSave [1 DELETE_SEQ (strbuild (mot_clef_ID::(itoa seq.IDSeq)::nil)::nil)] ); 0 ;; /*----------------------------------------------------*/ fun _quitter (win, param) =/*TODO finirt de detruire proprement chaque elt */ _DSlistTab ListSeq; set ListSeq2 = nil; _DSlistTab ListMed; _DSfont font; _DSbitmap ButtonBmp; _DSbitmap8 ButtonBmp8; _DSbitmap SlideBmp; _DSbitmap8 SlideBmp8; _DSbitmap ComboBmp; _DSbitmap8 ComboBmp8; _DSwindow win ;; /*show tool tip callback*/ fun showtip (node, cont, texte, x, y) = let _GETwindowPositionSize cont -> [xw yw ww hw] in let _GETstringSize font texte -> [w h] in let ( if x+w+5 > xw+ww then ww-(w+5) else x-xw ) -> xtab in let ( if y+h+5 > yw+hw then hw-(h+5) else y-yw-18 ) -> ytab in ( set ContToolTip = _CRcontainerFromObjWin _channel cont xtab ytab w h CO_CHILDINSIDE make_rgb 37 131 185 "tooltip"; set TextToolTip = _CRcompText _channel ContToolTip nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|CT_CENTER|CT_LABEL nil w h texte font [make_rgb 255 255 255 0 0 0] [0 0] nil nil ); _PAINTcontainer _SHOWcontainer ContToolTip CONTAINER_UNHIDDEN ;; /*hide tool tip callback*/ fun hidetip (node, param, texte) = _DScompText TextToolTip; _DScontainer ContToolTip ;; /*----------------------------------------------------*/ /*Callback of click event in the link list of the sequence editor*/ fun _clickListLink (object, node, index) = set indexCurLink = index; let nth_list ListLink2 indexCurLink -> [nom _] in let nth_list sequenceList indexCurSeq -> curseq in let ( if curseq.typeSeq == TYP_IMAGE then "KW_TYPE_IMG3" else "KW_TYPE_VID3" ) -> type in ( _DStoolTip node; _CRtoolTip node 1000 (_loc this "KW_REMOVE2" type::nom::curseq.nameSeq::nil) @showtip conted @hidetip nil; nil ); 0 ;; /*----------------------------------------------------*/ /*Click event callback of the media and sequence list*/ fun _clickList (list, node, index) = if list == ListSeq then ( /* let nth_list ListSeq2 index -> name in let nth_list sequenceList indexCurSeq -> curseq in _fooS strcatn"***** Ariane _clickList nomcliqué="::name::" thericvalue="::curseq.nameSeq::nil;*/ set indexCurSeq=index; let nth_list sequenceList indexCurSeq -> curseq in ( DisplayDataLink curseq; _DStoolTip node; _CRtoolTip node 1000 strcatn (_loc this "KW_MODSEQ_BUT" nil)::curseq.nameSeq::"\""::nil @showtip contads @hidetip nil ); _SELlistTabItem list index; nil ) else if list == ListMed then ( set indexCurMed = index; let nth_list mediaListTemp indexCurMed -> curmed in let nth_list sequenceList indexCurSeq -> curseq in let ( if curseq.typeSeq == TYP_IMAGE then (_loc this "KW_TYPE_IMG3" nil) else (_loc this "KW_TYPE_VID3" nil) ) -> type in ( _DStoolTip node; _CRtoolTip node 1000 (_loc this "KW_SEQ3" type::curmed.nameMed::curseq.nameSeq::nil) @showtip conted @hidetip nil; nil ) ) else 0; 0 ;; /*-----------------------------------------------------------------------------*/ /*click callback on edit sequence button*/ fun _clickEditSequence (object, param, posx, posy, btn, mask) = if (windowFlag == 1) && (indexCurSeq != nil) then nil else CreationPopupSeq (_loc this "KW_EDITSEQ" nil) contads (nth_list sequenceList indexCurSeq) ;; /*-----------------------------------------------------------------------------*/ /*click callback on add sequence button*/ fun _clickAddSequence (object, param, posx, posy, btn, mask) = if windowFlag == 1 then nil else CreationPopupSeq (_loc this "KW_ADDSEQ" nil) contads nil ;; /*Callback of Ok button of the remove sequence popup*/ fun cbClick_OkSeq (object, param, posx, posy, btn, mask) = if indexCurSeq == nil then nil else RemoveSeq indexCurSeq; set indexCurSeq = nil; cbPreDestroy_container param nil; 0 ;; /*Key up event callback of the remove sequence popup*/ fun cbKeyUp_RemSeq (cont, param, key) = if key == 28 || key == 284 then cbClick_OkSeq nil cont nil nil nil nil else if key == 1 then cbClick_Cancel nil cont nil nil nil nil else nil ;; /*-----------------------------------------------------------------------------*/ /*create the remove sequence popup*/ fun _clickRemoveSequence (object, param, posx, posy, btn, mask) = let _CRcontainerFromObjCont _channel nil 200 200 150 100 CO_MENU make_rgb 190 197 197 (_loc this "KW_SUPP_SEQ" nil) -> container in ( _CRcompText _channel container nil [10 10] OBJ_ENABLE|OBJ_VISIBLE|CT_LABEL|CT_CENTER|CT_WORDWRAP OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN 130 60 (_loc this "KW_SUPP_SEQ2" nil) font [0 0 0 0] nil nil nil; let _CRcompRollOver _channel container nil [15 75] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_OK" nil) 50 5*20 -> OkButton in _CBcompRollOverClick OkButton @cbClick_OkSeq container; let _CRcompRollOver _channel container nil [85 75] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_CANCEL" nil) 50 5*20 -> CancelButton in _CBcompRollOverClick CancelButton @cbClick_Cancel container; _CBcontainerKeyUp container @cbKeyUp_RemSeq nil; _CBcontainerPreDestroy container @cbPreDestroy_container nil; _PAINTcontainer container ) ;; /*create the timer popup*/ fun _clickTimerRollOver (object, param, posx, posy, btn, mask) = if (windowFlag == 2) && (indexCurLink != nil) && (indexCurSeq != nil) then nil else let nth_list sequenceList indexCurSeq -> curseq in let Extract_list_of_link curseq.IDSeq linkList -> mylistlink in let nth_list mylistlink indexCurLink -> curlink in if curseq.typeSeq == TYP_VIDEO then nil else CreationPopupLink (_loc this "KW_EDITLINK" nil) nil (nth_list mylistlink indexCurLink) curseq nil ;; /*create the name of a picture from his file name*/ fun ChercheNom (nom, compteur) = if compteur >= strlen nom then nil else let substr nom compteur 1-> carac in if !strcmp carac "." then nil else strcat carac ChercheNom nom compteur+1 ;; /*Streaming send fonction to the server*/ fun _SendStreamedaux (thisDMI, messagevalue, filename, pos, lenght) = let pos + MessageMaxSize -> newpos in if newpos > lenght then _DMSsend thisDMI streamedservercom [(substr messagevalue pos /*newpos*/ MessageMaxSize) filename] else ( _DMSsend thisDMI streamedservercom [(substr messagevalue pos /*(newpos -1)*/ MessageMaxSize) filename]; _SendStreamedaux thisDMI messagevalue filename newpos lenght ) ;; fun _SendStm (thisDMI, param, param2) = _SendStreamedaux thisDMI param param2 0 (strlen param) ;; /*Open file callback*/ fun cbOpenFile (box, param, chemin) = let _getpack chemin -> file in let _GetFileNameFromP chemin -> nom in let ( if !strcmp (substr Path (strlen Path)-1 1) "/" then strcatn Path::nom::nil else strcatn Path::"/"::nom::nil ) -> filename in let _SendStm this file filename -> _ in let ChercheNom nom 0 -> medname in let nom -> medfile in let Path -> medpath in let "none" -> medurl in let 0 -> medtype in let 0 -> medorig in let (mot_clef_ID::(itoa (Find_ID_fake_seq sequenceList))::nil):: (mot_clef_Name::medname::nil):: (mot_clef_file::medfile::nil):: (mot_clef_path::medpath::nil):: (mot_clef_url::medurl::nil):: (mot_clef_type::(itoa medtype)::nil):: (mot_clef_type1::(itoa medorig)::nil):: nil -> lstinfo in CreateMed lstinfo ;; /*callback of download button*/ fun _clickDownloadRollOver (object, param, posx, posy, btn, mask) = let _DLGOpenFile _channel conted nil nil nil -> dialogbox in _DLGrflopen dialogbox @cbOpenFile nil; 0 ;; /*click callback on add (>>) button*/ fun _clickAdd (object, param, posx, posy, btn, mask) = if (windowFlag == 2) && (indexCurMed != nil) && (indexCurSeq != nil) then nil else let nth_list sequenceList indexCurSeq -> curseq in let nth_list mediaListTemp indexCurMed -> curmed in if (curseq.typeSeq == curmed.typeMed) || (curseq.typeSeq == nil) then if curmed.typeMed == TYP_VIDEO then let ((mot_clef_ID::(itoa curmed.IDMed)::nil)::(mot_clef_ID1::(itoa curseq.IDSeq)::nil) ::(mot_clef_period::mot_clef_int_nul::nil)::nil) -> lstinfo in CreateLink lstinfo else ( CreationPopupLink (_loc this "KW_ADDLINK" nil) nil nil curseq (nth_list mediaListTemp indexCurMed); nil ) else nil; _PAINTwindow conted ;; /*click callback on del (<<) button*/ fun _clickDel (object, param, posx, posy, btn, mask) = if (indexCurLink == nil) || (indexCurSeq == nil) then nil else ( RemoveLink indexCurLink indexCurSeq; set indexCurLink = nil ); 0 ;; /*-----------------------------------------------------------------------------*/ fun CreateLstFlag (curmed) = if curmed == nil then 1::1::1::1::1::nil else if curmed.origMed == ORIG_IN then 1::1::1::1::1::nil else if curmed.origMed == ORIG_OUT_REAL then if curmed.typeMed == TYP_IMAGE then 1::1::1::1::1::nil else 1::1::1::1::0::nil else nil ;; /*-----------------------------------------------------------------------------*/ /*click callback of edit media button*/ fun _clickEditMedia (object, param, posx, posy, btn, mask) = if (windowFlag == 2)||(indexCurMed == nil) then nil else let nth_list mediaListTemp indexCurMed -> curmed in let nth_list sequenceList indexCurSeq -> curseq in let ( if curseq.typeSeq == TYP_IMAGE then (_loc this "KW_TYPE_IMG2" nil) else if curseq.typeSeq == TYP_VIDEO then (_loc this "KW_TYPE_VID2" nil) else nil ) -> type in CreationPopupMed (_loc this "KW_ED" type::nil) (CreateLstFlag curmed) contads curmed; 0 ;; /*-----------------------------------------------------------------------------*/ /*click callback of add media button*/ fun _clickAddMedia (object, param, posx, posy, btn, mask) = if (windowFlag == 2)||(indexCurSeq == nil) then nil else let nth_list sequenceList indexCurSeq -> curseq in let ( if curseq.typeSeq == TYP_IMAGE then (_loc this "KW_TYPE_IMG2" nil) else if curseq.typeSeq == TYP_VIDEO then (_loc this "KW_TYPE_VID2" nil) else nil ) -> type in CreationPopupMed (_loc this "KW_AJ" type::nil) (CreateLstFlag nil) contads nil; 0 ;; /*-----------------------------------------------------------------------------*/ /*click callback of remove media button*/ fun _clickRemoveMedia (object, param, posx, posy, btn, mask) = if indexCurMed == nil then nil else RemoveMed indexCurMed; set indexCurMed = nil; 0 ;; fun cbDestroy_Conted (object, param) = set windowFlag = 0; _DSwindow object; 0 ;; /*create the sequence editor*/ fun _clickModifSequence (rollover, param, posx, posy, btn, mask) = set windowFlag = 1; let nth_list sequenceList indexCurSeq -> seq in ( let ( if seq.typeSeq == TYP_IMAGE then (_loc this "KW_TYPE_IMG2" nil) else if seq.typeSeq == TYP_VIDEO then (_loc this "KW_TYPE_VID2" nil) else "" ) -> type in ( set conted = _CRwindow _channel contads 30 30 650 400 WN_MENU (_loc this "KW_EDITS" type::seq.nameSeq::nil); _CRtext _channel conted 10 10 250 30 ET_ALIGN_CENTER (_loc this "KW_DISPO" type::nil); _CRtext _channel conted 360 35 250 60 ET_ALIGN_CENTER (_loc this "KW_EDITS" type::seq.nameSeq::nil) ) ); set ListMed = _CRlistTab _channel conted 10 50 250 300 LV_DOWN|LV_SINGLESEL; _ADDlistTabColumn ListMed 0 250 ET_ALIGN_LEFT ""; set ListLinkTemp = _CRlistTab _channel conted 360 100 280 250 LV_DOWN|LV_SINGLESEL; _ADDlistTabColumn ListLinkTemp 0 200 ET_ALIGN_LEFT (_loc this "KW_NOM" nil); _ADDlistTabColumn ListLinkTemp 1 50 ET_ALIGN_LEFT (_loc this "KW_TIMER" nil); DisplayDataMed; DisplayDataLinkTemp (nth_list sequenceList indexCurSeq); let _CRcontainerFromObjWin _channel conted 0 355 650 45 CO_NOBORDER|CO_CHILDINSIDE make_rgb 190 197 197 "cont" -> cont in ( let _CRcompRollOver _channel cont nil [10 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_ADD" nil) 50 5*20 -> AddMediaRollOver in let _CRcompRollOver _channel cont nil [70 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_EDIT" nil) 50 5*20 -> ModifyMediaRollOver in let _CRcompRollOver _channel cont nil [130 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_REMOVE" nil) 50 5*20 -> SupMediaRollOver in ( let nth_list sequenceList indexCurSeq -> seq in let ( if seq.typeSeq == TYP_IMAGE then (_loc this "KW_TYPE_IMG2" nil) else (_loc this "KW_TYPE_VID2" nil) ) -> type in ( let _CONVERTcompRollOverToObjNode AddMediaRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_ADD2" type::nil) @showtip conted @hidetip nil; let _CONVERTcompRollOverToObjNode ModifyMediaRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_MOD" type::nil) @showtip conted @hidetip nil; let _CONVERTcompRollOverToObjNode SupMediaRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_SUPP" type::nil) @showtip conted @hidetip nil ); _CBcompRollOverClick AddMediaRollOver @_clickAddMedia nil; _CBcompRollOverClick ModifyMediaRollOver @_clickEditMedia nil; _CBcompRollOverClick SupMediaRollOver @_clickRemoveMedia nil ); let nth_list sequenceList indexCurSeq -> seq in ( if seq.typeSeq == TYP_IMAGE then ( let _CRcompRollOver _channel cont nil [450 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_TIMER" nil) 50 5*20 -> TimerRollOver in ( _CBcompRollOverClick TimerRollOver @_clickTimerRollOver nil; let _CONVERTcompRollOverToObjNode TimerRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_TIMER2" nil) @showtip conted @hidetip nil ); let _CRcompRollOver _channel cont nil [100 25] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_DOWNLOAD" nil) 80 5*20 -> DownloadRollOver in _CBcompRollOverClick DownloadRollOver @_clickDownloadRollOver nil ) else nil ); _PAINTcontainer cont ); let _CRcontainerFromObjWin _channel conted 275 185 70 80 CO_NOBORDER|CO_CHILDINSIDE make_rgb 190 197 197 "cont" -> cont in ( let _CRcompRollOver _channel cont nil [10 10] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver ">>" 50 5*20 -> Add in let _CRcompRollOver _channel cont nil [10 50] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver "<<" 50 5*20 -> Del in ( let _CONVERTcompRollOverToObjNode Add -> node in ( _CBlistTabSelect ListMed @_clickList node; _CRtoolTip node 1000 "truc" @showtip conted @hidetip nil ); let _CONVERTcompRollOverToObjNode Del -> node in ( _CBlistTabSelect ListLinkTemp @_clickListLink node; _CRtoolTip node 1000 "truc" @showtip conted @hidetip nil ); _CBcompRollOverClick Add @_clickAdd nil; _CBcompRollOverClick Del @_clickDel nil ); _PAINTcontainer cont ); _CBwinClose conted @cbDestroy_Conted nil; 0 ;; fun cbFocus_Win (win, param) = DisplayDataSeq; _clickList ListSeq param indexCurSeq ;; /*----------------------------------------------------*/ /*Display the Editor*/ fun Show () = set PathPic = _DMSgetpath _DMSgetClass this; set windowFlag = 0; let _DMSgetpath _DMSgetClass this -> path in ( let strcat path "resources/Lifts.png" -> chemin in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack chemin -> [tmpBmp tmpBmp8] in ( set SlideBmp = tmpBmp; set SlideBmp8 = tmpBmp8 ); let strcat path "resources/combos.png" -> chemin in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack chemin -> [tmpBmp tmpBmp8] in ( set ComboBmp = tmpBmp; set ComboBmp8 = tmpBmp8 ); let strcat path "resources/buttons.png" -> chemin in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack chemin -> [tmpBmp tmpBmp8] in ( set ButtonBmp = tmpBmp; set ButtonBmp8 = tmpBmp8 ) ); let 25 -> step in let 10 -> coord1_x in let 205 -> coord2_x in let 400 -> coord3_x in let 20 -> h_button in let 55 -> w_button in let 0 -> ecart in let 65 -> coord1_y in let coord1_y+h_button+5 -> coord2_y in let 400-70-(65+h_button+ecart) -> h_list in let (h_list/2)-step -> h_list2 in let LST_LEFT|LST_HIGHLIGHT_SELECTED|LST_HIGHLIGHT_CLICKED -> colFlags in let 250 ->w_listview in let 30 +w_listview -> coord21_x in let (coord2_y+step+h_list2) -> coord3_y in ( set contads = _CRwindow _channel nil 10 10 600 400 WN_MENU (_loc this "KW_TITLE" nil); set font = _CRfont _channel 14 0 0 "Arial"; set ListSeq = _CRlistTab _channel contads 10 50 250 300 LV_DOWN|LV_SINGLESEL; _ADDlistTabColumn ListSeq 0 250 ET_ALIGN_LEFT ""; set ListLink = _CRlistTab _channel contads 310 100 280 250 LV_DOWN|LV_SINGLESEL; _ADDlistTabColumn ListLink 0 200 ET_ALIGN_LEFT (_loc this "KW_NOM" nil); _ADDlistTabColumn ListLink 1 50 ET_ALIGN_LEFT (_loc this "KW_TIMER" nil); _CRtext _channel contads 10 10 250 30 ET_ALIGN_CENTER (_loc this "KW_LIST_SEQUENCE" nil); set LabelListLink = _CRtext _channel contads 310 35 250 60 ET_ALIGN_CENTER ""; let _CRcontainerFromObjWin _channel contads 0 360 600 40 CO_NOBORDER|CO_CHILDINSIDE make_rgb 191 192 191 "cont" -> cont in ( let _CRcompRollOver _channel cont nil [10 5] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_ADD" nil) 50 5*20 -> AddSeqRollOver in let _CRcompRollOver _channel cont nil [70 5] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_EDIT" nil) 50 5*20 -> ModifySeqRollOver in let _CRcompRollOver _channel cont nil [130 5] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_REMOVE" nil) 50 5*20 -> SupSeqRollOver in let _CRcompRollOver _channel cont nil [400 5] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN DrawRollOver (_loc this "KW_EDIT" nil) 50 5*20 -> ModifyMedRollOver in ( let _CONVERTcompRollOverToObjNode AddSeqRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_ADDSEQ_BUT" nil) @showtip contads @hidetip nil; let _CONVERTcompRollOverToObjNode ModifySeqRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_EDITSEQ_BUT" nil) @showtip contads @hidetip nil; let _CONVERTcompRollOverToObjNode SupSeqRollOver -> node in _CRtoolTip node 1000 (_loc this "KW_SUPPSEQ_BUT" nil) @showtip contads @hidetip nil; let _CONVERTcompRollOverToObjNode ModifyMedRollOver -> node in let nth_list sequenceList indexCurSeq -> seq in ( _CRtoolTip node 1000 (_loc this "KW_MODSEQ_BUT" seq.nameSeq::nil) @showtip contads @hidetip nil; _CBlistTabSelect ListSeq @_clickList node ); _CBcompRollOverClick AddSeqRollOver @_clickAddSequence nil; _CBcompRollOverClick ModifySeqRollOver @_clickEditSequence nil; _CBcompRollOverClick SupSeqRollOver @_clickRemoveSequence nil; _CBcompRollOverClick ModifyMedRollOver @_clickModifSequence nil ); _PAINTcontainer cont ); _CBwinFocus contads @cbFocus_Win nil; _CBwinClose contads @_quitter nil; _PAINTwindow contads ) ;; /*********************************************************************************************************************************************/ /***************************************** SAVE & UPDATE FUNCTIONS ***************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ /*Retrieves the datas and fill the lists*/ fun Analyse_Request_Results (type, lst_info) = if lst_info == nil then nil else if type == 1 then let hd lst_info -> [Sid[Slinkid[Sdescr[Sname[Stype _ ]]]]] in ( if !strcmp Sdescr FKW_SNULL then set Sdescr = nil else nil; let mkSeq[(atoi Sid) Sname Sdescr (atoi Slinkid) (atoi Stype)] -> newseq in ( set sequenceList=newseq::sequenceList ); 0 ) else if type == 2 then let hd lst_info -> [Mid[Mname[Mfilename[Mpath[Murl[Mtype[Morigine _ ]]]]]]] in ( if !strcmp Mfilename FKW_SNULL then set Mfilename = nil else nil; if !strcmp Mpath FKW_SNULL then set Mpath = nil else nil; if !strcmp Murl FKW_SNULL then set Murl = nil else nil; let mkMyMedia[(atoi Mid) Mname (strcat Mpath Mfilename) Murl (atoi Mtype) nil nil (atoi Morigine)] -> newmedia in ( /* _fooS strcatn "***** Analyse_Request_Results type=2 id="::Mid::" name="::Mname::nil;*/ set mediaList=newmedia::mediaList ); 0 ) else if type == 3 then let hd lst_info -> [Lid[Lidseq[Lidmed[Lperiod _ ]]]] in ( if !strcmp Lperiod mot_clef_int_nul then set Lperiod = nil else nil; let mkLink[(atoi Lid) (atoi Lidseq) (atoi Lidmed) (atoi Lperiod)] -> newlink in let nth_list sequenceList (My_find_index_sequence newlink.IDseqLink sequenceList 0)->cur_seq in /*TODO : faire une fct qui renvoie directemenyt la sequence*/ ( if cur_seq.typeSeq != nil then nil else let nth_list mediaList (My_find_index_media newlink.IDmedLink mediaList 0) -> cur_med in set cur_seq.typeSeq=cur_med.typeMed; /* _fooS strcatn "***** Analyse_Request_Results type=3 id="::Lid::" Lidseq="::Lidseq ::" Lidmed="::Lidmed::" Period="::Lperiod::nil;*/ set linkList=newlink::linkList ); 0 ) else nil; 0 ;; /*----------------------------------------------------*/ /*Display the data contained in the lists*/ fun Load_Data (type) = if type == SELECT_SEQ then ( DisplayDataSeq; 0 ) else if type == SELECT_MED then ( DisplayDataMed; 0 ) else if type == SELECT_LINK then ( DisplayDataSeq; if indexCurSeq != nil then DisplayDataLink (nth_list sequenceList indexCurSeq) else let hd sequenceList -> firstsequence in DisplayDataLink firstsequence; 0 ) else nil; 0 ;; /*********************************************************************************************************************************************/ /***************************************** INITIALISATION ************************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ fun IniDMI (param) = _DMSevent this "in" nil nil; set Path = param; 0 ;; /*********************************************************************************************************************************************/ /***************************************** DEFCOM ************************************************************************************/ /*********************************************************************************************************************************************/ /*----------------------------------------------------*/ fun __Show () = set sequenceList = nil; set mediaList = nil; set linkList = nil; set indexCurMed = nil; set indexCurLink = nil; set indexCurSeq = nil; Show ;; /*----------------------------------------------------*/ /* type: voir types predefinis, loaded : indicates it's the last record, so the lists can be displayed infos: results of the request */ fun __Update (type, loaded, info) = if loaded == 1 then ( Load_Data type ) else ( Analyse_Request_Results type (strextr info) ) ;; fun __Feedback (type, toto, info) = let strextr info -> param in if type == INSERT_SEQ then let getInfo param mot_clef_ID1 ->maxseqid in let getInfo param mot_clef_ID2 ->maxidseqlink in let getInfo param mot_clef_Name ->nameseq in let getInfo param mot_clef_Descr-> descrseq in let getInfo param mot_clef_type -> typeseq in ( if !strcmp descrseq FKW_SNULL then set descrseq = nil else nil; let mkSeq[(atoi maxseqid) nameseq descrseq (atoi maxidseqlink) (atoi typeseq)] -> newseq in ( set sequenceList=newseq::sequenceList; DisplayDataSeq; DisplayDataLink newseq ); 0 ) else if type == UPDATE_SEQ then let getInfo param mot_clef_ID ->idseq in let getInfo param mot_clef_Name ->nameseq in let getInfo param mot_clef_Descr-> descrseq in let getInfo param mot_clef_type -> typeseq in let My_find_index_sequence(atoi idseq) sequenceList 0 -> curindex in let nth_list sequenceList curindex -> curseq in ( if !strcmp descrseq FKW_SNULL then set descrseq = nil else nil; set curseq.nameSeq = nameseq; set curseq.descrSeq = descrseq; set curseq.typeSeq = atoi typeseq; DisplayDataSeq; DisplayDataLink curseq; 0 ) else if type == DELETE_SEQ then let getInfo param mot_clef_ID ->idseq in let My_find_index_sequence(atoi idseq) sequenceList 0 -> curindex in let My_find_index_seqlink (atoi idseq) linkList 0 -> indexlst in ( set sequenceList = remove_nth_from_list sequenceList curindex; set linkList = My_Remove_Indexlist linkList indexlst; DisplayDataSeq; DisplayDataLink nil; 0 ) else if type == ADD_LINK then let getInfo param mot_clef_ID2 ->maxid in let getInfo param mot_clef_ID ->idmedia in let getInfo param mot_clef_ID1 -> idseq in let getInfo param mot_clef_period -> period in ( if !strcmp period mot_clef_int_nul then set period = nil else nil; let mkLink[(atoi maxid) (atoi idseq) (atoi idmedia) (atoi period)] -> newlink in let nth_list sequenceList (My_find_index_sequence newlink.IDseqLink sequenceList 0)->cur_seq in ( set linkList = newlink::linkList; if cur_seq.typeSeq != nil then nil else let nth_list mediaList (My_find_index_media newlink.IDmedLink mediaList 0)->cur_med in set cur_seq.typeSeq=cur_med.typeMed; DisplayDataSeq; DisplayDataLinkTemp (nth_list sequenceList indexCurSeq); 0 ) ) else if type == UPDATE_LINK then let getInfo param mot_clef_ID ->idlink in let getInfo param mot_clef_ID1 -> idseq in let getInfo param mot_clef_period -> period in let My_find_index_link (atoi idlink) linkList 0 -> curlinkindex in let nth_list linkList curlinkindex -> curlink in ( if !strcmp period mot_clef_int_nul then set period = nil else nil; set curlink.periodLink =atoi period; DisplayDataLinkTemp (nth_list sequenceList indexCurSeq); 0 ) else if type == DELETE_LINK then let getInfo param mot_clef_ID ->idlink in let My_find_index_link (atoi idlink) linkList 0 -> curlinkindex in let nth_list sequenceList indexCurSeq -> curseq in ( set linkList = remove_nth_from_list linkList curlinkindex; /*if (sizelist (Extract_list_of_link curseq.IDSeq linkList)) == 0 then ( set curseq.typeSeq = nil; DisplayDataSeq ) else nil; */ DisplayDataLinkTemp curseq; 0 ) else if type == ADD_MED then let getInfo param mot_clef_ID1 ->maxid in let getInfo param mot_clef_Name ->name in let getInfo param mot_clef_file ->file in let getInfo param mot_clef_path ->path in let getInfo param mot_clef_url ->url in let getInfo param mot_clef_type ->typem in let getInfo param mot_clef_type1 ->orig in ( if !strcmp file FKW_SNULL then set file = nil else nil; if !strcmp path FKW_SNULL then set path = nil else nil; if !strcmp url FKW_SNULL then set url = nil else nil; let mkMyMedia[(atoi maxid) name (strcat path file) url (atoi typem) nil nil (atoi orig)] -> newmedia in set mediaList = newmedia::mediaList; DisplayDataMed; 0 ) else if type == UPDATE_MED then let getInfo param mot_clef_ID ->id in let getInfo param mot_clef_Name ->name in let getInfo param mot_clef_file ->file in let getInfo param mot_clef_path ->path in let getInfo param mot_clef_url ->url in ( if !strcmp file FKW_SNULL then set file = nil else nil; if !strcmp path FKW_SNULL then set path = nil else nil; if !strcmp url FKW_SNULL then set url = nil else nil; let My_find_index_media (atoi id) mediaList 0 -> curmediaindex in let nth_list mediaList curmediaindex -> curmedia in ( set curmedia.nameMed = name; set curmedia.pathMed = strcat path file; set curmedia.urlMed = url ); DisplayDataMed;0 ) else if type == DELETE_MED then let getInfo param mot_clef_ID ->idmed in ( let My_find_index_media (atoi idmed) mediaList 0 -> curindex in let My_find_index_medlink (atoi idmed) linkList 0 -> indexlst in ( set mediaList = remove_nth_from_list mediaList curindex; set linkList = My_Remove_Indexlist linkList indexlst ); DisplayDataMed; DisplayDataLinkTemp (nth_list sequenceList indexCurSeq); 0 ) else 0 ;;