Esempio n. 1
0
void TDDMenuTest::setUp()
{
	log("TDD Setup is called");
	log("Please write somethings");
	
	//Size size = TDDHelper::getScreenSize();

	// Construct the array
	Vector<MenuItem *> menuArray;
	
	for (int i = 0; i < 10; i++)
	{
		char tempStr[100];
		sprintf(tempStr, "menu-%d", i);

		//  MenuItem *item = MenuItemFont::create(temp, CC_CALLBACK_1(ButtonTest::onMenuSelected, this));
		// MenuItem *menuItem = TDDHelper::createMenuItem(tempStr,
		//						CC_CALLBACK_1(TDDMenuTest::callback, this));
		MenuItem *menuItem = MenuItemFont::create(tempStr, CC_CALLBACK_1(TDDMenuTest::callback, this));
		menuItem->setColor(Color3B::WHITE);
		menuArray.pushBack(menuItem);
	}
	
	TDDMenu *menu = new TDDMenu(Size(400, 300), Color4B(100, 100, 200, 100), 40);
	menu->setPosition(Point(50, 50));
	this->addChild(menu);
	menu->release();
	mMenu = menu;
	
	// update the menu
	// menu->setMenuItems(menuArray);
	menu->setItemsWithColumn(menuArray, 3);
}
Esempio n. 2
0
void TDDSuiteLayer::setupTestMenu()
{
	Size screenSize = TDDHelper::getScreenSize();
	Size menuSize = Size(screenSize.width, screenSize.height - kToolBarHeight);

	
	TDDMenu *menu = new TDDMenu(menuSize, kColorTestMenu, kLineHeight);
	this->addChild(menu);
	menu->release();
	
	// Set to the class variable
	mTestMenu = menu;
	
	// Refresh Menu Data
	refreshTestMenu();
}
Esempio n. 3
0
void TDDSuiteLayer::setupTestMenu()
{
    Size screenSize = TDDHelper::getScreenSize();
    Size menuSize = Size(screenSize.width, screenSize.height - kToolBarHeight);

    //log("DEBUG: screenSize=%f,%f menuSize=%f,%f", screenSize.width, screenSize.height,
    //	menuSize.width, menuSize.height);

    TDDMenu *menu = new TDDMenu(menuSize, kColorTestMenu, kLineHeight);
    this->addChild(menu);
    menu->release();

    // Set to the class variable
    mTestMenu = menu;

    // Refresh Menu Data
    mMode = TDDData::instance()->getMenuMode();
    if(mMode == TDDMenuModeHistory) {
        setDisplayTestWithHistory();
    } else {
        setDisplayTestWithFilter();
    }
}