2012-06-15 09:16:54 +08:00
|
|
|
#include "MenuTestLayer.h"
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
USING_NS_CC_EXT;
|
2013-10-15 18:00:03 +08:00
|
|
|
using namespace cocosbuilder;
|
2012-06-15 09:16:54 +08:00
|
|
|
|
2012-06-19 16:31:26 +08:00
|
|
|
MenuTestLayer::MenuTestLayer()
|
2014-03-28 10:28:44 +08:00
|
|
|
: mMenuItemStatusLabelBMFont(nullptr)
|
2012-06-19 16:31:26 +08:00
|
|
|
{}
|
|
|
|
|
|
|
|
MenuTestLayer::~MenuTestLayer()
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE(mMenuItemStatusLabelBMFont);
|
|
|
|
}
|
2012-06-15 09:16:54 +08:00
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
SEL_MenuHandler MenuTestLayer::onResolveCCBCCMenuItemSelector(Ref * 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);
|
|
|
|
|
2014-03-28 10:28:44 +08:00
|
|
|
return nullptr;
|
2012-06-15 09:16:54 +08:00
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
Control::Handler MenuTestLayer::onResolveCCBCCControlSelector(Ref * pTarget, const char * pSelectorName) {
|
2014-03-28 10:28:44 +08:00
|
|
|
return nullptr;
|
2012-06-15 09:16:54 +08:00
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
bool MenuTestLayer::onAssignCCBMemberVariable(Ref * pTarget, const char * pMemberVariableName, Node * pNode) {
|
2014-03-28 10:28:44 +08:00
|
|
|
CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mMenuItemStatusLabelBMFont", Label *, this->mMenuItemStatusLabelBMFont);
|
2012-06-15 09:16:54 +08:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void MenuTestLayer::onMenuItemAClicked(cocos2d::Ref *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item A clicked.");
|
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void MenuTestLayer::onMenuItemBClicked(cocos2d::Ref *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item B clicked.");
|
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void MenuTestLayer::onMenuItemCClicked(cocos2d::Ref *pSender) {
|
2012-06-15 09:16:54 +08:00
|
|
|
this->mMenuItemStatusLabelBMFont->setString("Menu Item C clicked.");
|
|
|
|
}
|