From: RAN on
Hi,

I have created (generated) a MDI project with tabbed documents with
VS2008 Pro.
Visual Studio generates an application with the File/Class view
window, properties window, output window and the first MDI document/
view.

I want to control the sides on which the windows dock. I thought this
was done in BOOL CMainFrame::CreateDockingWindows() , i changed the
CBRS_TOP to CBRS_BOTTOM and CBRS_RIGHT to CBRS_LEFT , but the windows
still come out the same in the client area. It makes no difference
what is use for a window style attribute of CBRS_xxxx. Where and how
can i control where in the client area these windows dock ?
I changed then in :

BOOL CMainFrame::CreateDockingWindows()
{
BOOL bNameValid;

// Create class view
CString strClassView;
bNameValid = strClassView.LoadString(IDS_CLASS_VIEW);
ASSERT(bNameValid);
if (!m_wndClassView.Create(strClassView, this, CRect(0, 0, 200, 200),
TRUE, ID_VIEW_CLASSVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Class View window\n");
return FALSE; // failed to create
}

// Create file view
CString strFileView;
bNameValid = strFileView.LoadString(IDS_FILE_VIEW);
ASSERT(bNameValid);
if (!m_wndFileView.Create(strFileView, this, CRect(0, 0, 200, 200),
TRUE, ID_VIEW_FILEVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN | CBRS_LEFT| CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create File View window\n");
return FALSE; // failed to create
}

// Create output window
CString strOutputWnd;
bNameValid = strOutputWnd.LoadString(IDS_OUTPUT_WND);
ASSERT(bNameValid);
if (!m_wndOutput.Create(strOutputWnd, this, CRect(0, 0, 100, 100),
TRUE, ID_VIEW_OUTPUTWND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Output window\n");
return FALSE; // failed to create
}

// Create properties window
CString strPropertiesWnd;
bNameValid = strPropertiesWnd.LoadString(IDS_PROPERTIES_WND);
ASSERT(bNameValid);
if (!m_wndProperties.Create(strPropertiesWnd, this, CRect(0, 0, 200,
200), TRUE, ID_VIEW_PROPERTIESWND, WS_CHILD | WS_VISIBLE |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_RIGHT | CBRS_FLOAT_MULTI))
{
TRACE0("Failed to create Properties window\n");
return FALSE; // failed to create
}

SetDockingWindowIcons(theApp.m_bHiColorIcons);
return TRUE;
}


Could someone please help explain to me how to control the sides where
these windows dock?
Thanks.


From: Steve Achelis on
From within CMainFrame, I use

m_pMyPanel->DockToFrameWindow( CBRS_ALIGN_RIGHT );

to dock a pane to the right side of my single document application.

Steve
From: RAN on
On 2 mrt, 23:20, Steve Achelis <i...(a)RescueRigger.com> wrote:
> From within CMainFrame, I use
>
> m_pMyPanel->DockToFrameWindow( CBRS_ALIGN_RIGHT );
>
> to dock a pane to the right side of my single document application.
>
> Steve

Thanks steve, it is working.