Page 1 of 1

DataGrid Scroller

Posted: Tue Nov 24, 2015 12:22 pm
by Daveinthebigcity
Hi Everyone!
I've added a data grid to my app with a native scroller (using code from one of the other forum help posts).
The scrolling function works absolutely perfectly. The only problem is that I'm unable to select anything from the grid UNTIL I've scrolled first.
The data grid is checking for the scrollerDidScroll and not for the on mouseUp event. How can I get it to check for both events so that the user can either scroll down the list or simply select the first item they want to open?
Thanks in advance.

Code: Select all


on openCard
create_scroller
end openCard

on mouseUp
//Do something//
end mouseUp

on closecard
   delete_scroller
end closecard

command create_scroller   
   put "DataGrid1" into tScrollerGroup
   
   if the environment <> "mobile" then
      exit create_scroller
   end if
   
   // Create native scroller object and save its ID in a local variable
   MobileControlCreate "scroller", DataGrid1
   put the result into sScrollerId
   
   // RECT is the area on the card where the SCOLLER should do its work
   MobileControlSet sScrollerId, "rect", (the rect of grp tScrollerGroup)
   
   put the width of grp tScrollerGroup into tWidth
   put the dgFormattedheight of grp tScrollerGroup into tHeight
   set the dgvScroll of grp tScrollerGroup to 0

   // WHAT part fo the datagrid shall be scrolled-> the complete datagrid
   MobileControlSet sScrollerId, "contentRect", (0,0,tWidth,tHeight)
   
   // Display SCROLLER
   MobileControlSet sScrollerId, "visible", "true"
   
   // the typical BUMP effect when you ge to the edge of the object
   mobileControlSet sScrollerId, "canBounce", "true"
   mobileControlSet sScrollerId, "pagingEnabled", "false"
   mobileControlSet sScrollerId, "canScrollToTop", "true"
   mobileControlSet sScrollerId, "delayTouches", "true"
   mobileControlSet sScrollerId, "canCancelTouches", "false"
end create_scroller


// Will be sent when the user actually SCROLLs with his finger
on scrollerDidScroll OffsetX, OffsetY
   lock screen
   set the dgvScroll of group "DataGrid1" to OffsetY
unlock screen
end scrollerDidScroll

// REMOVE natove object when card closes!!!!!
command delete_scroller
   if the environment <> "mobile" then
          exit delete_scroller
   end if
     MobileControlDelete sScrollerId   
end delete_scroller


Re: DataGrid Scroller

Posted: Tue Nov 24, 2015 6:12 pm
by quailcreek
Hi Dave,
What version of LC are you running. This was fixed in LC LiveCode Indy 7.1.1 (rc 3) and LC LiveCode Indy 8.0 (dp 9)

Here's the bug report.
http://quality.livecode.com/show_bug.cgi?id=16239

Re: DataGrid Scroller

Posted: Tue Nov 24, 2015 6:19 pm
by Daveinthebigcity
Hi,
Thanks for the reply. I ran an update and it said that I had the latest version. Clearly I don't as I've just checked and I'm on 7.0. I will update.
That is a big help!

Thanks very much.
Dave

Re: DataGrid Scroller

Posted: Tue Nov 24, 2015 6:24 pm
by Daveinthebigcity
Actually, on that subject. Do you have a direct link to the latest version? I keep trying to download it but the website is taking me in loops, and the software is still telling me that I'm up to date.
Thanks
Dave

Re: DataGrid Scroller

Posted: Tue Nov 24, 2015 6:25 pm
by quailcreek
Here's where you can download LC.

http://downloads.livecode.com/livecode/

Re: DataGrid Scroller

Posted: Fri Dec 04, 2015 3:09 pm
by rmuzzini
quailcreek wrote:Hi Dave,
What version of LC are you running. This was fixed in LC LiveCode Indy 7.1.1 (rc 3) and LC LiveCode Indy 8.0 (dp 9)

Here's the bug report.
http://quality.livecode.com/show_bug.cgi?id=16239
actually, it was NOT fixed.
using LC 7.1.1 Indy rc4 (or 7.1.1 rc3, for not to speak about LC 7.0.6) this bug is still there, gathered together with the other thousands still open.

Re: DataGrid Scroller

Posted: Fri Dec 04, 2015 6:56 pm
by quailcreek
You are correct. I was fixed in LC 8 and it has always worked in LC 6