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
|
|
|
|
2013-07-24 18:17:20 +08:00
|
|
|
SEL_MenuHandler MenuTestLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) {
|
2012-06-15 09:16:54 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2013-07-26 15:22:45 +08:00
|
|
|
Control::Handler MenuTestLayer::onResolveCCBCCControlSelector(Object * pTarget, const char * pSelectorName) {
|
2012-06-15 09:16:54 +08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
bool MenuTestLayer::onAssignCCBMemberVariable(Object * pTarget, const char * pMemberVariableName, Node * pNode) {
|
|
|
|
CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mMenuItemStatusLabelBMFont", LabelBMFont *, this->mMenuItemStatusLabelBMFont);
|
2012-06-15 09:16:54 +08:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void MenuTestLayer::onMenuItemAClicked(cocos2d::Object *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item A clicked.");
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void MenuTestLayer::onMenuItemBClicked(cocos2d::Object *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item B clicked.");
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void MenuTestLayer::onMenuItemCClicked(cocos2d::Object *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item C clicked.");
|
|
|
|
}
|