PDA

View Full Version : Two SECControlBar windows docked at left side do not resize properly



Mac
09-18-2008, 06:23 AM
Hello,

I have developed an IDE having a Workspace and Output window similar to MS VS Studio.


class mf_CMainFrame : public SECMDIFrameWnd
{
CWorkspace m_wndWorkspace;
COutputWnd m_wndOutput;
}

class CWorkspace and COutputWnd are derived from SECControlBar. Initially workspace control bar is docked at left side and output at the bottom.


m_wndWorkspace.Create(this, csText, CBRS_LEFT | WS_VISIBLE | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS,CBRS_EX_STDCONTEXTMENU | CBRS_EX_ALLOW_MDI_FLOAT | CBRS_EX_COOL | BRS_EX_BORDERSPACE,101)

m_wndOutput.Create(this, csText,CBRS_BOTTOM | WS_VISIBLE | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS,CBRS_EX_STDCONTEXTMENU | CBRS_EX_ALLOW_MDI_FLOAT | CBRS_EX_COOL | CBRS_EX_BORDERSPACE, 102)


Once I doc output window under workspace, it aligns vertically by creating two columns. I am able to resize the window using splitter bar. (1st Attachment)

If I open a project using file->Open, it closes the already opened project and hides all the control bars.


ShowControlBar(&m_wndWorkspace,TRUE,FALSE);

On opening new project, it shows the control bars.


ShowControlBar(&m_wndWorkspace,FALSE,FALSE);

BUT the problem is that it forget the last splitter bar position. Sometimes it slams output or workspace window. (2nd Attachment)

How to remember the last splitter bar location? Why does it slams the controlbar docked at one side?

Note that I am not restarting my application. Hence LoadBarState() does not resolve my problem.

Mike Weiss
09-23-2008, 01:39 PM
Try passing True for the last param in ShowControlBar. If I recall this will delay the RecalcLayout and often helps when changing the state of several docking windows at once.

Mac
11-13-2008, 08:05 AM
Try passing True for the last param in ShowControlBar. If I recall this will delay the RecalcLayout and often helps when changing the state of several docking windows at once.

Thanks. It works fine. BUT I don't understand the behaviour of the layout manager.

If I dock 2 control bars say ABar and BBar at left hand side vertically, and 'Expand' ABar control bar, the other control bar slams down at the bottom. BUT it does not display close and Gripper button of BBar.

if BBar is expanded, it slams ABar at the top. BUT this time Gripper buttons of ABar are visible.

Mike Weiss
01-30-2009, 12:05 PM
Thanks. It works fine. BUT I don't understand the behaviour of the layout manager.

If I dock 2 control bars say ABar and BBar at left hand side vertically, and 'Expand' ABar control bar, the other control bar slams down at the bottom. BUT it does not display close and Gripper button of BBar.

if BBar is expanded, it slams ABar at the top. BUT this time Gripper buttons of ABar are visible.

I don't see that behavior...
However, I noticed a different, broken, layout issue with my code dealing with those "expand" buttons. Grrr...