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 » Bug with CExtToolControlBar Collapse All
Subject Author Date
Andrew Nanopoulos Apr 11, 2006 - 11:43 AM

If the toolbar is not docked in a frame wnd the settings change message handler should not call pFrame->DelayRecalcLayout();

Is there a simple workaround for this?


in:

void CExtToolControlBar::OnSettingChange(UINT uFlags, __EXT_MFC_SAFE_LPCTSTR lpszSection)
{
    CExtControlBar::OnSettingChange(uFlags,lpszSection);

    if( m_bPresubclassDialogMode )
    {
        _RecalcLayoutImpl();
        return;
    }

CFrameWnd* pFrame = GetParentFrame();
    ASSERT_VALID(pFrame);
    pFrame->DelayRecalcLayout();
}

Technical Support Apr 13, 2006 - 8:10 AM

This is not a bug. If the parent window is not CFrameWnd, then the m_bPresubclassDialogMode property is set to true. This is done in the CExtControlBar::PreSubclassWindow() virtual method.

Henry Van Voorhis Apr 13, 2006 - 10:24 AM

I can manually set the toolbar.m_bPresubclassDialogMode = true; but when I do that in an IE toolbat it causes the toolbar to be rendered with a grip and 3d border, also the menus go up instead of down. What am I missing?

Technical Support Apr 13, 2006 - 12:32 PM

All the bars are created using the CExtControlBar::Create() method which is declared as follows:

virtual BOOL Create(
    __EXT_MFC_SAFE_LPCTSTR lpszWindowName,
    CWnd * pParentWnd,
    UINT nID = AFX_IDW_DIALOGBAR,
    DWORD dwStyle =
        WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS
        |CBRS_TOP|CBRS_GRIPPER|CBRS_TOOLTIPS
        |CBRS_FLYBY|CBRS_SIZE_DYNAMIC
        |CBRS_HIDE_INPLACE
    );
You should create your toolbar using this method and specify the following dwStyle parameter:
    WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS
        |CBRS_ALIGN_TOP|CBRS_TOOLTIPS
        |CBRS_FLYBY|CBRS_SIZE_DYNAMIC