Antwort auf: Scroller für Datagrid erstellen

Startseite Foren Deutsches LiveCode-Forum Scroller für Datagrid erstellen Antwort auf: Scroller für Datagrid erstellen

#2109
mario
Teilnehmer

    sry – das war das falsche Skript in der Zwischenablage 🙁

    on openCard
       scroller_create
    end openCard
    
    on closeCard
       scroller_delete
    end closeCard
    
    on scroller_create
       local tScrollerRect, tContentRect
       set the vScroll of grp "listA" to 0
       ##Only create a scroller on a mobile device
       if the environment is not "mobile" then exit scroller_create
       ##Set the area of the scroller
       put the rect of group "dgRouten" into tScrollerRect
       ##Set the area of the content to be scrolled
       put 0,0,(the dgFormattedWidth of group "dgRouten"),(the dgFormattedHeight of group "dgRouten") into tContentRect
       ##Create the scroller control
       mobileControlCreate "scroller", "listScroll"
       put the result into sScrollerID
       ##Set the properties of the scroller
       mobileControlSet "listScroll", "rect",tScrollerRect
       mobileControlSet "listScroll", "contentRect",tContentRect
       mobileControlSet "listScroll", "visible",true
       mobileControlSet "listScroll", "scrollingEnabled",true
       mobileControlSet "listScroll", "vIndicator",true
       mobileControlSet "listScroll", "vscroll", 0
    end scroller_create
    
    on scroller_delete
       if the environment is not "mobile" then exit scroller_delete
       mobileControlDelete sScrollerID
    end scroller_delete
    
    on scrollerDidScroll pHScroll, pVScroll
       set the DGvScroll of group "dgRouten" to pVScroll
       set the DGSelectedLine of group "dgRouten" to empty
    end scrollerDidScroll
    
    on mouseRelease
       set the dgHilitedLines of group "dgRouten" to empty
    end mouseRelease