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 » How to disable re-sizing and re-docking of CExtControlBar? Collapse All
Subject Author Date
Kenan Hrustanovic Feb 21, 2005 - 7:50 AM

Hello,


how can I disable user resizing and redocking of an CExtControlBar?


For example, I use the CExtControlBar as container for an AVI-Screen that should not be resized and redocked by user at run time, but at the start of my SDI application should be just once docked on the top of my MainFrame window.



Sorry for bad english! :)

Technical Support Feb 21, 2005 - 12:07 PM

Dear Kenan,

You can disable resizing and redocking of the resizable control bar and it’s not difficult. Here is the source code for the control bar that you can use use as a container for your AVI view:

class CMyControlBar : public CExtControlBar
{
    // do not perform any resizing
    virtual void _RowRecalcingStart(){}
    virtual void _RowResizingStart(){}
    // do not float control bar on
    // mouse double clicks
    virtual void FloatControlBar(
        CPoint ptFloat,
        DWORD dwStyle = CBRS_ALIGN_TOP
        )
    {
        ptFloat;
        dwStyle;
    }
    // do not use resizing non-client
    // cursor pointers
    virtual void _SetCursor(
        const CPoint & point
        )
    {
        point;
        ::SetCursor(
            ::GetClassLong(
                m_hWnd,
                GCL_HCURSOR
                )
            );
    }
};
Besides, if you don’t need the caption area in this control bar, create it with:
VERIFY(
    m_wndResizableBarH.Create(
        NULL,
        this,
        ID_VIEW_RESIZABLE_BAR_H,
        WS_CHILD|WS_VISIBLE|CBRS_TOP
        |CBRS_FLYBY|CBRS_SIZE_DYNAMIC
        )
    );

Please contact us if you encounter any difficulties.