CScrollView::SetScrollSizes
这种方法称为视图进行更新时。 若要调整滚动特性的 OnUpdate 方法的重写中调用它。 例如此方法很有用,最初显示文档时,或当它更改大小。
void SetScrollSizes(
int nMapMode,
SIZE sizeTotal,
const SIZE& sizePage = sizeDefault,
const SIZE& sizeLine = sizeDefault );
Parameters
nMapMode
Specifies the mapping mode to set for this view.
Possible values include: Mapping Mode Logical Unit Positive y-axis Extends...
MM_TEXT 1 pixel Downward
MM_HIMETRIC 0.01 mm Upward
MM_TWIPS 1/1440 in Upward
MM_HIENGLISH 0.001 in Upward
MM_LOMETRIC 0.1 mm Upward
MM_LOENGLISH 0.01 in Upward
所有这些模式由 Windows CE 定义。 CScrollView,不使用 MM_ISOTROPIC 和 MM_ANISOTROPIC,两种标准映射模式。 该类库提供了 SetScaleToFitSize 方法的缩放视图窗口的大小。 在上表中的列三描述坐标定位。
sizeTotal
指定滚动视图的总大小。 cx 成员包含水平的程度。 cy 成员包含垂向范围。 逻辑单元的大小。 cx 和 cy 必须大于或等于 0。
sizePage
指定响应鼠标单击滚动条轴中的每个方向滚动的水平和垂直金额。 cx 成员包含水平的金额。 cy 成员包含垂直的金额。
sizeLine
指定每个响应鼠标单击滚动箭头的方向滚动的水平和垂直金额。 cx 成员包含水平的金额。 cy 成员包含垂直的金额。
Remarks
您通常会通过调用一个也许称为 GetMyDocSize,您提供与您的文档的派生的类的文档方法从关联的视图的文档获取大小信息。 下面的代码演示了此方法:
SetScrollSizes( nMapMode, GetDocument( )->GetMyDocSize( ) );
Alternatively, you might sometimes need to set a fixed size, as in the following code:
SetScrollSizes( nMapMode, CSize(100, 100) );
You must set the mapping mode to any of the Windows CE mapping modes except MM_ISOTROPIC or MM_ANISOTROPIC. If you want to use an unconstrained mapping mode, call the SetScaleToFitSize method instead of SetScrollSizes.
Windows CE only supports the MM_TEXT value for the nMapMode parameter.