Recent

Author Topic: TOpenGLControl inside a TScrollBox, scrolling issue  (Read 5040 times)

mdeveau

  • Newbie
  • Posts: 6
TOpenGLControl inside a TScrollBox, scrolling issue
« on: February 08, 2013, 01:33:28 pm »
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.
« Last Edit: February 08, 2013, 01:59:19 pm by mdeveau »

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: TOpenGLControl inside a TScrollBox, scrolling issue
« Reply #1 on: February 08, 2013, 02:19:11 pm »
You could make vertical and horizontal scrollbars manually. Just move the graphics by scrollbar positions when drawing.

mdeveau

  • Newbie
  • Posts: 6
Re: TOpenGLControl inside a TScrollBox, scrolling issue
« Reply #2 on: February 08, 2013, 02:50:18 pm »
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!
« Last Edit: February 08, 2013, 03:03:50 pm by mdeveau »

mdeveau

  • Newbie
  • Posts: 6
Re: TOpenGLControl inside a TScrollBox, scrolling issue
« Reply #3 on: February 08, 2013, 04:10:59 pm »
OK, looks like Align and Autosize properties do the job. Solved! Thanks for puting me in the right direction.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: TOpenGLControl inside a TScrollBox, scrolling issue
« Reply #4 on: February 08, 2013, 06:39:17 pm »
Hi Mdeveau, can you put his findings/example here?

Thank you.
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018