Solved

Tying an OnDraw to movement of a splitter bar

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 63
Separate files macro - Errors on larger data set 18 69
Tab names are off by one 5 54
twoTwo  challenge 35 101
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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