本文整理汇总了C++中CMouse::IsLDown方法的典型用法代码示例。如果您正苦于以下问题:C++ CMouse::IsLDown方法的具体用法?C++ CMouse::IsLDown怎么用?C++ CMouse::IsLDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMouse
的用法示例。
在下文中一共展示了CMouse::IsLDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseInput
void ScrollBar::MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
{
// inherited
Element::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
// not if scrolling is disabled
if (!fScrolling) return;
// reset arrow states
bool fPrevDown = fTopDown || fBottomDown;
fTopDown = fBottomDown = false;
// not if dragging
if (rMouse.pDragElement) return;
// left mouse button down?
if (rMouse.IsLDown())
// non-scroll-direction area check
if (fHorizontal ? Inside<int32_t>(iY, 0, C4GUI_ScrollBarHgt) : Inside<int32_t>(iX, 0, C4GUI_ScrollBarWdt))
{
// scroll-direction area check: up/left arrow
if (fHorizontal ? Inside<int32_t>(iX, 0, C4GUI_ScrollArrowWdt-1) : Inside<int32_t>(iY, 0, C4GUI_ScrollArrowHgt-1))
fTopDown = true;
// check down arrow
else if (fHorizontal ? Inside<int32_t>(iX, GetBounds().Wdt-C4GUI_ScrollArrowWdt, GetBounds().Wdt-1)
: Inside<int32_t>(iY, GetBounds().Hgt-C4GUI_ScrollArrowHgt, GetBounds().Hgt-1))
fBottomDown = true;
else if (HasPin() && (fHorizontal ? Inside<int32_t>(iX, C4GUI_ScrollArrowWdt, GetBounds().Wdt-C4GUI_ScrollArrowWdt-1)
: Inside<int32_t>(iY, C4GUI_ScrollArrowHgt, GetBounds().Hgt-C4GUI_ScrollArrowHgt-1)))
{
// move thumb here
iScrollPos = GetScrollByPos(iX, iY);
// reflect movement in associated window or do CB
OnPosChanged();
// start dragging
rMouse.pDragElement = this;
GUISound("UI::Select");
}
}
// sound effekt when buttons are pressed
if ((fTopDown || fBottomDown) != fPrevDown) GUISound("UI::Tick");
}