Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - MDI forms- keep panes in form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI forms- keep panes in form

 Post Reply Post Reply
Author
Message
aaron1 View Drop Down
Newbie
Newbie


Joined: 30 January 2004
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote aaron1 Quote  Post ReplyReply Direct Link To This Post Topic: MDI forms- keep panes in form
    Posted: 30 January 2004 at 5:35am

I am working on an MDI application and using the Dockking Pane controls. I would like to be able to:
1. Prevent users from acutally closing the Panes with the X icon. They should only be able minimize the Pane down to its icon.

2. Prevent them from tearing the Panes off of the form. Basically just to let them move them around and hide them show them. But all on the same form.

What I am trying to avoid is having multiple identical Panes from several forms torn off and floating around the main MDI document.

Thanks.

Back to Top
vladsch View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Location: Canada
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladsch Quote  Post ReplyReply Direct Link To This Post Posted: 07 February 2004 at 11:44am

Hi Aaron:

Here are mods to MDIPanes sample so that when an MDI window is deactivated it hides its floating pane and shows it when re-activated. If the pane is not floating leaves it as is.

Not quite the restriction of not being able to float a pane but from what you described it should do the trick.

I tried these mods on the MDIPane sample app:

1. In CChildFrame::OnDockingPaneNotify after the line

pPane->Attach(&m_wndPropertyGrid);
add
pPane->SetOptions(xtpPaneNoCloseable);

This will remove the x from the docked pane and prevent it from closing. When floating the X is still there but does nothing.

2. Declare in ChildFrm.h

afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);

3. In ChildFrm.cpp Add to the message map

ON_WM_MDIACTIVATE()

4. In ChildFrm.cpp Add the OnMDIActivate function:


void CChildFrame::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
    CMDIChildWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);
 
    if (bActivate && m_paneManager.IsPaneClosed(IDR_PANE_PROPERTIES))
    {
         m_paneManager.ShowPane(IDR_PANE_PROPERTIES);
    }
    else if (m_paneManager.FindPane(IDR_PANE_PROPERTIES)->IsFloating( ))
    {
         m_paneManager.ClosePane(IDR_PANE_PROPERTIES);
    }
}

 

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.172 seconds.