Print Page | Close Window

Docking pane on CDialog.

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=2375
Printed Date: 15 May 2025 at 8:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Docking pane on CDialog.
Posted By: zak7956
Subject: Docking pane on CDialog.
Date 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




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


Posted By: zak7957
Date Posted: 19 June 2005 at 8:52pm

It works!

Thank you.

 

k.Tsumura




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