Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Dialog & CommandBars & Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dialog & CommandBars & Panes

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: Dialog & CommandBars & Panes
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.