Esempio n. 1
0
void MailListScene::requestFinishedCallback(CCHttpClient* client, CCHttpResponse* response)
{
	if (!this->ValidateResponseData(client,response))
	{
		return;
	}

	std::vector<char> *buffer = response->getResponseData();
	std::string content(buffer->begin(),buffer->end());

    CCDictionary * dictionary = CCJSONConverter::sharedConverter()->dictionaryFrom(content.c_str());
	int code = ((CCNumber *)dictionary->objectForKey("code"))->getIntValue();
    if (code != 200) {
        CCMessageBox("invoke web api failed!","ERROR");
        return;
    }

	std::string requestTag(response->getHttpRequest()->getTag());

	if (requestTag == "101") {
		mArrayList = dynamic_cast<CCArray *>(dictionary->objectForKey("friendList"));
		if (mArrayList==NULL)
		{
			return;
		}

		selectedindex = -1;

		loadTableView();
	} else if (requestTag == "102"){
		this->doSearch();
		//CCMessageBox("delete friend successfully","Success");
	}
}
Esempio n. 2
0
void HeroInfoController::viewDidLoad(){


	this->getView()->setColor(COLOR_GRAY);
	_size = this->getView()->getBounds().size;
	this->getNavigationController()->setNavigationBarHidden(true, false);
	loadTopBar();
	loadTabBarView();
	loadTableView();

}
Esempio n. 3
0
// on "init" you need to initialize your instance
bool MailListScene::init()
{
    selectedindex = -1;
    
    bool bRet = false;
    do 
    {

        CC_BREAK_IF(! CCLayer::init());
        


		//CCSprite *mailListBg = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("mail_list_bg.png"));
		//mailListBg->setAnchorPoint(CCPointZero);
		//mailListBg->setPosition(CCPointZero);
		//this->addChild(mailListBg);
        
  //      CCSprite *sFriend = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("mail_lblFriend.png"));
		//sFriend->setAnchorPoint(CCPointMake(0, 0.5));
		//sFriend->setPosition(CCPointMake(30, 275));
		//this->addChild(sFriend);
  //      
  //      CCSprite *sSubject = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("mail_lblsubject.png"));
		//sSubject->setAnchorPoint(CCPointMake(0, 0.5));
		//sSubject->setPosition(CCPointMake(120, 275));
		//this->addChild(sSubject);
        
        menuCheckAll = this->generateCheckBox();
        this->addChild(menuCheckAll);
        menuCheckAll->setAnchorPoint(CCPointMake(0, 0.5));
        menuCheckAll->setPosition(CCPointMake(280, 310));

		//doSearch();

		loadTableView();

        bRet = true;
    } while (0);

    return bRet;
}
Esempio n. 4
0
void HeroViewController::viewDidLoad(){
	
	
	this->getView()->setColor(COLOR_GRAY);
	_size = this->getView()->getBounds().size;

	this->getNavigationController()->setNavigationBarHidden(true, false);
	loadTopBar();



	loadTabBarView();
	
	loadJsonData();

	loadTableView();

	
	//this->getNavigationController()->setNavigationBarBackGroundColor(CAColor_black);

	
}