Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Splitter Window - SDI Aplication

Visual C++ 4.2
Single Document Interface(SDI) Application

Splitter Window

The panes in  a  static splitter window are only activated when the  left mousebutton is clicked on the particular view. The  menu items and toolbar buttons gets activated only when the particular view to which they are associated is in focus. How can the  menu items and toolbar buttons of a particular view  be activated  even when that view is not  having the focus.  

If in a  static splitter window with two panes a change in one view should cause an event to occur in the second view .How to communicate a changefrom one view to another.
Thanks
Suresh@salestalk.co.uk
0
suresh030497
Asked:
suresh030497
1 Solution
 
xbwenCommented:
 Please check with the microsoft on-line example
  \sample\mfc\general\viewex, especily the splitter.cpp.
  Hope you can get what you want.

0
 
suresh030497Author Commented:

0
 
rhgaracciCommented:
In the doc/view architecture, the standard way for one view to notify another view of a change is by calling the CDocument method UpdateAllViews.  It provides an LPARAM and a pointer to a CObject (derived) object that you can use to provide other views information on what changed.  Override the OnUpdateView method of your view to handle the change.  If your CObject is DECLARE_DYNAMIC, you will be able to get run-time type information on the derived class type of the object.

I don't think that you want to enable the menu/toolbar for a view that does not have the focus because the command messages get sent to the active view.
0
 
chinhsunCommented:
If you see the CFrameWnd::OnCmdMsg at winfrm.cpp, the frame only send the messgae to activeView. So you can overrid this function on derived frame window, than send all message to it's child view

CMyChildFrame::OnCmdMsg(.....)
{
    CChildView *pView;
    while(pView = GetChildView(...))
    {

}
0
 
chinhsunCommented:
If you see the CFrameWnd::OnCmdMsg at winfrm.cpp, the frame only send the messgae to activeView. So you can overrid this function on derived frame window, than send all message to it's child
view

CMyChildFrame::OnCmdMsg(.....)
{
    CChildView *pView;
    while(pView = GetChildView(...))
    {
         if (pView!= NULL && pView->OnCmdMsg(....))
             return TRUE;
    }
    .....
}

}
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now