Virtual Developer Workshop: Containerized Development with Docker
Extending the scroll size capability.
To surpass the limitation of CScrollView, it is possible to calculate a new CBigScrollView size that surpass the limitation of 32768 and calculate the origin of the CScrollView inside this new virtual size.
Using CScrollView to scroll, the client size moves only into CScrollView size. Reaching the sides of CScrollView size, the CScrollSize moves into CBigScrollView size. The only problem doing this it that the scroll bars doesn't reflect the CBigScrollView size but the CScrollSize instead. This is acceptable else it is necessary to rewrite entirely CScrollView. Zoom is limited to 2,147,483,648/2960=725.50.
CBigScrollView has the same properties than CScrollView. You can set the mapping mode like CScrollView. CBigScrollView doesn't use float type but only long type. No float arithmetic is made.
A problem using GDI functions is that clipping is doing only in valid range. When you draw a line into virtual range, you are responsible to clip the line into valid range like client rectangle or CScrollView size. This sample implements a line-clipping algorithm.
Using CBigScrollView to Zoom into the view.
This sample use CBigScrollView to implement a CAppScrollView view with Zoom capabilities. MM_LOMETRIC is used as mapping mode but you can use any valid mapping mode.
A problem zooming into the view is that the user expects that the center of the client size remains the same. To do this, it is necessary to save the center of the client size before zooming and restore it after this. This is true also when resizing the window.
This sample implements Zoom In, Zoom Out, Zoom Default, Zoom with rectangle and hand move functions. In Hand mode, when pressing the left mouse button, you can move the view. In the other mode selected with the toolbar or the right button, you can select a zooming rectangle.
Changing document size with Printer setup.
For true graphic applications, it is necessary to set the document size according to the printer paper size. This sample reflects exactly the paper size. If you change the orientation or the paper size, a message is send to the document to update views.
Date Last Updated: February 14, 1999