Print Page | Close Window

How to fit a CWnd in a Pane?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=4775
Printed Date: 05 January 2025 at 9:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to fit a CWnd in a Pane?
Posted By: HuyLe
Subject: How to fit a CWnd in a Pane?
Date Posted: 10 August 2006 at 12:40pm
Hi,
 
I have derived a class hvlOpenGLWnd  from CWnd to display OpenGL.
 
I have created a pane:
 
CXTPDockingPane* _pPane = _pPaneManager->CreatePane(HVL_ID, CRect(0, 0, 140, 600), xtpPaneDockBottom);
 
I have created a window:
 
hvlOpenGLWnd m_Wnd;
 
m_Wnd.Create (_T("STATIC"), L"Hi", WS_CHILD | WS_VISIBLE,CRect(0, 0, 140, 600), _pMainWnd, 1234);
 
and attached the window:

_pPane->Attach(&m_Wnd);

How to make the CWnd fit in the pane when I resize the pane? With the current code, changing the pane size with the mouse will not resize the window. The Window always stays 140x600.
 
Thanks,
 
HVL



Replies:
Posted By: Barto
Date Posted: 11 August 2006 at 4:08am
how about catching WM_SIZE in your hvlOpenGLWnd and adjusting the glViewport ? Worked for me..
 
void CGLWnd::OnSizeGL(int cx, int cy)
{
 // set correspondence between window and OGL viewport
 glViewport(0, 0, cx, cy);
}


Posted By: HuyLe
Date Posted: 11 August 2006 at 8:32am

Thanks, for some reason my message Map was wrong, your reply helps me to detect the problem. Especially since Microsoft debugger does not want to correlate the source code to the binary therefore I can't debug... Something I need to investigate in order to continue my development.

 
Regards,
 
Huy Le



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net