Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Initially hidden pane - how to initialize
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Initially hidden pane - how to initialize

 Post Reply Post Reply
Author
Message
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: Initially hidden pane - how to initialize
    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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.