15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


MFC 4.1 - How to determine which side to

kostr -- kostr@micrografx.com
Saturday, October 12, 1996


Environment:  VC 4.1, Win95

I am using a CControlBar derived toolbar.  I need to know which side the   
toolbar is docked to so I can restore it properly.  I cannot use the   
CDockState functions because this toolbar may come up many times during   
the same session and I do not want to redock ALL of the toolbars that are   
up, just one particular toolbar.

any help would be appreciated.

I have looked at CControlBar::GetBarStyle(), however, that returns the   
styles that were set at construction, and does not indicate current   
docking info.

Ken Ostrin  




Kostya Sebov -- sebov@is.kiev.ua
Saturday, October 19, 1996

>
>   Environment:  VC 4.1, Win95
>
>   I am using a CControlBar derived toolbar.  I need to know which side the
>   toolbar is docked to so I can restore it properly.  I cannot use the
>   CDockState functions because this toolbar may come up many times during
>   the same session and I do not want to redock ALL of the toolbars that are
>   up, just one particular toolbar.
>
>   any help would be appreciated.
>
>   I have looked at CControlBar::GetBarStyle(), however, that returns the
>   styles that were set at construction, and does not indicate current
>   docking info.
>
>   Ken Ostrin
>
>
Just an idea:

Try:

CDockBar* pDock = pYourToolBar->m_pDockBar;
if( pDock )
{
    switch( pDock->GetDlgCtrlId())
    {
        case AFX_IDW_DOCKBAR_LEFT:
        /*...*/

        case AFX_IDW_DOCKBAR_RIGHT:
        /* and so on: TOP & BOTTOM. */

        default:
            ASSERT( FALSE );
    }
}
else
    TRACE("CMyToolBar is not docked\n");


The names may be spelled a bit incorrectly (sorry, writing from memory).

Probably, m_pDockBar is not the window having the ID to check but it's definitelly
the place to tart the search.

HTH

--- 
Kostya Sebov. 
----------------------------------------------------------------------------
Tel: (38 044) 266-6387 | Fax: (38 044) 266-6195 | E-mail: sebov@is.kiev.ua




| Вернуться в корень Архива |