DataGrid2 - What do you like, what don't you like

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6173
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: DataGrid2 - What do you like, what don't you like

Post by FourthWorld » Thu Dec 28, 2017 8:30 am

quailcreek wrote:
Thu Dec 28, 2017 7:01 am
I was just thinking about the swipe grps not being found. I'll bet the swipe capability is mobile only.
Trackpads.
http://quality.livecode.com/show_bug.cgi?id=8446
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1540
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: DataGrid2 - What do you like, what don't you like

Post by MaxV » Thu Dec 28, 2017 11:49 am

No, all functions are aviable on all OSes (theoretically).
See on windows: http://quality.livecode.com/show_bug.cgi?id=20807
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Thu Dec 28, 2017 8:43 pm

MaxV,
In the the Behavior Script of the DG did you set up the workingRect? I think that's the problem. Before I figured out that I needed to set up the workingRect I had the same problem. WorkingRect was added to DG2 to take care of exactly what you're seeing.

I just tested it in the IDE and it works fine and so do swipes.

This is from the release notes.
Laying Out Rows
When positioning controls in your row behavior script, you can take into account any edit mode controls that have been overlaid onto the row by using the rows working rect. The working rect is
passed as the second parameter to the LayoutControl message that is sent to your row behavior
script.

on LayoutControl pControlRect, pWorkingRect
...
end LayoutControl
Here's how I handled it in mine:

Code: Select all

on LayoutControl pControlRect, pWorkingRect
  local theFieldRect1,theFieldRect2
  
  put the rect of field "Name" of me into theFieldRect1
  put (item 1 of pWorkingRect + 75) into item 1 of theFieldRect1
  put item 3 of pWorkingRect - 5 into item 3 of theFieldRect1
  set the rect of field "Name" of me to theFieldRect1
  
  put the rect of field "More" of me into theFieldRect2
  put (item 1 of pWorkingRect + 75) into item 1 of theFieldRect2
  put item 3 of pWorkingRect - 5 into item 3 of theFieldRect2
  set the rect of field "More" of me to theFieldRect2
  
  set the left of img "imageHolder" of me to (item 1 of pWorkingRect + 7) 
  
  set the height of fld "Name" of me to the formattedHeight of fld "Name" of me
  set the height of fld "More" of me to the formattedHeight of fld "More" of me
  set the top of fld "More" of me to (the bottom of fld "Name" of me + 6)
  
  set the rect of graphic "GrayBackground" of me to pControlRect
end LayoutControl
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Thu Dec 28, 2017 10:22 pm

Richard,
I'm doing some testing in the IDE and I get this too when doing a reorder. However, if I do a swipe first, left or right, then the reorder works. Could you please try this and let me know the result. I'm thinking the DG2 isn't pre-populating the swipe controls.
FourthWorld wrote:
Thu Dec 28, 2017 6:04 am
So now it populates, but I still can't run it - I get an error on line 22 of group "Row Template 003" - "can't find background":
if the vis of grp "DG2 Default Right Swipe Control" OR the vis of grp "DG2 Default Left Swipe Control" then
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Fri Dec 29, 2017 12:48 am

Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Fri Mar 16, 2018 3:06 am

So I installed 9.0.0 rc1 and I'm seeing a problem and wanted to check if it's just me or if anybody else is seeing the same thing.

With 9.0.0 dp 11 when an existing DG was set to Enable Swipes it was automatically updated to a DG2 and the DG2 groups where added and visible in the Project Browser. With 9.0.0 rc1 the groups are added but are not visible in the Project Browser. They do show up with a new DG. Has anybody else seen this?
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Mon Mar 19, 2018 7:55 pm

Tom
MacBook Pro OS Mojave 10.14

sphere
Posts: 700
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Mar 27, 2018 8:24 pm

Just tried to find the setting to enable swipe, where is it?

I can see in the dgprop swipe for right and left.

But you really mean that when i open a stack with a DG1 it is automatically replaced for a DG2 with swipe functions?
So then i do not have to use a piece of script to be able to activate scrolling for that group? Like with DG1 which is terrible slow...
:D :o :) :shock: 8) :lol:

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Tue Mar 27, 2018 8:39 pm

There is no enable left or right swipe. I did put in an enhancement request for that though.

The Enable Swipes switch is in the DG PI of a form DG.

There is now in v9 DP11 and rc1 the built in scroller for DGs. It's all in the release notes.

Keep in mind that scrolling and swipe are different. Scrolling is for scrolling the DG up/down and left/right.
Swipe is for exposing buttons on the left and right of a DG row in a form DG only.
Tom
MacBook Pro OS Mojave 10.14

sphere
Posts: 700
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Mar 27, 2018 9:01 pm

Thanks Quailcreek.

Ok a lot of reading about the DG news.

Maybe i need to remove the lines for mobilescroller, perhaps it works negative now when it is already in the DG2, Going to test if this will help for smoother scrolling.
This was a stack created on an lc8.x.x and then needed those lines of course. But needed lc9 for the encryption improvements.

Great!
:D :o :) :shock: 8) :lol:

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Tue Mar 27, 2018 9:05 pm

My pleasure. Do you have your DG set to scrolling or static in the advanced tab of the IP? That could help with the scrolling.
Tom
MacBook Pro OS Mojave 10.14

sphere
Posts: 700
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Mar 27, 2018 9:34 pm

Just quickly checked, it is set to static.
So scrolling it will be then i guess.

As my RingyDingy will go (always to) early, i'm going sleepy now :)

Thanks, will test it out tomorrow.
:D :o :) :shock: 8) :lol:

sphere
Posts: 700
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Fri Mar 30, 2018 10:12 am

Can't test, having problems with ADB, not recoqnizing my phone. Had problems with testing anyway then it worked and then it did'nt. Mostly had to push 3 times the TEST button before it worked. Several errors. I hate win10malware windows, where is my win7 ???
Already uninstalled and reinstalled those driver but still issues. Will report back when it's working again.
:D :o :) :shock: 8) :lol:

sphere
Posts: 700
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Sat Mar 31, 2018 2:12 pm

So finally it seems to work again, what a hell that adb under win10.

I still get sveral error messages. Even INSTALL-FAILED-UPDATE_INCOMPATIBLE ??? it's the exact same stack.

So after a few times pushing it, then it works.

Well scrolling is not working at all, no matter the setting static, dynamic or scrolling.
So for now i leave my scrolling script/handler in place although it works terrible slow.
:D :o :) :shock: 8) :lol:

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Sat Mar 31, 2018 11:02 pm

Here's the scroller script I use. Always scrolls smoothly.
I set sTheDataGridName to the name of the DG in the preOpenCard handler.

Code: Select all

command createTheScroller
   local sScrollerID, theWidth, theHeight
   
   if environment() is not "mobile" then exit createTheScroller
   
   if "theDataGrid" is not among the lines of mobileControls() then
      mobileControlCreate "scroller", "theDataGrid"
      put the result into sScrollerID
   end if
   mobileControlSet sScrollerID, "rect", (the rect of grp sTheDataGridName)
   
   put the dgFormattedWidth of grp sTheDataGridName into theWidth
   put the dgFormattedHeight of grp sTheDataGridName into theHeight
   
   mobileControlSet sScrollerID, "hscroll", 0
   mobileControlSet sScrollerID, "vscroll", 0
   mobileControlSet sScrollerID, "contentRect", (0,0,theWidth,theHeight)
   mobileControlSet sScrollerID, "visible", "true"
   mobileControlSet sScrollerID, "canBounce", "false"
   mobileControlSet sScrollerID, "pagingEnabled", "false"
   mobileControlSet sScrollerID, "canScrollToTop", "true"
   mobileControlSet sScrollerID, "delayTouches", "true"
   mobileControlSet sScrollerID, "canCancelTouches", "false"
   mobileControlSet sScrollerID, "declerationRate", "normal"
   mobileControlSet sScrollerID, "lockDirection", "true"
   mobileControlSet sScrollerID, "scrollingEnabled", "true"
   
   mobileControlSet sScrollerID, "hIndicator", "false"
   mobileControlSet sScrollerID, "vIndicator", "false"
   
   --   set the dgvScroll of grp tScrollerGroup to 0
end createTheScroller

on scrollerBeginDrag
   set the dgHilitedLine of grp sTheDataGridName to empty
   -- mobileControlSet sScrollerId, "delayTouches", true
end scrollerBeginDrag

on scrollerEndDrag
   set the dgHilitedLine of grp sTheDataGridName to empty
   -- mobileControlSet sScrollerId, "delayTouches", false
end scrollerEndDrag

on scrollerDidScroll OffsetX, OffsetY
   set the dgvScroll of grp sTheDataGridName to OffsetY
   set the dgHScroll of grp sTheDataGridName to OffsetX
end scrollerDidScroll
Tom
MacBook Pro OS Mojave 10.14

Post Reply

Return to “Talking LiveCode”