Print Page | Close Window

Dialog & CommandBars & Panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=5413
Printed Date: 12 December 2024 at 7:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dialog & CommandBars & Panes
Posted By: jimmy
Subject: Dialog & CommandBars & Panes
Date Posted: 02 November 2006 at 10:29am
Hello,

I've a resizeable Dialog with a commandbar & statusbar.
Work good.

Now i will add a panemanager.
How look like OnSize for this ?

Now i have
void CExResizeDialog::OnSize(UINT nType, int cx, int cy)
{
    __super::OnSize(nType, cx, cy);
    RepositionControls();
}


void CExResizeDialog::RepositionControls()
{
    if (m_bInRepositionControls)
        return;

    m_bInRepositionControls = TRUE;

    CRect rcClientStart;
    CRect rcClientNow;
    GetClientRect(rcClientStart);

    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposQuery, rcClientNow);

    CRect rcBorders(rcClientNow.left - rcClientStart.left, rcClientNow.top - rcClientStart.top,  rcClientStart.right - rcClientNow.right,
        rcClientStart.bottom - rcClientNow.bottom);

    if (rcBorders != m_rcBorders)
    {

        CPoint ptOffset(rcBorders.left - m_rcBorders.left, rcBorders.top - m_rcBorders.top);

        CRect rcWindow;
        GetWindowRect(rcWindow);
        rcWindow.right += rcBorders.left + rcBorders.right - m_rcBorders.left - m_rcBorders.right;
        rcWindow.bottom += rcBorders.top + rcBorders.bottom - m_rcBorders.top - m_rcBorders.bottom;

        Offset(ptOffset);
        m_rcWindow = rcWindow;

        MoveWindow(rcWindow, TRUE);
    }

    m_rcBorders = rcBorders;

    RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

    m_bInRepositionControls = FALSE;
}

But how can i add the paneManager ?

Any sample for this ?

Thanx
    Jimmy




Replies:
Posted By: Oleg
Date Posted: 02 November 2006 at 11:39am
it looks like craze idea - you have COmmandBars/DockingPane/StatusBar and why you still use CDialog.... Try to change it to simple CFrameWnd + CFormView and life will be easy.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jimmy
Date Posted: 06 November 2006 at 5:13am
Hi,

First it was only a ResizeDialogBase class.
Than we need a statusbar. Than we need on a other dialog
Commonbars. Now a costumer sad he need a additional (Dockable) state window. So i must add a DockingPane.

Ok, i will look to change our base class to a CFrameWnd/CFormView base class.

Is there a way to lock resizing CFrameWnd/CFormView ?

greetings from austria
    Jimmy



Posted By: Oleg
Date Posted: 06 November 2006 at 5:33am

One of solution to remove WS_THICKFRAMEstyle:

 

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)

{

if( !CMDIFrameWnd::PreCreateWindow(cs) )

return FALSE;

// TODO: Modify the Window class or styles here by modifying

// the CREATESTRUCT cs

cs.style &= ~WS_THICKFRAME;

return TRUE;

}



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net