本文整理汇总了C++中SRect::Inside方法的典型用法代码示例。如果您正苦于以下问题:C++ SRect::Inside方法的具体用法?C++ SRect::Inside怎么用?C++ SRect::Inside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SRect
的用法示例。
在下文中一共展示了SRect::Inside方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouse
//.........这里部分代码省略.........
mScrollPos.VisibleRect.iY = (int)((fPositionRelative * (mScrollPos.AreaSize.iCY - mScrollPos.VisibleRect.iCY)) + 0.5f);
// Limit scrolling position
if (mScrollPos.VisibleRect.iY < 0) {
mScrollPos.VisibleRect.iY = 0;
}
if (mScrollPos.VisibleRect.iY > mScrollPos.AreaSize.iCY - mScrollPos.VisibleRect.iCY) {
mScrollPos.VisibleRect.iY = mScrollPos.AreaSize.iCY - mScrollPos.VisibleRect.iCY;
}
// Redraw and set scroll pos (which will cause scroll pane to redraw)
CControl::Redraw();
mpScrollPane->SetScrollPos(mScrollPos);
SetValue(0);
}
break;
}
}
break;
case LeftButtonUp:
{
dynamic_cast<CWindow*>(GetParentWindow())->ReleaseMouseFocus();
mbScrolling = false;
return true;
}
break;
}
}
SRect rctHandle = GetHandleRect();
if (rctHandle.Inside(Pos)) {
// We hit the handle with the mouse
if (MouseMsg == LeftButtonDown) {
mMousePosOrg = Pos;
mScrollPosOrg = mScrollPos;
mScrollBarRectOrg = rctHandle;
dynamic_cast<CWindow*>(GetParentWindow())->GetMouseFocus(dynamic_cast<IControl*>(this));
mbScrolling = true;
return true;
}
}
else {
if (MouseMsg == LeftButtonDown) {
SRect RctThis;
GetRect(RctThis);
if (RctThis.Inside(Pos)) {
// We hit inside the control (but not the handle)
switch(mType) {
case TypeHorizontal:
{
// Calculate the mouse delta
tint iMouseDelta;
if (Pos.iX < rctHandle.iX) {
iMouseDelta = -rctHandle.iCX;
}
else {
iMouseDelta = rctHandle.iCX;
}
// Calculate where we want the handle to be