Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Only allow docking on one side
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Only allow docking on one side

 Post Reply Post Reply
Author
Message
ziracote View Drop Down
Newbie
Newbie


Joined: 31 October 2006
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziracote Quote  Post ReplyReply Direct Link To This Post Topic: Only allow docking on one side
    Posted: 27 May 2008 at 8:57am
Is there a property to only allow a window to dock on one side?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 12:30pm
Hi,
 
Add this code
 
Private Sub DockingPaneManager_Action(ByVal Action As XtremeDockingPane.DockingPaneAction, ByVal Pane As XtremeDockingPane.IPane, ByVal Container As XtremeDockingPane.IPaneActionContainer, Cancel As Boolean)
On Error Resume Next
    If (Action = PaneActionDocking) Then
        If (Container.Container.Type <> PaneTypeTabbedContainer) And _
        (Container.Direction = DockTopOf Or Container.Direction = DockBottomOf Or Container.Direction = DockRightOf) Then
            Cancel = True
        End If
    End If
End Sub
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chionatech View Drop Down
Newbie
Newbie
Avatar

Joined: 27 August 2013
Location: Houston, TX
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote chionatech Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2013 at 9:27pm
A very late reply, but just had to do this myself.
 
For a working example, get the Docking Pane sample MDIPanes, and edit the OnDockingPaneNotify to have the following code:
 
LRESULT CChildFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
 if (wParam == XTP_DPN_ACTION)
 {
  XTP_DOCKINGPANE_ACTION *pAction = (XTP_DOCKINGPANE_ACTION *)lParam;
  if ( pAction->action == xtpPaneActionDocking )
  {
   // restrict to docking only left and right
   XTPDockingPaneDirection eDir = pAction->dockDirection;
   if ( eDir == xtpPaneDockTop || eDir == xtpPaneDockBottom )
    pAction->bCancel = true;
  }
 }
 return FALSE;
}
When you run the sample, you'll notice that you can no longer dock top or bottom and the docking highlights don't even show up.
It's not the dumb question that bothers me. It's the dumb mistake made because a dumb question wasn't asked.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.