Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Limiting where panes can dock
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Limiting where panes can dock

 Post Reply Post Reply
Author
Message
Robin Imrie View Drop Down
Newbie
Newbie
Avatar

Joined: 23 January 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Robin Imrie Quote  Post ReplyReply Direct Link To This Post Topic: Limiting where panes can dock
    Posted: 16 September 2009 at 5:35am
Hi,

My SDi application has one dockable pane. I only it to be possible to dock this pane on the left or the right hand side of the window.

How would I do this?

Thanks

Robin
Product: xtreme Toolkit Pro V13.1.0
Platform: Windows XP SP3
Language: VC++ 2008
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2009 at 1:25pm
Try this:

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wp, LPARAM lp)
{
    if (wp==XTP_DPN_ACTION)
    {
        XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lp;
        if (pAction->pPane->GetID()==IDR_TIMESCALE && pAction->action==xtpPaneActionDocking)
        {
            if (!pAction->pPane->IsHidden() && pAction->dockDirection!=xtpPaneDockTop && pAction->dockDirection!=xtpPaneDockBottom)
               pAction->bCancel=TRUE;
            else
               pAction->bCancel=FALSE;
            return 1;
        }
    }
    return 0;
}

This restricts docking to top or bottom of frame.
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
Robin Imrie View Drop Down
Newbie
Newbie
Avatar

Joined: 23 January 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Robin Imrie Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2009 at 7:06am
Tried that and found that I could only dock to top or bottom, changed code to...

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wp, LPARAM lp)
{
    if (wp==XTP_DPN_ACTION)
    {
        XTP_DOCKINGPANE_ACTION* pAction = (XTP_DOCKINGPANE_ACTION*)lp;
        if (pAction->pPane->GetID()==IDR_TIMESCALE && pAction->action==xtpPaneActionDocking)
        {
            if (!pAction->pPane->IsHidden() && pAction->dockDirection!=xtpPaneDockTop && pAction->dockDirection!=xtpPaneDockBottom)
               pAction->bCancel=FALSE;
            else
               pAction->bCancel=TRUE;
            return 1;
        }
    }
    return 0;
}



Product: xtreme Toolkit Pro V13.1.0
Platform: Windows XP SP3
Language: VC++ 2008
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.156 seconds.