Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Docking pane on CDialog.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Docking pane on CDialog.

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


Joined: 14 June 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote zak7956 Quote  Post ReplyReply Direct Link To This Post Topic: Docking pane on CDialog.
    Posted: 14 June 2005 at 9:46pm


Hi there,

I have tried to make docking pane on my dialog, but it doesn't work correctly.
When I make some pane docked/floated, the floating window does not repainted.

Following is my code:

class CMyFrameWnd : public CXTPFrameWnd
{
 public:
 CMyFrameWnd()
 
 ...
 
 protected:
 CXTPDockingPaneManager m_paneManager;
};

int CMyFrameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CXTPFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;

 ...

 m_paneManager.InstallDockingPanes( this );
 m_paneManager.SetTheme( xtpPaneThemeOffice2003 );

 CXTPDockingPane * pPane =
 m_paneManager.CreatePane( IDR_PANE_1,
         CRect( 0, 0, 200, 120 ),
         dockLeftOf );

 ...
 
 return 0;
}

LRESULT CMyFrameWnd::OnDockingPaneNotify( WPARAM wParam, LPARAM lParam )
{
 if ( wParam == XTP_DPN_SHOWWINDOW )
 {
  CXTPDockingPane * pPane = ( CXTPDockingPane * ) lParam;
  if ( !pPane->IsValid() )
  {
   if ( IDR_PANE_1 == pPane->GetID() )
   {
    // Create proper view;
   }
  }
 }
 return 0;
}

class CMyDialog : public CDialog
{
 ...
 
 protected:
 CMyFrameWnd  * m_pFrameWnd; 
 CMyView   * m_pMyView;
 
 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
 ...
 afx_msg LRESULT OnKickIdle(WPARAM wp, LPARAM lCount);
 DECLARE_MESSAGE_MAP() 
};

LRESULT CMyDialog::OnKickIdle(WPARAM wp, LPARAM lCount)
{
 SendMessageToDescendants( WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0, TRUE, TRUE );
 return 0;
}

int CMyDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 ...
 
    m_pFrameWnd = new CSEFrameWnd( & m_SEProperty );
    m_pFrameWnd->Create( strMyClass,
       _T(""),
       WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
       CRect( 0, 0, 1, 1 ),
       this );

 CCreateContext ccc;
 ccc.m_pCurrentDoc = NULL;
 ccc.m_pCurrentFrame = m_pFrameWnd;
 ccc.m_pLastView  = NULL;
 ccc.m_pNewDocTemplate = NULL;
 ccc.m_pNewViewClass = RUNTIME_CLASS( CMyView );
 m_pMyView =
  static_cast<CMyView *>( m_pFrameWnd->CreateView( & ccc ) );
 
 ... 
}

Best regards,

k.Tsumura

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: 17 June 2005 at 7:20am

Unfortunaly

SendMessageToDescendants( WM_IDLEUPDATECMDUI, (WPARAM)TRUE, 0, TRUE, TRUE );

in your OnKickIdle doesn't send WM_IDLEUPDATECMDUI to float windows.

you must send WM_IDLEUPDATECMDUI to all floating frames too.

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
zak7957 View Drop Down
Newbie
Newbie


Joined: 19 June 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote zak7957 Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2005 at 8:52pm

It works!

Thank you.

 

k.Tsumura

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