Solved

Tying an OnDraw to movement of a splitter bar

Posted on 1997-04-24
3
419 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to delete all specified values regedit 38 283
viewing source code from eclipse 13 89
no14 challenge 14 62
zeroMAx challenge 20 88
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

22 Experts available now in Live!

Get 1:1 Help Now