Forum > OpenGL

TOpenGLControl inside a TScrollBox, scrolling issue

(1/1)

mdeveau:
Hi, I'm trying to create an image viewer component based on a TOpenGLControl inside a TScrollBox (I need OpenGL for a stereoscopic application), and I don't know how to manage the scrollbars:
when scrolling, the TOpenGLControl seems to move in the wrong direction. Should I define a specific ScrollbarHandler procedure?

What I don't understand is: why is it working well with a TImage in a TScrollBox, and it does not with a TOpenGLControl?

Thanks for helping.

User137:
You could make vertical and horizontal scrollbars manually. Just move the graphics by scrollbar positions when drawing.

mdeveau:
Yes I did this, and it works well. Thanks for your reply!

But as I'd like to create a new component in Lazarus, which could resize dynamically depending on its container,  I thought it'd be better to use a scrollbox. Maybe I am wrong?

So, the solution would be to put a TOpenGLControl and 2 scrollbars in a TPanel?
My question is then: how to set up the layout so that the relative positions of the scrollbars and TOpenGLControl is definitive, and resizing the TPanel keeps the scrollbars at the right position?

Sorry, this may be newbie questions!

mdeveau:
OK, looks like Align and Autosize properties do the job. Solved! Thanks for puting me in the right direction.

jmpessoa:
Hi Mdeveau, can you put his findings/example here?

Thank you.

Navigation

[0] Message Index

Go to full version