Solved

Splitter Window - SDI Aplication

Posted on 1997-03-06
5
369 Views
Last Modified: 2013-11-19
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
Comment
Question by:suresh030497
5 Comments
 
LVL 1

Expert Comment

by:xbwen
ID: 1300455
 Please check with the microsoft on-line example
  \sample\mfc\general\viewex, especily the splitter.cpp.
  Hope you can get what you want.

0
 

Author Comment

by:suresh030497
ID: 1300456

0
 
LVL 1

Accepted Solution

by:
rhgaracci earned 100 total points
ID: 1300457
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
 

Expert Comment

by:chinhsun
ID: 1300458
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
 

Expert Comment

by:chinhsun
ID: 1300459
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 66
Adapt this command to show who installed 29 102
Host to IP 7 73
sumHeights  challenge 17 61
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now