Print Page | Close Window

Only allow docking on one side

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=10797
Printed Date: 26 April 2024 at 2:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Only allow docking on one side
Posted By: ziracote
Subject: Only allow docking on one side
Date Posted: 27 May 2008 at 8:57am
Is there a property to only allow a window to dock on one side?



Replies:
Posted By: Oleg
Date 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


Posted By: chionatech
Date 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.



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