2012-06-15 09:16:54 +08:00
|
|
|
#include "MenuTestLayer.h"
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
USING_NS_CC_EXT;
|
|
|
|
|
2012-06-19 16:31:26 +08:00
|
|
|
MenuTestLayer::MenuTestLayer()
|
|
|
|
: mMenuItemStatusLabelBMFont(NULL)
|
|
|
|
{}
|
|
|
|
|
|
|
|
MenuTestLayer::~MenuTestLayer()
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE(mMenuItemStatusLabelBMFont);
|
|
|
|
}
|
2012-06-15 09:16:54 +08:00
|
|
|
|
|
|
|
SEL_MenuHandler MenuTestLayer::onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName) {
|
|
|
|
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemAClicked", MenuTestLayer::onMenuItemAClicked);
|
|
|
|
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemBClicked", MenuTestLayer::onMenuItemBClicked);
|
|
|
|
CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onMenuItemCClicked", MenuTestLayer::onMenuItemCClicked);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
SEL_CCControlHandler MenuTestLayer::onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MenuTestLayer::onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode) {
|
|
|
|
CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mMenuItemStatusLabelBMFont", CCLabelBMFont *, this->mMenuItemStatusLabelBMFont);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MenuTestLayer::onMenuItemAClicked(cocos2d::CCObject *pSender) {
|
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item A clicked.");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MenuTestLayer::onMenuItemBClicked(cocos2d::CCObject *pSender) {
|
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item B clicked.");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MenuTestLayer::onMenuItemCClicked(cocos2d::CCObject *pSender) {
|
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item C clicked.");
|
|
|
|
}
|