Print Page | Close Window

Weird docking pane creation problem?

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=16260
Printed Date: 12 May 2024 at 2:45am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Weird docking pane creation problem?
Posted By: hakoar
Subject: Weird docking pane creation problem?
Date 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?




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