PDA

View Full Version : GLCanvas scrollbars



10-12-2006, 12:51 PM
I'm wondering if it's possible to add proper working scrollbars to the window that contains my GLCanvas?

I've created my window with the WS_HSCROLL | WS_VSCROLL style etc, and the scrollbars show up on my window, but where do I go from here? The scrollbars don't actually do anything when you drag them.

Is there something I need to do to my canvas to get them to work?

So say if the GLcanvas is 800*600 pixels but the window itself is only 400*400, how would I get that to work?

What I want is so that when you change the size of the canvas, the scrollbars automatically change to reflect this. Kind of like when using Internet Explorer to view a large Jpeg file. As soon as it loads, the scrollbars automatically let you pan around to view it.

Sorry for my lack of knowledge, I've just started OGL in C++!

Thanx.

Relic
10-12-2006, 10:31 PM
This is not OpenGL related. You need to react on the messages which are sent by scrollbars if you interact with them and do whatever you want with the values it provides.
Check the messages and functions here:
http://msdn.microsoft.com/library/defaul.../scrollbars.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbars.asp)