コード例 #1
0
/**
 * 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
0
/**
 * 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;
}