/* Package for the listview component - by Julien Zorko - nov 2000 */ /* Available functions: LISTVIEW_Create LISTVIEW_Destroy LISTVIEW_Resize LISTVIEW_SetCBclick LISTVIEW_SetCBdblClick LISTVIEW_SetCBclickTitle LISTVIEW_SetCBdblClickTitle LISTVIEW_SetCBkeyUp LISTVIEW_SetCBkeyDown LISTVIEW_AddCol LISTVIEW_DelCol LISTVIEW_GetColumn LISTVIEW_GetColumnNumber LISTVIEW_SetColumnTitle LISTVIEW_AddLine LISTVIEW_DelLine LISTVIEW_GetValue LISTVIEW_SetValue LISTVIEW_Reset LISTVIEW_SetClicked LISTVIEW_LineCount LISTVIEW_ColCount */ /* view flags */ var LISTVIEW_SELECTLINE = 0b0000000000000000001;; struct LVColumn = [ LVC_Title : CompText , /* title */ LVC_Flags : I , /* flags */ LVC_Width : I , /* width */ LVC_Items : CompList , /* content */ LVC_Separator : CompBitmap , /* vertical line */ LVC_ReservedSpace : I /* space reserved for the bitmap before the text */ ] mkLVColumn;; struct ListView = [ LISTVIEW_Channel : Chn , /* Channel */ LISTVIEW_Container : ObjContainer , /* */ LISTVIEW_Coord : [I I] , /* coordinates */ LISTVIEW_Height : I , /* */ LISTVIEW_Width : I , /* */ LISTVIEW_Flags : I , /* flags */ LISTVIEW_EventFlags : I , /* */ LISTVIEW_ViewFlags : I , /* ... */ LISTVIEW_Columns : [LVColumn r1] , /* columns */ LISTVIEW_Back : CompBitmap , /* -- */ LISTVIEW_ItemsHeight : I , /* */ LISTVIEW_Direction : I , /* */ LISTVIEW_Font : ObjFont , /* */ LISTVIEW_TextColors : [I I I I] , /* textcolor textcoefftransp shadowflag shadowcolor */ LISTVIEW_SelColors : [I I] , /* selectcolor transparencycoeff */ LISTVIEW_BackColor : I , /* Background color for the listview */ LISTVIEW_LabelSize : I , /* */ LISTVIEW_LabelFont : ObjFont , /* */ LISTVIEW_LabelTextColors : [I I I I] , /* */ LISTVIEW_LabelBackColor : I , /* Backgound color for the column headers */ LISTVIEW_LinesColor : I , /* separators color */ LISTVIEW_BackBmp : AlphaBitmap , /* Bg alpha bitmap */ LISTVIEW_SeparatorBmp : AlphaBitmap , /* */ LISTVIEW_ResizeTuple : [I I I] , /* Col, iniPosX, move/resize */ LISTVIEW_MasterCol : LVColumn , /* the other columns are linked to it */ LISTVIEW_CBclick : fun [ListView I I] I , /* (lv line column) */ LISTVIEW_CBdblClick : fun [ListView I I] I , /* (lv line column) */ LISTVIEW_CBclickT : fun [ListView I I I] I , /* (lv col btn mask) */ LISTVIEW_CBdblClickT : fun [ListView I I I] I , /* (lv col btn mask) */ LISTVIEW_CBkeyUp : fun [ListView I] I, /* (lv keycode) */ LISTVIEW_CBkeyDown : fun [ListView I I] I, /* (lv key keycode) */ LISTVIEW_SlideBarV : CompSlideBar , /* */ LISTVIEW_SlideBarH : CompSlideBar , /* */ LISTVIEW_Xpos : I , /* */ LISTVIEW_ForceResize : fun []I , /* function for resizing */ LISTVIEW_DressingBmp : CompBitmap /* for graphic dressing... */ ] mkListView;; proto LISTVIEW_Refresh = fun [ListView [LVColumn r1] I I I I I] [I I];; /*---------------------------------------* Reflexes *---------------------------------------*/ /* display section */ fun _rflResizeCompBmp ( compBmp, param, w, h, parambmp) = let param -> [channel motif trans] in let _GETalphaBitmapSize motif -> [mw mh] in let _FILLbitmap _CRbitmap channel w h trans-> bmp in let _SCPalphaBitmap bmp 0 0 w-1 h-1 motif 0 0 mw-1 mh-1 -> _ in let _CRalphaBitmap channel bmp nil trans trans -> abmp in ( _DSbitmap bmp; [abmp [0 0 w h]] ) ;; /*---------------------------------------*/ fun LISTVIEW_BarMove (cont, lv, posx, posy, mask) = if mask & MK_LBUTTON then let lv.LISTVIEW_ResizeTuple -> [col iPosx mr] in if mr == 1 then let if (posx > 0) then posx else 0 -> posxx in let if (posxx < (lv.LISTVIEW_Width-2)) then posxx else (lv.LISTVIEW_Width-2) -> posxxx in let LISTVIEW_Refresh lv lv.LISTVIEW_Columns col (posxxx-iPosx) 0 lv.LISTVIEW_Xpos (posxxx-iPosx) ->[realSize realDiff] in ( set lv.LISTVIEW_ResizeTuple = [col iPosx+realDiff 1]; 0 ) else nil else (_CBcontainerCursorMove lv.LISTVIEW_Container nil nil;0) ;; /*----------------------------------------*/ fun LISTVIEW_BarClick (cBmp, param, posx, posy, btn, mask) = let param -> [lv col] in let _GETobjNodePositionSizeInContainerRef _CONVERTcompBitmapToObjNode cBmp -> [x y w h] in ( set lv.LISTVIEW_ResizeTuple = [col posx 1]; _CBcontainerCursorMove lv.LISTVIEW_Container @LISTVIEW_BarMove lv; ); 0 ;; /*---------------------------------------*/ fun LISTVIEW_BarUnClick(obj, lv, posx, posy, btn, mask) = _CBcontainerCursorMove lv.LISTVIEW_Container nil nil; let LISTVIEW_Refresh lv lv.LISTVIEW_Columns 0 0 0 lv.LISTVIEW_Xpos 0 ->[realSize realDiff] in let if (realSize-lv.LISTVIEW_Width) > 0 then (realSize-lv.LISTVIEW_Width) else 0 -> newMax in _SETcompSlideBarMax lv.LISTVIEW_SlideBarH newMax; _PAINTobjNode _CONVERTcompSlideBarToObjNode lv.LISTVIEW_SlideBarH; set lv.LISTVIEW_ResizeTuple = nil; 0 ;; /*---------------------------------------*/ fun LISTVIEW_Click (compList, param, i) = let param -> [lv col] in exec lv.LISTVIEW_CBclick with [lv i col] ;; /*---------------------------------------*/ fun LISTVIEW_DblClick (compList, param, i) = let param -> [lv col] in exec lv.LISTVIEW_CBdblClick with [lv i col] ;; /*---------------------------------------*/ fun LISTVIEW_KeyUp (cont, lv, key) = exec lv.LISTVIEW_CBkeyUp with [lv key] ;; /*---------------------------------------*/ fun LISTVIEW_KeyDown (cont, lv, key, keycode) = exec lv.LISTVIEW_CBkeyDown with [lv key keycode] ;; /*---------------------------------------*/ fun LISTVIEW_ScrollV2 (cList, pos) = if cList==nil then 0 else let cList -> [fc nc] in ( _SETcompListFirst fc.LVC_Items pos; LISTVIEW_ScrollV2 nc pos ) ;; /*---------------------------------------*/ fun LISTVIEW_ScrollV (cSlide, lv, pos) = LISTVIEW_ScrollV2 lv.LISTVIEW_Columns pos; _PAINTcontainer lv.LISTVIEW_Container;; /*---------------------------------------*/ fun LISTVIEW_ScrollH (cSlide, lv, pos) = set lv.LISTVIEW_Xpos = -pos; LISTVIEW_Refresh lv lv.LISTVIEW_Columns 0 0 0 lv.LISTVIEW_Xpos 0;; /*---------------------------------------*/ fun LISTVIEW_DrawSeparator (lv, lvc, abscisse, col) = let if lv.LISTVIEW_SeparatorBmp == nil then let _CRbitmap lv.LISTVIEW_Channel 3 lv.LISTVIEW_Height -> bmp in ( _FILLbitmap bmp lv.LISTVIEW_LinesColor+50; _DRAWline bmp 1 0 1 lv.LISTVIEW_Height DRAW_SOLID 1 lv.LISTVIEW_LinesColor; set lv.LISTVIEW_SeparatorBmp = _CRalphaBitmap lv.LISTVIEW_Channel bmp nil nil lv.LISTVIEW_LinesColor+50/*trans*/ ) else lv.LISTVIEW_SeparatorBmp -> sepBmp in ( if lvc.LVC_Separator != nil then nil else set lvc.LVC_Separator = _CRcompBitmap lv.LISTVIEW_Channel lv.LISTVIEW_Container nil [abscisse 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN sepBmp 0 0 3 lv.LISTVIEW_Height; _CBcompBitmapResizeResource lvc.LVC_Separator @_rflResizeCompBmp [lv.LISTVIEW_Channel lv.LISTVIEW_SeparatorBmp lv.LISTVIEW_LinesColor+50/*trans*/]; _CBcompBitmapClick lvc.LVC_Separator @LISTVIEW_BarClick [lv col] ) ;; /*---------------------------------------*/ fun LISTVIEW_CreateAllLinks (cList,master,links) = if cList == nil then master else let cList -> [fc nc] in ( if fc == master then nil else _CRnodeLink _CONVERTcompListToObjNode fc.LVC_Items _CONVERTcompListToObjNode master.LVC_Items links; LISTVIEW_CreateAllLinks nc master links );; /*---------------------------------------*/ fun LISTVIEW_Refresh (lv, cList, col, diff, c, x, realDiff) = if (cList == nil) then ( _PAINTcontainer lv.LISTVIEW_Container; [(x-lv.LISTVIEW_Xpos) realDiff] ) else let cList -> [fc nc] in ( if fc.LVC_Items == nil then ( set fc.LVC_Items = _CRcompList lv.LISTVIEW_Channel lv.LISTVIEW_Container nil [x lv.LISTVIEW_LabelSize] fc.LVC_Flags lv.LISTVIEW_EventFlags|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN fc.LVC_Width lv.LISTVIEW_Height lv.LISTVIEW_Height / lv.LISTVIEW_ItemsHeight lv.LISTVIEW_Direction lv.LISTVIEW_Font fc.LVC_ReservedSpace lv.LISTVIEW_TextColors lv.LISTVIEW_SelColors nil; if (lv.LISTVIEW_MasterCol == nil) then ( set lv.LISTVIEW_MasterCol = fc; 0 ) else if (lv.LISTVIEW_ViewFlags & LISTVIEW_SELECTLINE) == LISTVIEW_SELECTLINE then ( _CRnodeLink _CONVERTcompListToObjNode fc.LVC_Items _CONVERTcompListToObjNode lv.LISTVIEW_MasterCol.LVC_Items LINK_SELECT|LINK_RESIZE|LINK_MOVE; 0 ) else ( _CRnodeLink _CONVERTcompListToObjNode fc.LVC_Items _CONVERTcompListToObjNode lv.LISTVIEW_MasterCol.LVC_Items LINK_RESIZE|LINK_MOVE; 0 ) ) else nil;let _CONVERTcompListToObjNode fc.LVC_Items -> obj in let _CONVERTcompBitmapToObjNode fc.LVC_Separator -> sep in ( if col==c then let fc.LVC_Width -> width in ( set fc.LVC_Width = if (width + diff) > 0 then width + diff else 0; set realDiff = fc.LVC_Width - width ) else nil; _CHANGEobjNodeCoordinates obj [x lv.LISTVIEW_LabelSize] 0; _SIZEobjNode obj (fc.LVC_Width) (lv.LISTVIEW_Height - lv.LISTVIEW_LabelSize) 0; _CHANGEobjNodeCoordinates sep [(x+fc.LVC_Width) 0] 0; 0 ); let _CONVERTcompTextToObjNode fc.LVC_Title -> title in ( _CHANGEobjNodeCoordinates title [(x+fc.LVC_ReservedSpace) 0] 0; _SIZEobjNode title (fc.LVC_Width-fc.LVC_ReservedSpace) lv.LISTVIEW_LabelSize 0 ); _CBcompListClick fc.LVC_Items @LISTVIEW_Click [lv c]; _CBcompListDblClick fc.LVC_Items @LISTVIEW_DblClick [lv c]; LISTVIEW_DrawSeparator lv fc (x + fc.LVC_Width) c; LISTVIEW_Refresh lv nc col diff c+1 (x+fc.LVC_Width+3) realDiff ) ;; /*---------------------------------------*/ fun LISTVIEW_CreateBack (lv) = let _CRbitmap lv.LISTVIEW_Channel lv.LISTVIEW_Width lv.LISTVIEW_LabelSize -> bmp in ( _FILLbitmap bmp lv.LISTVIEW_LabelBackColor; _DRAWline bmp 0 lv.LISTVIEW_LabelSize-1 lv.LISTVIEW_Width lv.LISTVIEW_LabelSize-1 DRAW_SOLID 1 lv.LISTVIEW_LinesColor; set lv.LISTVIEW_BackBmp = _CRalphaBitmap lv.LISTVIEW_Channel bmp nil nil nil; set lv.LISTVIEW_Back = _CRcompBitmap lv.LISTVIEW_Channel lv.LISTVIEW_Container nil [0 0] OBJ_VISIBLE|OBJ_ENABLE|OBJ_MW_FLEX lv.LISTVIEW_EventFlags|OBJ_CONTAINER_CLICK||OBJ_CONTAINER_DBLCLICK lv.LISTVIEW_BackBmp 0 0 lv.LISTVIEW_Width lv.LISTVIEW_LabelSize; _CBcompBitmapResizeResource lv.LISTVIEW_Back @_rflResizeCompBmp [lv.LISTVIEW_Channel lv.LISTVIEW_BackBmp nil] ) ;; fun LISTVIEW_GetColumnNumber (columns, x, n) = if columns == nil then nil else let columns -> [first next] in let x-first.LVC_Width -> xx in if xx < 0 then n else LISTVIEW_GetColumnNumber next xx-3 n+1 ;; fun LISTVIEW_ClickTitle (cont, lv, x, y, btn, mask) = let LISTVIEW_GetColumnNumber lv.LISTVIEW_Columns lv.LISTVIEW_Xpos+x 0 -> col in exec lv.LISTVIEW_CBclickT with [lv col btn mask] ;; fun LISTVIEW_DblClickTitle (cont, lv, x, y, btn, mask) = let LISTVIEW_GetColumnNumber lv.LISTVIEW_Columns lv.LISTVIEW_Xpos+x 0 -> col in exec lv.LISTVIEW_CBdblClickT with [lv col btn mask] ;; /**************************************************************************************** * * FONCTIONS PUBLIQUES * ****************************************************************************************/ /*------------------------------------------------*/ /* Fonction publique de création de la listview */ /*------------------------------------------------*/ fun LISTVIEW_Create ( channel, container, coordinates, width, height, flags, evFlags, vFlags, itemsH, direction, font, textColors, selColors, backColor, labelSize, labelFont, labelTextColors, labelBackColor, linesColor, vBar, hBar, dressingBmp) = let coordinates -> [posx posy] in let _GETcontainerPositionSize container -> [cx cy cw ch] in let _CRcontainerFromObjCont channel container posx posy width height CO_CHILDINSIDE|CO_NOBORDER backColor nil -> cont in let mkListView [ channel cont coordinates height width flags evFlags vFlags nil nil itemsH direction font textColors selColors backColor labelSize labelFont labelTextColors labelBackColor linesColor nil nil nil nil nil nil nil nil nil nil nil nil 0 nil dressingBmp ] -> lv in ( LISTVIEW_CreateBack lv; set lv.LISTVIEW_SlideBarV = vBar; set lv.LISTVIEW_SlideBarH = hBar; _CBcompSlideBarValue lv.LISTVIEW_SlideBarV @LISTVIEW_ScrollV lv; _CBcompSlideBarValue lv.LISTVIEW_SlideBarH @LISTVIEW_ScrollH lv; _CBcontainerUnClick cont @LISTVIEW_BarUnClick lv; _CBcontainerClick cont @LISTVIEW_ClickTitle lv; _CBcontainerDblClick cont @LISTVIEW_DblClickTitle lv; lv ) ;; /*------------------------------------------------------*/ /* Fonction publique de redimmensionnement du composant */ /*------------------------------------------------------*/ fun LISTVIEW_Resize (lv, posx, posy, w, h) = set lv.LISTVIEW_Width = w; set lv.LISTVIEW_Height = h; set lv.LISTVIEW_Coord = [posx posy]; _SIZEEXcontainer lv.LISTVIEW_Container posx posy w h; let LISTVIEW_Refresh lv lv.LISTVIEW_Columns 0 0 0 lv.LISTVIEW_Xpos 0 ->[realSize realDiff] in let if (realSize-lv.LISTVIEW_Width) > 0 then (realSize-lv.LISTVIEW_Width) else 0 -> newMax in _SETcompSlideBarMax lv.LISTVIEW_SlideBarH newMax; _PAINTobjNode _CONVERTcompSlideBarToObjNode lv.LISTVIEW_SlideBarH; set lv.LISTVIEW_ResizeTuple = nil ;; /*-----------------------------------------------*/ /* Fonctions publiques de définition des callbacks */ /*-----------------------------------------------*/ fun LISTVIEW_SetCBclick (lv,cb) = set lv.LISTVIEW_CBclick = cb;; fun LISTVIEW_SetCBdblClick (lv,cb) = set lv.LISTVIEW_CBdblClick = cb;; fun LISTVIEW_SetCBclickTitle (lv,cb) = set lv.LISTVIEW_CBclickT = cb;; fun LISTVIEW_SetCBdblClickTitle (lv,cb) = set lv.LISTVIEW_CBdblClickT = cb;; fun LISTVIEW_SetCBkeyUp (lv,cb) = _CBcontainerKeyUp lv.LISTVIEW_Container @LISTVIEW_KeyUp lv; set lv.LISTVIEW_CBkeyUp = cb;; fun LISTVIEW_SetCBkeyDown (lv,cb) = _CBcontainerKeyDown lv.LISTVIEW_Container @LISTVIEW_KeyDown lv; set lv.LISTVIEW_CBkeyDown = cb;; /*---------------------------------------*/ fun LISTVIEW_AddCol2 (cList, position, newCol) = if cList == nil then if newCol == nil then nil else newCol::nil else let cList -> [fc nc] in if (position == 0) && (newCol != nil) then newCol::fc::(LISTVIEW_AddCol2 nc (position-1) nil) else fc::(LISTVIEW_AddCol2 nc (position-1) newCol);; /*-----------------------------------------*/ /* fonction publique d'ajout d'une colonne */ /*-----------------------------------------*/ fun LISTVIEW_AddCol (lv, position, title, flags, width, reservedSpace) = let if (flags&LST_RIGHT)==LST_RIGHT then CT_RIGHT else if (flags&LST_LEFT) ==LST_LEFT then CT_LEFT else CT_CENTER -> posFlag in ( if (position < 0) && (width <= 0) then nil else let _GETstringSize lv.LISTVIEW_Font title -> [w h] in let _CRcompText lv.LISTVIEW_Channel lv.LISTVIEW_Container nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|CT_LABEL|posFlag OBJ_CONTAINER_MOVE|OBJ_CONTAINER_DBLCLICK|OBJ_CONTAINER_CLICK|OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN w h title lv.LISTVIEW_Font lv.LISTVIEW_LabelTextColors lv.LISTVIEW_SelColors nil nil -> ctitle in let mkLVColumn [ctitle flags width nil nil reservedSpace] -> newCol in ( set lv.LISTVIEW_Columns = LISTVIEW_AddCol2 lv.LISTVIEW_Columns position newCol; let LISTVIEW_Refresh lv lv.LISTVIEW_Columns position 0 0 lv.LISTVIEW_Xpos 0 -> [realSize _] in _SETcompSlideBarMax lv.LISTVIEW_SlideBarH (realSize-lv.LISTVIEW_Width) ) ) ;; /*-------------------------------------------------*/ fun LISTVIEW_DelCol2 (cList,position) = if cList==nil then nil else let cList -> [fc nc] in if position==0 then ( _DScompList fc.LVC_Items; set fc.LVC_Items = nil; _DScompText fc.LVC_Title; set fc.LVC_Title = nil; _DScompBitmap fc.LVC_Separator; set fc.LVC_Separator = nil; nc ) else fc::(LISTVIEW_DelCol2 nc position-1);; /*-------------------------------------------------*/ /* Fonction publique de suppression d'une colonne */ /*-------------------------------------------------*/ fun LISTVIEW_DelCol (lv,position) = set lv.LISTVIEW_Columns = LISTVIEW_DelCol2 lv.LISTVIEW_Columns position; if lv.LISTVIEW_MasterCol.LVC_Items == nil then ( set lv.LISTVIEW_MasterCol = hd lv.LISTVIEW_Columns; if (lv.LISTVIEW_ViewFlags & LISTVIEW_SELECTLINE) == LISTVIEW_SELECTLINE then LISTVIEW_CreateAllLinks lv.LISTVIEW_Columns lv.LISTVIEW_MasterCol LINK_SELECT|LINK_RESIZE|LINK_MOVE else LISTVIEW_CreateAllLinks lv.LISTVIEW_Columns lv.LISTVIEW_MasterCol LINK_RESIZE|LINK_MOVE ) else nil; LISTVIEW_Refresh lv lv.LISTVIEW_Columns 0 0 0 lv.LISTVIEW_Xpos 0;; /*---------------------------------------------*/ /* Fonction publique d'obtention de la colonne */ /* (renvoie le compList correspondant au numero*/ /* de colonne en paramètre) */ /*---------------------------------------------*/ fun LISTVIEW_GetColumn (lv, i) = let nth_list lv.LISTVIEW_Columns i -> lvc in lvc.LVC_Items;; /*---------------------------------------------*/ fun LISTVIEW_SetColumnTitle (lv, i, s) = let nth_list lv.LISTVIEW_Columns i -> lvc in _SETcompText lvc.LVC_Title s nil nil nil;; /*----------------------------------------------*/ fun LISTVIEW_AddLine2 (cList,position,line) = if cList == nil then 0 else let cList -> [first next] in let line -> [cf cn] in ( if cf != nil then _ADDcompList first.LVC_Items position cf else _ADDcompList first.LVC_Items position ["" nil]; LISTVIEW_AddLine2 next position cn );; /*----------------------------------------------*/ /* Fonction publique d'ajout d'une ligne */ /*----------------------------------------------*/ fun LISTVIEW_AddLine (lv, position, itemLine) = LISTVIEW_AddLine2 lv.LISTVIEW_Columns position itemLine; _SETcompSlideBarMax lv.LISTVIEW_SlideBarV ((_GETcompListCount lv.LISTVIEW_MasterCol.LVC_Items)-1); _PAINTcontainer lv.LISTVIEW_Container; 0 ;; /*----------------------------------------*/ /* Fonction which move the selection */ /*----------------------------------------*/ fun LISTVIEW_SetClicked (lv,line) = _SETcompListClicked lv.LISTVIEW_MasterCol.LVC_Items line; _PAINTcontainer lv.LISTVIEW_Container;; /*---------------------------------------*/ fun LISTVIEW_DelLine2 (list, line) = if list==nil then 0 else let list -> [fc nc] in ( _DELcompList fc.LVC_Items line; LISTVIEW_DelLine2 nc line );; /*----------------------------------------------*/ /* Fonction publique de suppression d'une ligne */ /*----------------------------------------------*/ fun LISTVIEW_DelLine (lv, line) = LISTVIEW_DelLine2 lv.LISTVIEW_Columns line; LISTVIEW_SetClicked lv line;; /*-------------------------------------------*/ /* Fonction publique de lecture d'une valeur */ /*-------------------------------------------*/ fun LISTVIEW_GetValue (lv, line, col) = let nth_list lv.LISTVIEW_Columns col -> lvc in _GETcompListValue lvc.LVC_Items line ;; /*------------------------------------------------*/ /* Fonction publique de modification d'une valeur */ /*------------------------------------------------*/ fun LISTVIEW_SetValue (lv, line, col, value) = let nth_list lv.LISTVIEW_Columns col -> lvc in ( _SETcompListValue lvc.LVC_Items line value; _PAINTobjNode _CONVERTcompListToObjNode lvc.LVC_Items; lvc.LVC_Items ) ;; /*----------------------------------------*/ fun LISTVIEW_Reset2 (cl) = if cl==nil then 0 else let cl -> [first next] in ( _RSTcompList first.LVC_Items; LISTVIEW_Reset2 next );; /*----------------------------------------*/ /* Fonction which delete all the lines */ /*----------------------------------------*/ fun LISTVIEW_Reset (lv) = LISTVIEW_Reset2 lv.LISTVIEW_Columns; lv;; /*------------------------------------------*/ /* Fonction qui renvoie le nombre de lignes */ /*------------------------------------------*/ fun LISTVIEW_LineCount (lv) = _GETcompListCount lv.LISTVIEW_MasterCol.LVC_Items;; /*--------------------------------------------*/ /* Fonction qui renvoie le nombre de colonnes */ /*--------------------------------------------*/ fun LISTVIEW_ColCount (lv) = sizelist lv.LISTVIEW_Columns;; /*--------------------------------------------------*/ fun LISTVIEW_Destroy2 (lc) = if lc==nil then 0 else let lc -> [fc nc] in ( _DScompList fc.LVC_Items; _DScompText fc.LVC_Title; _DScompBitmap fc.LVC_Separator; LISTVIEW_Destroy2 nc ) ;; /*--------------------------------------------------*/ /* Fonction publique de destruction de la listview */ /*--------------------------------------------------*/ fun LISTVIEW_Destroy (lv) = _DScompSlideBar lv.LISTVIEW_SlideBarV; _DScompSlideBar lv.LISTVIEW_SlideBarH; _DScompBitmap lv.LISTVIEW_DressingBmp; _DSalphaBitmap lv.LISTVIEW_SeparatorBmp; _DSalphaBitmap lv.LISTVIEW_BackBmp; _DSfont lv.LISTVIEW_LabelFont; _DSfont lv.LISTVIEW_Font; _DScompBitmap lv.LISTVIEW_Back; LISTVIEW_Destroy2 lv.LISTVIEW_Columns; _DScontainer lv.LISTVIEW_Container ;;