Solved

Tying an OnDraw to movement of a splitter bar

Posted on 1997-04-24
3
418 Views
Last Modified: 2013-11-20
I want to know how to force an OnDraw() call for a view in a splitter window for when the splitter bar is being dragged over (covering up) a view.  OnDraw() is not called when the view is being covered up, but rather only when the view is being uncovered.  I also don't want to do this by using UpdateAllViews().  Basically my question is : Is there a way I can force a call to OnDraw for one of the child views in the splitter window when the splitter bar is dragged over that view, and where can I place this call to OnDraw?
This is in a MDI application.
0
Comment
Question by:David Gray
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
rhgaracci earned 25 total points
ID: 1301186
Instead of using a CSplitterWnd object, use an object of a derived CSplitterWnd class, say CMySplitterWnd.  Provide an override of the protected virtual member function as follows

void CMySplitterWnd::StopTracking(BOOL bAccept)
{
   CSplitterWnd(bAccept);
   
   if (bAccept)
   {
      // for each pane that you want to redraw, invalidate
      // to force WM_PAINT which causes the framework to call
      // OnDraw()
      //
      GetPane(iRow, iCol)->Invalidate();
   }
}






0
 
LVL 1

Expert Comment

by:rhgaracci
ID: 1301187
Did this not work as you expected.  I am curious because of the low grade (C = x2 points).  Please let me know how I could serve you better.
0
 

Author Comment

by:David Gray
ID: 1301188
I think that your solution is pretty good, I just found a better way to solve my problem that is less complicated.  I just had to put an Invalidate() call inside of OnSize() for the view.  Thanks for your help anyways.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

15 Experts available now in Live!

Get 1:1 Help Now