1

What is difference between CFrameWndEx::AdjustDockingLayout() and CFrameWndEx::RecalcLayout() ?

Both of them to do similar tasks as documentation says: AdjustDockingLayout(), RecalcLayout().

Besides that, Interface Elements doc says that

You can call AdjustDockingLayout or RecalcLayout when you have to adjust the docking layout, and the framework redirects this call to the docking manager.

Does the AdjustDockingLayout() and RecalcLayout() perform same work ?

Andrew Komiagin
  • 6,446
  • 1
  • 13
  • 23
23W
  • 1,413
  • 18
  • 37

1 Answers1

2

The AdjustDockingLayout is one level below RecalcLayout. The RecalcLayout calls AdjustDockingLayout. But AdjustDocinkgLayout has an additional parameter for defered windows positioning (HDWP).

So when the layout of windows are restored from the registry when you start the program or have a mode switch, RecalcLayout isn't called. In this case AdjustDockingLayout is called.

So whenever you need it internally I would always call RecalcLayout.

In detail: RecalcLayout calls RecalcLayout for each of its child windows too and finally calls AdjustDockingLayout for the current window only.

Andrew Komiagin
  • 6,446
  • 1
  • 13
  • 23
xMRi
  • 14,982
  • 3
  • 26
  • 59
  • Thank you, but what work performed by RecalcLayout before call AdjustDockingLayout internally ? Is it safe to calling AdjustDockingLayout() instead RecalcLayout() if I know that window is placed normally and no resizing ? – 23W Nov 26 '15 at 13:05
  • In detail; RecalcLayout does some calculation and calls RecalcLayout for all of its children. AdjustLayout only affects the current window. ´So it just resizes the internal elements of the current window. Again: I always would call RecalcLayout – xMRi Nov 26 '15 at 13:23
  • Small addition. For CDockablePane, CPane and CBasePane virtual method RecalcLayout() is not called never! Only AdjustLayout() called by framework. So, if your pane contains child window and toolbars then you need to overwrite AdjustLayout() method. – 23W Nov 27 '15 at 09:02