Disable datagrid scroll bar in iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Disable datagrid scroll bar in iOS

Post by marksmithhfx » Sat Aug 29, 2020 6:19 pm

Does anyone know if you can disable/hide the datagrid scrollbar on iOS but keep the list scrolling with swipes?

I tried a combination of these 2 commands:

Code: Select all

 set the dgprop["show vscrollbar"] of group "Datagrid 1" to false
 set the dgProp["scroll when vscrollbar is hidden"] of group "DataGrid 1" to true
But while it worked fine in dev and compiled to macOS, on iOS it just disables scrolling all together. (so I guess the 2nd command was not working on iOS??)

Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Disable datagrid scroll bar in iOS

Post by richmond62 » Sat Aug 29, 2020 8:19 pm

This seems to be a problem not only for dataGrids.

For instance, if I import an image that is 330 pixels wide and group it into a group that is
100 pixels wide I can scroll the picture with a horizontal scrollbar.

A while back (well, about 9 years ago) I authored a program for my EFL school and hived off standalones from it for Linux 32-bit.

It contains a large number of images that are larger than the screen they are displayed on, and those images are all grouped as
groups (surely not?) with horizontal scrollbars. They can be scrolled by dragging with the mouse on the images themselves.

Opening that program in 9.6.1 that capability seems to have been lost.

Жалко!
Last edited by richmond62 on Sun Aug 30, 2020 7:23 am, edited 1 time in total.

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: Disable datagrid scroll bar in iOS

Post by marksmithhfx » Sat Aug 29, 2020 10:50 pm

richmond62 wrote:
Sat Aug 29, 2020 8:19 pm
This seems to be a problem not only for dataGrids.

Opening that program in 9.6.1 that capability seems to have been lost.

Жалко!
Ok, maybe I'll file a bug report and see what comes of it. It definitely does not scroll at all on iOS which doesn't sound like the correct behaviour. But then, maybe I am just missing something,

Cheers,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: Disable datagrid scroll bar in iOS

Post by marksmithhfx » Sat Sep 12, 2020 2:47 pm

marksmithhfx wrote:
Sat Aug 29, 2020 10:50 pm

Ok, maybe I'll file a bug report and see what comes of it. It definitely does not scroll at all on iOS which doesn't sound like the correct behaviour. But then, maybe I am just missing something,
Ok, I did file a bug report and it turns out that it is not just those two lines that are the culprit (they actually work fine on their own, if you put them in openCard not preOpenCard) but those two lines PLUS some DG2 commands like setting Edit Mode, Swipes and Animations on that create the problem. To be clear, the combination of the scroller commands and the DG2 commands works fine in dev and macOS but in iOS causes scrolling to be completely disabled. The investigation continues.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Disable datagrid scroll bar in iOS

Post by Mikey » Sun Sep 13, 2020 2:49 pm

mark, I know you're not a beginner, but for the sake of posterity for the next person who reads this, i'm going to break it down for a beginner.
on ios, the scroller is a separate native object that overlays the card.
if you want to read the code, in the PB, click on your DG then click on the "2".
Things that you might want to play with:
  • change line 67 from local sScrollerID to global sscrollerid. then you can more easily fiddle with the settings when the app is up on ios
  • add a button to the card that has the dg on it. add the following script to that button. This will allow you to live-test different property changes to the scroller on mobile:

    Code: Select all

    on mouseUp
       global toDo
       ask "What?" with toDo
       if it is empty then exit mouseUp
       put it into toDo
       do toDo
    end mouseUp
    
  • Once the app is up, don't forget to click on the button and type global sScrollerID so you can then manipulate the scroller with the button (because you have to declare it to be global not just in the behavior script but in the main context, too, because that's where you're going to be using it.)
  • Look in the dictionary at mobileControlSet for all the things you can do to a mobile object like a scroller, now that you can do it live in your app.
  • Try

    Code: Select all

    mobileControlSet sScrollerId, "visible",false
    I don't know, for instance, if making the scroller invisible will disable it or not. You might also try messing with the rect of the scroller (making it wider than the card, for example) so that it still scrolls but you don't see it. If you do that, you might also need to disable horizontal scrolling.
  • change the delayTouches property from false to true because it breaks scrolling, and the mothership has thus far declined to fix it despite a PR and a bug report, because they are prioritizing another change they made previously.
  • if you want to make any of those changes permanent, you can do so in the behavior script that you opened previously, because the datagrid template is attached to your stack.

    HTH

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: Disable datagrid scroll bar in iOS

Post by marksmithhfx » Thu Sep 17, 2020 5:50 pm

Mikey wrote:
Sun Sep 13, 2020 2:49 pm
[*] change the delayTouches property from false to true because it breaks scrolling, and the mothership has thus far declined to fix it despite a PR and a bug report, because they are prioritizing another change they made previously.
[*] if you want to make any of those changes permanent, you can do so in the behavior script that you opened previously, because the datagrid template is attached to your stack.

HTH
Mikey, thanks for this. These are some great suggestions. I will give it a try.

Thanks,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Disable datagrid scroll bar in iOS

Post by Mikey » Fri Sep 18, 2020 4:00 pm

Also see the discussion on the bug report

Post Reply

Return to “iOS Deployment”