Professional UI Solutions
Site Map   /  Register


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 Tech Support » Control bar problem Collapse All
Subject Author Date
Offer Har Apr 24, 2009 - 6:00 AM

Dear Support,

I have an CExtResizableDialog derived dialog inside an CExtControlBar derived control-bar.

This is the way I create the dialog inside the control-bar derived class:

    m_pDockedControl->Create(IDD, this);
    CRect rc;
    SetInitDesiredSizeFloating(CSize(rc.Width(), rc.Height()));

I later in the code show the control-bar:

    m_pMainFrm->ShowControlBar(pBar, bShow, FALSE);
The problem is that the size of the child dialog does not adjust to the size of the control-bar, so all my controls, that use anchors are not displayed properly.

I checked the size of the control-bar and the dialgo in it:

    CRect rc;

    CRect rc1;

and saw this for rc:

        left     0      long

       top      0      long

       right    354    long

       bottom   399    long

and this for rc1:

        left     0      long

        top      0      long

        right    32767  long

        bottom   32767  long

There is clearly something wring here, as the size of the the child must derive from it parent.

Please note that if I resize the control-bar it becomes OK... that means that the child knows its parent, but for some reason it does not resize according to it.

Am I doing something wring? Is this a bug?





Technical Support Apr 24, 2009 - 12:18 PM

The CFrameWnd::RecalcLayout() method should be invoked after SetInitDesiredSizeFloating, after CExtControlBar::FrameEnableDocking() and initial docking of all the bars and before querying rectangles. When the CExtControlBar window is just created, then its size and location are temporary and its parent window is the main frame window. But when you completely initialized the main frame window and docked the CExtControlBar window initially, then the control bar’s parent window is some control bar container window (CExtDockBar in Prof-UIS, CDockBar in MFC).