本文整理汇总了C++中TouchButton::checkButton方法的典型用法代码示例。如果您正苦于以下问题:C++ TouchButton::checkButton方法的具体用法?C++ TouchButton::checkButton怎么用?C++ TouchButton::checkButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TouchButton
的用法示例。
在下文中一共展示了TouchButton::checkButton方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkAllButtons
/**
* Static convenience method - checks all buttons for matching touch position.
*/
uint8_t TouchButton::checkAllButtons(unsigned int aTouchPositionX, unsigned int aTouchPositionY) {
// walk through list of active elements
TouchButton * tButtonPointer = sButtonListStart;
while (tButtonPointer != NULL) {
if ((tButtonPointer->mFlags & FLAG_IS_ACTIVE)
&& tButtonPointer->checkButton(aTouchPositionX, aTouchPositionY)) {
if (tButtonPointer->mFlags & BUTTON_FLAG_TYPE_AUTOREPEAT) {
return BUTTON_TOUCHED_AUTOREPEAT;
} else {
return BUTTON_TOUCHED;
}
}
tButtonPointer = tButtonPointer->mNextObject;
}
return NOT_TOUCHED;
}
示例2: checkAllButtons
/**
* Static convenience method - checks all buttons for matching touch position.
*/
int TouchButton::checkAllButtons(const int aTouchPositionX, const int aTouchPositionY, const bool doCallback) {
TouchButton * tObjectPointer = sListStart;
// walk through list of active elements
while (tObjectPointer != NULL) {
if ((tObjectPointer->mFlags & FLAG_IS_ACTIVE)
&& tObjectPointer->checkButton(aTouchPositionX, aTouchPositionY, doCallback)) {
if (tObjectPointer->mFlags & FLAG_IS_AUTOREPEAT_BUTTON) {
sAutorepeatButtonTouched = true;
return BUTTON_TOUCHED_AUTOREPEAT;
}
sButtonTouched = true;
return BUTTON_TOUCHED;
}
tObjectPointer = tObjectPointer->mNextObject;
}
sAutorepeatButtonTouched = false;
sButtonTouched = false;
return NOT_TOUCHED;
}