void UIWidget::setFocus(bool fucos) { if (fucos == m_bFocus) { return; } m_bFocus = fucos; if (m_bFocus) { setPressState(WidgetStateSelected); } else { setPressState(WidgetStateNormal); } }
void UIWidget::active(bool containChildren) { m_bActived = true; setPressState(WidgetStateNormal); if (containChildren) { updateChildrenActive(); } }
void UIWidget::disable(bool containChildren) { m_bActived = false; setPressState(WidgetStateDisabled); if (containChildren) { updateChildrenDisable(); } }
bool UILabel::init() { if (UIWidget::init()) { setPressState(WidgetStateNormal); return true; } return false; }
bool UICheckBox::init() { if (UIWidget::init()) { setPressState(WidgetStateNormal); setSelectedState(false); return true; } return false; }
bool UIZoomButton::init() { if (UIWidget::init()) { m_pRender->addChild(m_pNormalBackGround); m_pRender->addChild(m_pPressedBackGround); m_pRender->addChild(m_pDisabledBackGround); m_pRender->addChild(m_pNormalTitle); m_pRender->addChild(m_pPressedTitle); m_pRender->addChild(m_pDisabledTitle); setPressState(WidgetStateNormal); return true; } return false; }
void UIWidget::onTouchCancelled(const CCPoint &touchPoint) { setPressState(WidgetStateNormal); }