Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Weird docking pane creation problem?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Weird docking pane creation problem?

 Post Reply Post Reply
Author
Message
hakoar View Drop Down
Groupie
Groupie
Avatar

Joined: 06 August 2008
Location: Finland
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote hakoar Quote  Post ReplyReply Direct Link To This Post Topic: Weird docking pane creation problem?
    Posted: 24 February 2010 at 1:48am
I have a following object "construct" tree in my app:

CMainframe
    |
    ->CView
        |
        ->CXTPTabControl
            |
            ->CXTResizeFormView (several, each one in it's own tab)

I try to create panes inside the CXTResizeFormView objects but so far no luck?
How should I do this to make it work? I'm a newbie with panes and basically what I have tried is copied from one sample.

Here's what I have added to the class header:
---
class CServersView : public CXTResizeFormView
{
public:
    CXTPDockingPaneManager m_paneManager;
    dlgAddServer paneFilterServer;
   afx_msg LRESULT OnDockingPaneNotify(WPARAM wParam, LPARAM lParam);
protected:
    virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
---

And in the class source I have following trying to create a "dialog" inside the pane:
---
void CServersView::OnInitialUpdate()
{
    CXTResizeFormView::OnInitialUpdate();

    VERIFY(m_paneManager.InstallDockingPanes(this));
    m_paneManager.SetTheme(xtpPaneThemeVisualStudio2010);
    m_paneManager.SetShowContentsWhileDragging(TRUE);
    m_paneManager.SetAlphaDockingContext(TRUE);

    CXTPDockingPane* pwndPaneFilter = m_paneManager.CreatePane(IDR_PANE_SERVER_FILTER, CRect(0, 0, 200, 120), xtpPaneDockLeft);
    pwndPaneFilter->SetTitle(_T("Empty Pane"));
}

LRESULT CServersView::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
    if(wParam == XTP_DPN_SHOWWINDOW)
    {
        CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
        if(!pPane->IsValid())
        {
            switch(pPane->GetID())
            {
            case IDR_PANE_SERVER_FILTER:
                if(!::IsWindow(paneFilterServer.m_hWnd))
                {
                    paneFilterServer.Create(IDD_DIALOG_ADD_SERVER, this);
                }
                break;
            }
            pPane->Attach(&paneFilterServer);
        }
        return TRUE;
    }
    return FALSE;
}
---

What I have missed here?

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