Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - How to fit a CWnd in a Pane?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to fit a CWnd in a Pane?

 Post Reply Post Reply
Author
Message
HuyLe View Drop Down
Newbie
Newbie


Joined: 10 August 2006
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote HuyLe Quote  Post ReplyReply Direct Link To This Post Topic: How to fit a CWnd in a Pane?
    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
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post 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);
}
Back to Top
HuyLe View Drop Down
Newbie
Newbie


Joined: 10 August 2006
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote HuyLe Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.158 seconds.