Ejemplo n.º 1
0
CGridPageView* CGridPageView::create(const Size& tViewSize)
{
	CGridPageView * pRet = new CGridPageView();
	if( pRet && pRet->initWithSize(tViewSize) )
    {
		pRet->autorelease();
		return pRet;
    }
	CC_SAFE_DELETE(pRet);
	return NULL;
}
Ejemplo n.º 2
0
void Recomebineui::onLoadScene()
{
	SpriteFrameCache::getInstance()->addSpriteFramesWithFile("recombine/recombineui.plist");
	TuiManager::getInstance()->parseScene(this, "panel_recombine", PATH_RECOMBINEUI);

	CGridPageView *pGpvBag = (CGridPageView*)this->getControl(PANEL_RECOMBINE, GPV_BAG);
	pGpvBag->setDataSourceAdapter(this,ccw_datasource_adapter_selector(Recomebineui::adapt_gpv_bag));
	pGpvBag->reloadData();

	CButton *pBtnBack = (CButton*)this->getControl(PANEL_RECOMBINE, BTN_BACK);
	pBtnBack->setOnClickListener(this, ccw_click_selector(Recomebineui::event_btn_back));
}
Ejemplo n.º 3
0
CGridPageView* CGridPageView::create(const Size& tViewSize, const Size& tCellSize, unsigned int uCellCount, 
		Ref* pListener, SEL_DataSoucreAdapterHandler pHandler)
{
	CGridPageView * pRet = new CGridPageView();
	if( pRet && pRet->initWithSize(tViewSize) )
    {
		pRet->setSizeOfCell(tCellSize);
		pRet->setCountOfCell(uCellCount);
		pRet->setDataSourceAdapter(pListener, pHandler);
		pRet->autorelease();
		return pRet;
    }
	CC_SAFE_DELETE(pRet);
	return NULL;
}
Ejemplo n.º 4
0
CGridPageView* TuiManager::createGridPageView(float tag, const char* img, int dir, int column, int row, int num, int cellWidth, int cellHeight, float x, float y, float w, float h, float rotation){
	CGridPageView *pView = CGridPageView::create(Size(w, h));
	m_isUseSpriteFrame ? pView->setBackgroundSpriteFrameName(img) : pView->setBackgroundImage(img);
	pView->setAutoRelocate(true);
	pView->setRotation(rotation);
	pView->setDirection((CScrollViewDirection)dir);
	pView->setCountOfCell(num);
	pView->setColumns(column);
	pView->setRows(row);
	pView->setSizeOfCell(Size(cellWidth, cellHeight));
	pView->setPosition(Point(x, -y));
	pView->setTag(tag);
	return pView;
}
Ejemplo n.º 5
0
CGridPageView* TuiManager::createGridPageView(float tag, Color4B color, int dir, int column, int row, int num, int cellWidth, int cellHeight, float x, float y, float w, float h, float rotation){
	CGridPageView *pView = CGridPageView::create(Size(w, h));
	if (color.a != 0) pView->setBackgroundColor(color);
	pView->setAutoRelocate(true);
	pView->setRotation(rotation);
	pView->setDirection((CScrollViewDirection)dir);
	pView->setCountOfCell(num);
	pView->setColumns(column);
	pView->setRows(row);
	pView->setSizeOfCell(Size(cellWidth, cellHeight));
	pView->setPosition(Vec2(x, -y));
	pView->setTag(tag);
	return pView;
}