I want to have a 3 column docker layout where the main view (which is configured in the mainframe as view) should be in the middle of the window with a fixed size (width) and on the left and right side of the main view are dockers which should scale with both the same factor according to the width of the main view and the application.
My problem is, even if I set the dock style for the main view in CMainFrame::OnInitialUpdate to DS_NO_RESIZE, the main view will be always resized if I resize the application.
And unfortunately, I can resize the both outer one dockers in an older version of win32++ with DS_NO_FIXED_RESIZE, which isn't available now, but with this style all 3 views/dockers are resizing.
With the actual version the outer dockers are not resizing (both have the style DS_DOCKED_LEFT/RIGHT | DS_NO_CLOSE | DS_NO_UNDOCK.
How can I get a really fixed size main view ?
My feeling is, that I have to do it by myself, because I tried to influence it in the OnSize-Handler and move the dockers by myself, but the effects are very crazy if I use MoveWindow to the dockers and make a recalc afterwards.
There is another full width docker at the bottom of the layout, but this affect not my problem. And only this docker should be closeable or undockable in the layout
best regards, Torsten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, but as usual, after searching some days to find a solution, writing a question, than the solution fall from the sky in a very short time.
I can solve it in the OnSize-Handler with the SetDockSize method. It was a little bit tricky by
1.) Disable Redraw
2.) Enhancing the main view docker to a bigger size (to avoid scrollbars appearing if you reduce the application size)
3.) call the DockFrame::OnSize
4.) Recalulate all my needed docker sizes and set it with SetDockSize
5.) RecalcDockerLayout and enable drawing
It seems, it work as expected, sorry for triggering you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello David,
I want to have a 3 column docker layout where the main view (which is configured in the mainframe as view) should be in the middle of the window with a fixed size (width) and on the left and right side of the main view are dockers which should scale with both the same factor according to the width of the main view and the application.
My problem is, even if I set the dock style for the main view in CMainFrame::OnInitialUpdate to DS_NO_RESIZE, the main view will be always resized if I resize the application.
And unfortunately, I can resize the both outer one dockers in an older version of win32++ with DS_NO_FIXED_RESIZE, which isn't available now, but with this style all 3 views/dockers are resizing.
With the actual version the outer dockers are not resizing (both have the style DS_DOCKED_LEFT/RIGHT | DS_NO_CLOSE | DS_NO_UNDOCK.
How can I get a really fixed size main view ?
My feeling is, that I have to do it by myself, because I tried to influence it in the OnSize-Handler and move the dockers by myself, but the effects are very crazy if I use MoveWindow to the dockers and make a recalc afterwards.
There is another full width docker at the bottom of the layout, but this affect not my problem. And only this docker should be closeable or undockable in the layout
best regards, Torsten
Sorry, but as usual, after searching some days to find a solution, writing a question, than the solution fall from the sky in a very short time.
I can solve it in the OnSize-Handler with the SetDockSize method. It was a little bit tricky by
1.) Disable Redraw
2.) Enhancing the main view docker to a bigger size (to avoid scrollbars appearing if you reduce the application size)
3.) call the DockFrame::OnSize
4.) Recalulate all my needed docker sizes and set it with SetDockSize
5.) RecalcDockerLayout and enable drawing
It seems, it work as expected, sorry for triggering you
Hi Torsten,
I'm pleased you were able to find an answer to your question.
Perhaps an alternative approach would be to override RecalcDockLayout in CMainFrame. It could look something like this:
Here m_pDockLeft and m_pDockRight are member variables of CMainFrame and pointers to CDocker. The dockers are added with the DS_NO_RESIZE style.
Best regards,
David