Solved

Splitter Window - SDI Aplication

Posted on 1997-03-06
5
375 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

626 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