Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Docking Window Position Collapse All
Subject Author Date
Douglas Hoppes Jun 28, 2011 - 12:28 PM

Is there a way to know where a docking window is docked? I need to know whether it’s docked on the left, right, top or bottom (or floating).

Doug

Technical Support Jun 29, 2011 - 4:43 AM

Please use the dialog control identifiers of control bar’s parent window:

CExtControlBar * pBar = . . .
ASSERT_VALID( pBar );
ASSERT( pBar->GetSafeHwnd() != NULL );
CWnd * pWnd = pBar->GetParent();
UINT nID = pWnd->GetDlgCtrlID();
switch( nID )
{
case AFX_IDW_DOCKBAR_TOP:
. . .
break;
case AFX_IDW_DOCKBAR_BOTTOM:
. . .
break;
case AFX_IDW_DOCKBAR_LEFT:
. . .
break;
case AFX_IDW_DOCKBAR_RIGHT:
. . .
break;
case AFX_IDW_DOCKBAR_FLOAT:
. . .
break;
}

Technical Support Jun 29, 2011 - 4:23 AM

You can use the CExtControlBar::IsFloating() method. It returns true flag if control bar is floating and it’s the only bar in its floating palette window. So, the CExtControlBar::IsFloating() method is good to check floating status of toolbar or menubar. If you need to check whether control bar is inside floating palette window or not (including complex floating layouts of resizable bars), then you should use this code:

CExtControlBar * pBar = . . .
ASSERT_VALID( pBar );
ASSERT( pBar->GetSafeHwnd() != NULL );
CFrameWnd * pParentFrame = pBar->GetParentFrame();
ASSERT_VALID( pParentFrame );
bool bFloating =  ( pParentFrame->IsKindOf( RUNTIME_CLASS(CMiniFrameWnd) ) ) ? true : false;




Douglas Hoppes Jun 29, 2011 - 4:27 AM

Thanks for the response.... What about knowing where it is docked? Left, right, top or bottom?

In my case, I have some controls that I would like to set the position depending on where the window is docked.