CDialogBar Window Cannot Be Resized While Floating - Programmer

This is a discussion on CDialogBar Window Cannot Be Resized While Floating - Programmer ; I have a CDialogBar window that docks on the edges of the Main Frame just as it is supposed to. But I can resize it only when it is docked and not when it floats. I noticed that when it ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: CDialogBar Window Cannot Be Resized While Floating

  1. CDialogBar Window Cannot Be Resized While Floating

    I have a CDialogBar window that docks on the edges of the Main Frame just as
    it is supposed to. But I can resize it only when it is docked and not when
    it floats. I noticed that when it floats the CDialogBar window does not
    move with the Main Frame. In fact I can move the Main Frame completely out
    from under this CDialogBar window making it to appear to be in the desktop.
    My guess is when the CDialogBar window is floating its parent and owner
    becomes the desk top instead the Main Frame window. This would mean the Main
    Frame does not get its messages including those that would resize the
    CDialogBar window.

    I looked for an event that would detect when the CDialogBar window
    transitions from docked to floating so I could execute SetParent() on that
    event. I did not find a message that triggered on it. I tried using
    IsFloating() to branch to a SetParent() statement in an OnMove() handler. It
    did not work because IsFloating() returned the state the CDialogBar window
    was in when the move started, not when it ended. When trasitioning from
    docked to floating it retuned false. When transitioning from floating to
    docked it returned true. The code was not workable because a resize or move
    while docked also triggers the OnMove() event where IsFloat() always returns
    false as expected. OnMoving() did not trigger at all.

    Why doesn't the CDialogBar window become the child of the Main Window when
    it transtions to a floating state? How can a change to a floating state be
    triggered on so SetParent() can be used to make the Main Window the parent?

    The On Move event handler:

    void CProjectView::OnMove(int x, int y)
    {
    CInitDialogBar::OnMove(x, y);
    BOOL b = IsFloating();
    if( IsFloating() )
    { SetParent( AfxGetMainWnd() );
    }
    }

    The class CInitDialogBar that CProjectView is instantiated from has as its
    parent CDialogBar. The code for CInitDialogBar can be viewed here:
    http://www.codeguru.com/Cpp/W-D/disl...icle.php/c1997

    I am using MS VS 2003.



  2. Re: CDialogBar Window Cannot Be Resized While Floating

    Have a look at this - I just implemented a floating/resizable ControlBar
    from this code...

    http://www.codeproject.com/docking/sizecbar.asp


    "Artist" wrote in message
    news:u6ednYUeK79CIVTZnZ2dnUVZ_rOdnZ2d@speakeasy.ne t...
    >I have a CDialogBar window that docks on the edges of the Main Frame just
    >as it is supposed to. But I can resize it only when it is docked and not
    >when it floats. I noticed that when it floats the CDialogBar window does
    >not move with the Main Frame. In fact I can move the Main Frame completely
    >out from under this CDialogBar window making it to appear to be in the
    >desktop. My guess is when the CDialogBar window is floating its parent and
    >owner becomes the desk top instead the Main Frame window. This would mean
    >the Main Frame does not get its messages including those that would resize
    >the CDialogBar window.
    >
    > I looked for an event that would detect when the CDialogBar window
    > transitions from docked to floating so I could execute SetParent() on that
    > event. I did not find a message that triggered on it. I tried using
    > IsFloating() to branch to a SetParent() statement in an OnMove() handler.
    > It did not work because IsFloating() returned the state the CDialogBar
    > window was in when the move started, not when it ended. When trasitioning
    > from docked to floating it retuned false. When transitioning from floating
    > to docked it returned true. The code was not workable because a resize or
    > move while docked also triggers the OnMove() event where IsFloat() always
    > returns false as expected. OnMoving() did not trigger at all.
    >
    > Why doesn't the CDialogBar window become the child of the Main Window when
    > it transtions to a floating state? How can a change to a floating state be
    > triggered on so SetParent() can be used to make the Main Window the
    > parent?
    >
    > The On Move event handler:
    >
    > void CProjectView::OnMove(int x, int y)
    > {
    > CInitDialogBar::OnMove(x, y);
    > BOOL b = IsFloating();
    > if( IsFloating() )
    > { SetParent( AfxGetMainWnd() );
    > }
    > }
    >
    > The class CInitDialogBar that CProjectView is instantiated from has as its
    > parent CDialogBar. The code for CInitDialogBar can be viewed here:
    > http://www.codeguru.com/Cpp/W-D/disl...icle.php/c1997
    >
    > I am using MS VS 2003.
    >




+ Reply to Thread