So far, the r
ings are drawn with a radius of 10 pixels, which means that we cannot define an exact radius measured in inches or meters (or at least not without research, the pixel size of every screen we execute the application on). We can address the problem by modifying OnInitialUpdate
.
void CRingView::OnInitialUpdate() { CScrollView::OnInitialUpdate(); CSize sizeTotal; // TODO: calculate the total size of this view sizeTotal.cx = sizeTotal.cy = 100; SetScrollSizes(MM_TEXT, sizeTotal); }
The function SetScrollSizes
sets the scroll bars to reflect the chosen coordinate system. Let us chose the metric system with high resolution: MM_HIMETRIC
; one logical unit is a hundredth of a millimeter. We set the page to correspond to a letter with a width of 216 millimetres and a height of 279 millimetres; we set the height of a line to 5 millimeters and the height of a page to 50 millimeters.