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
|