28.4. Focus and autofocus

A slight interface problem arises when we use the accelerator keys or the mouse wheel to change the cursor type. The problem is this. We might sometimes have two views open in a splitter window, one on the left and one on the right. Suppose that in the view on the left, the Pin cursor is selected and in the view on the right, the Hand cursor is selected. Since the CPopView::OnSetCursor gets called by a view whenever the cursor passes over it, the cursor changes from Pin to Hand as we move it from left to right, and changes back to Pin when we move back to the left. This happens automatically, without any clicking of the mouse.

In an MDI program with several views open, only one view will have what is called the focus ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.