Anything better than scroll method? [ACTUALLY BUG IN EXAMPLE PROJECT - FIXED]

The scroll method on a canvas really sucks! It is very broken. What would be the best way to workaround this?

Thanks

The Canvas has no scroll method…
And I propose that “sucks” is more due to a lack of understanding…

What exactly are you attempting to do?

Yes it does and always had (though with clipping issues with controls)

See:
http://documentation.xojo.com/index.php/Canvas.Scroll

Well in that case perhaps it does suck.

[quote=79396:@Karen Atkocius]Yes it does and always had (though with clipping issues with controls)

See:
http://documentation.xojo.com/index.php/Canvas.Scroll[/quote]
I don’t actually know what ‘clipping’ means but does that mean it flickers? Because that is not my problem with it. The positioning of controls is incorrect and I spent ages trying to fix a bug which I found was in the framework after comparing mine to the example project.

Thanks

What problem are you having?

You will see the problem I am having if you perform the following steps:

  1. Open the DownloadContainer example that is built into Xojo in Desktop > ContainerControls
  2. Run the project
  3. Click ‘Download File’ several times
  4. Scroll down the Downloads
  5. Click ‘Download File’ several times again

Where are the controls?

I have thought that maybe I could set the scroll value to 0 before adding controls and then scrolling back down. I don’t know why I did not think of this. But you will see what I mean and I am using the ContainerControls for a specific purpose and it is required that the user scrolls down because the number of containercontrols stacked varies while input is gathered from controls that are actually inside the containercontrol stack.

Thanks

Setting the scroll value to 0 before embedding controls, solves things.

I store the scroll value in a variable, then add the controls then scroll using the scroll value stored in that variable and it seems to stop the problem I have demonstrated but it causes another problem because the scrollvalue does not go back to normal.

The coordinates don’t account for any scrolling. I mean, if you scroll 200 pixels up and want to add a control at the very top of view you’d use a Y of 0, not 200. Basically subtract the scrolled amount from your calculated real position to place it correctly, no need to go to 0 and back.

The example project is getting this wrong. Fix it by subtracting the scrolled amount in DownloadWindow.AddDownload()

 dl.EmbedWithin(DownloadScrollView, 0, offset - DownloadScroller.Value)

[quote=79479:@Will Shank]The coordinates don’t account for any scrolling. I mean, if you scroll 200 pixels up and want to add a control at the very top of view you’d use a Y of 0, not 200. Basically subtract the scrolled amount from your calculated real position to place it correctly, no need to go to 0 and back.

The example project is getting this wrong. Fix it by subtracting the scrolled amount in DownloadWindow.AddDownload()

 dl.EmbedWithin(DownloadScrollView, 0, offset - DownloadScroller.Value)

Thanks. It was the Xojo framework I had doubt in and not the code that was written for the webinar. Thanks, will try this.

[quote=79479:@Will Shank]The coordinates don’t account for any scrolling. I mean, if you scroll 200 pixels up and want to add a control at the very top of view you’d use a Y of 0, not 200. Basically subtract the scrolled amount from your calculated real position to place it correctly, no need to go to 0 and back.

The example project is getting this wrong. Fix it by subtracting the scrolled amount in DownloadWindow.AddDownload()

 dl.EmbedWithin(DownloadScrollView, 0, offset - DownloadScroller.Value)

Wow, well spotted. Thanks

I’ll make this tweak to the DownloadContainer example included with Xojo for 2014r2.

Thanks. Keep up the good work!