Firemonkey ScrollBox Bug
Asked Answered
S

1

38

We are experiencing what seems to be a strange bug in Firemonkey's ScrollBox component (since TGrid inherits from TScrollBox it also affects all grids). On some ouf our development machines, everything works fine, while on others the bug occurs. We failed to detect any pattern between the systems (we checked OS, graphics hardware, DirectX version).

Reproduction:

  1. Create a new FireMonkey application. Place a TScrollBox on the form.
  2. Add a button to the scrollBox and set its vertical position to 500000.
  3. Start the application and check if the button is displayed when you scroll to the end of the scrollbox.

If the bug occurs, the button is not visible.

When using a grid, this leads to lines 1-19047 being displayed correctly and all lines from 19047 and above not displayed.

Has anybody any idea what could be causing this? Or any idea how we can identify the problem in more detail?

Schoolhouse answered 20/9, 2011 at 13:46 Comment(6)
By the way... Line 19047 is not displayed correctly in the TGrid Component. It is only visible partially.Damnation
At some systems I get an invalid floating point operation exception, when trying to use the scrollbar.Damnation
its working fine on my 32bit windows xpWarily
it also works fine on xp 64bit and Mac OS X. it seems to be a vista and win 7 problem. currently there's only one (win7) system, where it works correctly - but even on a second system with same graphic card, same direct x setup it does not work. this is really weired.Damnation
Have you submitted this as a bug to QC? If so, can you give me the QC number for it please?Mnemonic
@LaKraven: No I have not submitted this yet. I should have, but had no time. Feel free to add it to QC if you want.Schoolhouse
D
2

After having all sorts of problems with scrolling, I have come to the conclusion that there is an initialisation problem with scrolling components in firemonkey, which manifest in dodgy scrolling behaviour. Sometimes it will work and sometimes it will not...

After having thought that I fixed the problem several times, only to watch the problem reappear on a subsequent compile (or a different OS), I have had much success in calling the component's UpdateStyle method after adding all of the child components. I.e. the problem has not resurfaced since adding the call...

E.g. The following pseudo code populates a scroll component then calls UpdateStyle which seems to force the component to 'fix' invalid settings for various properties - Min, Max etc.

for i := 1 to x do
  MyScrollComponent.AddObject(MyObject[i]);
MyScrollComponent.UpdateStyle;

Hope this works for you too...

Donahoe answered 24/11, 2011 at 2:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.