Print Page | Close Window

Initially hidden pane - how to initialize

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=1638
Printed Date: 29 March 2024 at 9:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Initially hidden pane - how to initialize
Posted By: dennisV
Subject: Initially hidden pane - how to initialize
Date Posted: 09 January 2005 at 6:53am

I have a question - when the docking pane is initially minimized (due to its state being loaded from the registry in this way), then the following code does not work:

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
   if (wParam == XTP_DPN_SHOWWINDOW)
   {
     CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
     if (!pPane->IsValid())
     {
  if (!m_wndPane.m_hWnd)
  {
   m_wndPane.CreateEx(WS_EX_STATICEDGE, _T("EDIT"), _T(""), WS_CHILD|ES_AUTOVSCROLL|ES_MULTILINE, CRect(0, 0,200, 120), this, 0);
  }
  pPane->Attach(&m_wndPane);
     }
     return TRUE;
   }
 return FALSE;
}

So, in that case I've added some code before that and it became something like:

if(XTP_DPN_SHOWWINDOW==wParam)
{
  CXTPDockingPane *pPane=(CXTPDockingPane*)lParam;
  if(!pPane->IsValid())
  {
  switch(pPane->GetID())
  {
    case IDR_PANE:
    {
      if(!pMyPane)
      {
        pMyPane=static_cast<CDockPaneWnd<CMyPane>*>(pPan e->AttachView(this,RUNTIME_CLASS(CMyPane)));
        pPane->SetOptions(xtpPaneNoCloseable);
      }
    }
    break;
  }
}

This seems to work (so, both cases are covered), but first of all it seems a lot of unnecessary code, and secondly the WM_INITIALUPDATE message doesn't go through sometimes for some reason...

Is there a better way to accomplish the creation of views inside docking panes that might not be initially visible?

Thank you.



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



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