Antwort auf: Scroller für Datagrid erstellen

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

#2107
mario
Teilnehmer

    Hallo Klaus,

    danke für die schnelle Antwort. Ich habe jetzt dieses Skrip erstellt/aus dem Internet übernommen, aber es tut sich gar nichts…

    /*on openCard
       
       local tScrollerRect, tContentRect
       
       // Only create a scroller on a mobile device
       if environment() is not "mobile" then exit openCard
       
       // 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 formattedWidth of group "dgRouten"),(the formattedHeight of group "dgRouten") into tContentRect
       
       // Create the scroller control
       mobileControlCreate "scroller", "loremScroll"
       put the result into sScrollerID
       
       // Set the properties of the scroller
       mobileControlSet "loremScroll", "rect", tScrollerRect
       mobileControlSet "loremScroll", "contentRect", tContentRect
       mobileControlSet "loremScroll", "visible", true
       mobileControlSet "loremScroll", "scrollingEnabled", true
       mobileControlSet "loremScroll", "vIndicator", true
       mobileControlSet "loremScroll", "vscroll", 0
       
    end openCard
    
    on closeCard
       // Delete the scroller
       if environment() is not "mobile" then exit closeCard
       mobileControlDelete sScrollerID
     end closeCard
    
    on scrollerDidScroll pHScroll, pVScroll
       // When the user scrolls move the displayed content
       set the DGvScroll of group "dgRouten" to pVScroll
    end scrollerDidScroll*/
    
    ########################
    
    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
    

    Für mich scheint es, als ob der Scroller gar nicht erst erstellt wird…

    Danke für eure Hilfe!

    Liebe Grüße
    Mario