?
Solved

Splitter Window - SDI Aplication

Posted on 1997-03-06
5
Medium Priority
?
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 300 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

718 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