Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Views in Docking Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Views in Docking Panes

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


Joined: 08 July 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote c_koerber Quote  Post ReplyReply Direct Link To This Post Topic: Views in Docking Panes
    Posted: 14 July 2003 at 6:33am

Oleg wrote in another thread:

"the better to use CFormView instead CDialog...."

So it is possible to embed CView derived Objects into docking panes?

That would be very good news.

Oleg, is it possible to write a little how to or to point out the biggest issues one has to keep in mind?

Would be GREAT!

 

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2003 at 6:35am

1. Create Dialog template and CFormView derived class - CSimpleFormView.

2. Create New Pane

 m_paneManager.InstallDockingPanes(this);

 CXTPDockingPane* pPaneProperties = m_paneManager.CreatePane(
  PANEID_FORMVIEW, CRect(0, 0,210, 120), dockLeftOf); 

3. Attach it.

 

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_SHOWWINDOW)
 {
  CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;

  if (!pPane->IsValid())
  {
   if (m_pFormFrame == NULL)
   {       
    m_pFormFrame = new CFrameWnd;
    
    CCreateContext context;
    context.m_pNewViewClass = RUNTIME_CLASS(CSimpleFormView);
    context.m_pCurrentDoc = NULL;
    
    m_pFormFrame->Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &context);
    m_pFormFrame->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
    m_pFormFrame->SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);
   }

   pPane->Attach(m_pFormFrame);
  }
 
  return TRUE;
 }
 return FALSE;
}

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.203 seconds.