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 Fix CExtControlBar width? Collapse All
Subject Author Date
QAY MUIC Jan 13, 2006 - 12:21 PM

I wanto set CExtControlBar width always equal 200 in frame.that is said,user can only show or hide CExtControlBar,but can not resize or move it.I write:


class CNoResizeControlBar : public CExtControlBar
{
public:
// virtual void FloatControlBar(CPoint ptFloat,DWORD dwStyle = CBRS_ALIGN_TOP)    {  ptFloat;  dwStyle;}
 virtual void _RowResizingStart() {}
 virtual void _RowRecalcingStart() {}
     virtual void _DraggingStart(    const CPoint & point,    const CPoint & pointOffset = CPoint( 0, 0 ),    CSize sizeWaitMouseMove = CSize( 1, 1 )    ){}
};


in my code.


but i can change the width still.Has it a function like ’_columnRisizingStart()’?

Technical Support Jan 14, 2006 - 8:54 AM

We think you need to prevent any mouse actions with regard to the control bar if they are based on clicks on the non client area where resizing is performed. So, add the WindowProc() virtual method like as follows:

virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
    if( message == WM_NCHITTEST )
    {
        LRESULT lResult = CExtControlBar::WindowProc( message, wParam, lParam );
        switch( lResult )
        {
        case HTBOTTOM: 
        case HTBOTTOMLEFT: 
        case HTBOTTOMRIGHT:
        case HTTOP:
        case HTTOPLEFT:
        case HTTOPRIGHT:
            return HTCLIENT:
        }
    }
    return CExtControlBar::WindowProc( message, wParam, lParam );
}
Besides, to override the following two methods of CExtControlBar would also be enough to get what you want:
    virtual void _RowResizingStart();
    virtual void _RowRecalcingStart();
But additionally, you need to control the mouse pointer. If the empty versions of these methods are invoked in debug mode, then you overrode them correctly and you should not be able to resize your control bar.