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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access