本文整理汇总了C++中CCMessageBox函数的典型用法代码示例。如果您正苦于以下问题:C++ CCMessageBox函数的具体用法?C++ CCMessageBox怎么用?C++ CCMessageBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CCMessageBox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCMessageBox
void MenuLayer::menuCloseCallback(Ref* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.", "Alert");
#else
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
#endif
}
示例2: switch
void SetPanel::onClick(CCObject* ob)
{
CButton* btn = (CButton*)ob;
int tag = btn->getTag();
switch(tag)
{
case 1:
{
if(this->getParent())
this->getParent()->removeChild(this);
}
break;
case 2:
{
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
//CSceneManager::sharedSceneManager()->getScene("CityScene")->release();
CCDirector::sharedDirector()->replaceScene(GETSCENE(LoginScene));
}
break;
case 3:
{
CNetClient::getShareInstance()->sendDataType(RoleExitMsg);
CCDirector::sharedDirector()->end();
}
break;
case 4:
{
CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
}
break;
case 5:
{
CCMessageBox(GETLANGSTR(1012), GETLANGSTR(1005));
//ShowTexttip(U8("此功能尚未开放,敬请期待"),RGB_RED);
}
break;
default:
break;
}
}
示例3: CCMessageBox
void BeginScene::fbSessionCallback(int responseCode, const char *responseMessage)
{
if (responseCode != EziSocialWrapperNS::RESPONSE_CODE::FB_LOGIN_SUCCESSFUL)
{
CCMessageBox(responseMessage, "Facebook Login");
}
else
{
CCLOG("Login Success!!!");
}
}
示例4: CCMessageBox
void CMainMenuLayer::settingCallback(CCObject* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
#else
CCScene* newScene = CSettingScene::create();
CCDirector::sharedDirector()->pushScene( newScene );
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
#endif
}
示例5: strcpy
bool CLevelManager::CreateFileFirstGame( const char* pc_FileName, int iNumOfLevel )
{
bool result = true;
string pathTest = CCFileUtils::sharedFileUtils()->getWriteablePath();
#if ANDROID
char FullPath[256] = {0};
strcpy(FullPath,pathTest.c_str());
strcat(FullPath,"LevelInfo.txt");
FILE* pFile;
pFile = fopen(FullPath,"r");
if (pFile != NULL)
{
result = false;
fclose(pFile);
}
else
{
result = true;
pFile = fopen(FullPath,"w+");
if (pFile != NULL)
{
fprintf(pFile,"%d\n",iNumOfLevel);
for (int i = 0; i < iNumOfLevel; i ++)
{
if (i <= 5)
{
fprintf(pFile,"%d 0 0 1\n", (i+1) );
}
else
{
fprintf(pFile,"%d 0 0 0\n", (i+1) );
}
}
fclose(pFile);
//ResetLevelInfo(iNumOfLevel);
return true;
}
else
{
CCMessageBox("Create first file failed","Error");
}
}
#endif
return result;
}
示例6: CCMessageBox
void CResultTitleLayer::mainSceneCallback(CCObject* pSender)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
#else
CCScene* newScene = CMainScene::create();
CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.5, newScene) );
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
#endif
}
示例7: CCMessageBox
void BaseScene::fbIncomingRequestCallback(int responseCode, const char* responseMessage, int totalIncomingRequests)
{
if (totalIncomingRequests > 0)
{
int pendingRequest = EziFBIncomingRequestManager::sharedManager()->getPendingRequestCount();
CCString* message = CCString::createWithFormat("Total new requests = %d\n Total pending requests = %d.\nGo to Request API Scene to see the list of incoming requets.", totalIncomingRequests, pendingRequest);
CCMessageBox(message->getCString(), "fbIncomingRequestCallback");
}
else
{
CCLOG("No new incoming request...");
}
}
示例8: file
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
{
string fullPath = s_strRelativePath + pszFileName;
unsigned char * pData = CCFileUtils::getFileDataFromZip(s_strResourcePath.c_str(), fullPath.c_str(), pSize);
if (! pData && getIsPopupNotify())
{
std::string title = "Notification";
std::string msg = "Get data from file(";
msg.append(pszFileName).append(") failed!");
CCMessageBox(msg.c_str(), title.c_str());
}
return pData;
}
示例9: CCLOG
void GameOverView::onYesClicked()
{
CCLOG("Yes!");
CCLOG("Quit the game!");
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
#else
CCDirector::sharedDirector()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
#endif
}
示例10: CCLOG
void MoreDiamondDialog::onGetProfileCompleted( CCNode *sender, void *data )
{
CCLOG("onGetProfileCompleted");
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Get Profile Completed: TRUE");
string fbId = ((CCString*)convertedData->objectForKey("id"))->getCString();
string firstName = ((CCString*)convertedData->objectForKey("firstName"))->getCString();
string name = ((CCString*)convertedData->objectForKey("name"))->getCString();
string username = ((CCString*)convertedData->objectForKey("username"))->getCString();
string birthday = ((CCString*)convertedData->objectForKey("birthday"))->getCString();
string picture50x50 = ((CCString*)convertedData->objectForKey("picture"))->getCString();
//save
DataManager::sharedDataManager()->SetFbID(fbId);
DataManager::sharedDataManager()->SetFbFullName(name);
DataManager::sharedDataManager()->SetName(name);
DataManager::sharedDataManager()->SetFbUserName(username);
//////////////////////////////////////////////////////////////////////////
NDKHelper::AddSelector("MoreDiamondDialog",
"onGetAvatarCompleted",
callfuncND_selector(MoreDiamondDialog::onGetAvatarCompleted),
this);
string w = "128";
string h = "128";
CCDictionary* prms = CCDictionary::create();
prms->setObject(CCString::create(fbId), "fbId");
prms->setObject(CCString::create(w), "width");
prms->setObject(CCString::create(h), "height");
SendMessageWithParams(string("GetAvatar"), prms);
}
else
{
CCLOG("CPP Get Profile Completed: FALSE");
CCMessageBox("Không thể kết nối", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onGetProfileCompleted");
}
}
示例11: getFileDataFromZip
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
{
unsigned char * buffer = NULL;
std::string full_path = pszFileName;
// If it is not inside resource path
if (full_path.find(s_strResourcePath) == std::string::npos)
{
full_path = s_strResourcePath + pszFileName;
}
// if specify the zip file,load from it first
if (s_pszZipFilePath[0] != 0)
{
buffer = getFileDataFromZip(s_pszZipFilePath.c_str(), full_path.c_str(), pSize);
}
// if that failed then let's try and load the file ourselves
if (!buffer)
{
// read the file from hardware
FILE *fp = fopen(full_path.c_str(), pszMode);
if (fp)
{
fseek(fp, 0, SEEK_END);
*pSize = ftell(fp);
fseek(fp, 0, SEEK_SET);
buffer = new unsigned char[*pSize];
*pSize = fread(buffer, sizeof(unsigned char), *pSize, fp);
fclose(fp);
}
}
// we couldn't find the file
if (!buffer && getIsPopupNotify())
{
std::string title = "Notification";
std::string msg = "Get data from file(";
msg.append(full_path);
if (s_pszZipFilePath[0] != 0)
{
msg.append(") in zip archive(").append(s_pszZipFilePath);
}
msg.append(") failed!");
CCMessageBox(msg.c_str(), title.c_str());
}
return buffer;
}
示例12: fullPath
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
{
unsigned char * pData = 0;
string fullPath(pszFileName);
if ((! pszFileName) || (! pszMode))
{
return 0;
}
if (pszFileName[0] != '/')
{
// read from apk
fullPath.insert(0, "assets/");
pData = CCFileUtils::getFileDataFromZip(s_strResourcePath.c_str(), fullPath.c_str(), pSize);
}
else
{
do
{
// read rrom other path than user set it
FILE *fp = fopen(pszFileName, pszMode);
CC_BREAK_IF(!fp);
unsigned long size;
fseek(fp,0,SEEK_END);
size = ftell(fp);
fseek(fp,0,SEEK_SET);
pData = new unsigned char[size+1];
pData[size] = '\0';
size = fread(pData,sizeof(unsigned char), size,fp);
fclose(fp);
if (pSize)
{
*pSize = size;
}
} while (0);
}
if (! pData && getIsPopupNotify())
{
std::string title = "Notification";
std::string msg = "Get data from file(";
msg.append(fullPath.c_str()).append(") failed!");
CCMessageBox(msg.c_str(), title.c_str());
}
return pData;
}
示例13: CCLOG
void CommandManager::onResponse(CCHttpClient* client, CCHttpResponse* response)
{
const string commandName = m_currentCommand->getName();
if (response->isSucceed())
{
m_currentCommand->setCommandState(CommandStateResonsedProcessed);
if (m_currentCommand->getMessageHandler())
{
int responseCode = response->getResponseCode();
RawData* responseData = response->getResponseData();
int responseDataSize = responseData->size();
const char* data = &((*responseData)[0]);
CCLOG("command %s response code %d length %d", commandName.c_str(), responseCode, responseDataSize);
ResponseMessage message;
bool decoded = message.ParseFromArray(data, responseDataSize);
CCAssert(decoded, FORMAT("command %s decode fail data length=%d", commandName.c_str(), responseDataSize));
m_currentCommand->getMessageHandler()->setMessage(&message);
m_currentCommand->getMessageHandler()->execute();
}
}
else
{
CCLOG("command %s fail errorcode=%d error message=%s", commandName.c_str(), response->getResponseCode(), response->getErrorBuffer());
int resendCount = m_currentCommand->getResendCount();
if (resendCount < MAX_RESEND_COUNT)
{
client->send(response->getHttpRequest());
m_currentCommand->setResendCount(resendCount + 1);
CCLOG("resend command %s for the %d time(s)", commandName.c_str(), resendCount);
}
else
{
CCMessageBox(FORMAT("Command fail %s", commandName.c_str()), "Error");
}
}
}
示例14: CCMessageBox
void CStartAndHelpButtonLayer::ReadyButtonCallBack( CCObject* pSender )
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
#else
// 서버로 레디 신호를 보낸다.
CGameManager::GetInstance()->StartGame();
// Scene Change는 GetCurrentScene 을 통해서 비교 / Online 에서는 임의로 Scene을 바꾸지 않는다.
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
#endif
}
示例15: CCMessageBox
void FriendList::showAllFriendsList()
{
if (ALL_DOWNLOAD_COMPLETE == false)
{
CCMessageBox("Downloading of images in Progess. Try after sometime", "Downloading Images");
return;
}
else
{
ALL_DOWNLOAD_COMPLETE = false;
}
this->showLoadingAction();
this->unscheduleUpdate();
EziSocialObject::sharedObject()->getFriends(EziSocialWrapperNS::FB_FRIEND_SEARCH::ALL_FRIENDS, 20, 20);
}