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 Tech Support » How to resize control bars in docked state? Collapse All
Subject Author Date
Matthew Claus Mar 9, 2007 - 1:58 PM

Hi!

I need to resize windows put in docked state in the way I resize them by moving selectable (and dragable) border between two docked windows.
I find out that I can not just change desired size with SetInitDesiredSize* and call RecalcLayout(). It looks like I have to issue a command agains the docking window itself? but was not able to find out the exact sequence.

Actually I have more then one level of docking but I believe if I can resize at any specific level the same procedure will work on all levels.

TIA,
GS, gseryakov@espeed.com, in behalf of MC

Matthew Claus Mar 15, 2007 - 2:58 PM

I’ve just sent the example to support@prof-uis.com.

I am trying to resize the two control bars docked together:

void CChangeFloatingSizeView::OnBnClickedButton1()
{
    CExtControlBar & bar = ( STATIC_DOWNCAST( CMainFrame, GetParentFrame() ) ) -> m_wndResizableBar;
    CExtControlBar & bar2 = ( STATIC_DOWNCAST( CMainFrame, GetParentFrame() ) ) -> m_wndResizableBar2;

    CRect r1, r2;
    bar.GetWindowRect(&r1);
    bar2.GetWindowRect(&r2);

    r1.InflateRect(0, 5);
    r2.DeflateRect(0, 5);

    bar.SetInitDesiredSizeVertical(CSize(r1.Width(), r1.Height()));
    bar2.SetInitDesiredSizeVertical(CSize(r2.Width(), r2.Height()));
}

Technical Support Mar 16, 2007 - 10:25 AM

Please add

bar.GetParentFrame()->RecalcLayout();
at the end of CChangeFloatingSizeView::OnBnClickedButton1(). That should help

Matthew Claus Mar 12, 2007 - 10:45 AM

> For example, you have two vertically docked control bars so they share one column at left. If you want them to
> have a particular width, you should call SetInitDesiredSizeHorizontal() for both of them.

Does not work as described. Should I call something similar to pFrame->RecalcLayout()? Is it crucial if I call SetInitDesiredSizeHorizontal for these control bars with two calls from script? In between we’ve got a SetWindowPos call for the window nested in the control bar and maybe some messages are processed.

> If it is not a secret, would let us know what is the reason for resizing control bars programmatically?

Suppose you have several similar dialogs docked together. I you decided to change the shape of these dialogs (hide a column, f.e.) then you may want to resize these docked windows.

Technical Support Mar 10, 2007 - 11:30 AM

The SetInitDesiredSize* methods always work but they should be used properly for the control bars that affect the layout. For example, you have two vertically docked control bars so they share one column at left. If you want them to have a particular width, you should call SetInitDesiredSizeHorizontal() for both of them. If you take a more complex layout, for instance, when you have two or more control bars docked into a tabbed container that is in the position of one of the mentioned control bars, then you should call SetInitDesiredSizeHorizontal() exactly for this container so all this can work correctly. So if you did want to implement some generic algorithm of changing the layout programmatically, you would have to analyze all these combinations. If it is not a secret, would let us know what is the reason for resizing control bars programmatically?

Matthew Claus Mar 15, 2007 - 1:00 PM

> For example, you have two vertically docked control bars so they share one column at left. If you want them to
> have a particular width, you should call SetInitDesiredSizeHorizontal() for both of them.

Does not work as described. Should I call something similar to pFrame->RecalcLayout()? Is it crucial if I call SetInitDesiredSizeHorizontal for these control bars with two calls from script? In between we’ve got a SetWindowPos call for the window nested in the control bar and maybe some messages are processed.

> If it is not a secret, would let us know what is the reason for resizing control bars programmatically?

Suppose you have several similar dialogs docked together. I you decided to change the shape of these dialogs (hide a column, f.e.) then you may want to resize these docked windows.

Technical Support Mar 15, 2007 - 2:15 PM

Would you send us a test project that demonstrates what you need to achieve so we can help you?