Print Page | Close Window

Views in Docking Panes

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=98
Printed Date: 19 April 2024 at 1:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Views in Docking Panes
Posted By: c_koerber
Subject: Views in Docking Panes
Date 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!

 

 




Replies:
Posted By: Oleg
Date 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;
}




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