Merge pull request #392 from natural-law/master

fixed #599
This commit is contained in:
minggo 2011-07-12 03:10:27 -07:00
commit fcb2006fdc
4 changed files with 3 additions and 13 deletions

View File

@ -52,7 +52,6 @@ void BugsTestMainLayer::onEnter()
CCSize s = CCDirector::sharedDirector()->getWinSize();
m_pItmeMenu = CCMenu::menuWithItems(NULL);
m_pItmeMenu->setPosition( CCPointZero );
CCMenuItemFont::setFontName("Arial");
CCMenuItemFont::setFontSize(24);
for (int i = 0; i < MAX_COUNT; ++i)
@ -63,6 +62,7 @@ void BugsTestMainLayer::onEnter()
m_pItmeMenu->addChild(pItem, kItemTagBasic + i);
}
m_pItmeMenu->setPosition(s_tCurPos);
addChild(m_pItmeMenu);
setIsTouchEnabled(true);
}

View File

@ -113,6 +113,8 @@ static TestScene* CreateTestScene(int nIdx)
TestController::TestController()
: m_tBeginPos(CCPointZero)
{
CCDirector::sharedDirector()->setDeviceOrientation(CCDeviceOrientationPortrait);
// add close menu
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) );
CCMenu* pMenu =CCMenu::menuWithItems(pCloseItem, NULL);

View File

@ -44,14 +44,3 @@ TestScene::TestScene(bool bPortrait)
// 54321 is the tag of BackToMainMenuLayer
addChild(pLayer, 1000, 54321);
}
void TestScene::onExit()
{
if (m_bPortrait)
{
// turn back to the default orientation
CCDirector::sharedDirector()->setDeviceOrientation(CCDeviceOrientationPortrait);
}
CCScene::onExit();
}

View File

@ -20,7 +20,6 @@ public:
TestScene(bool bPortrait = false);
virtual void runThisTest() = 0;
virtual void onExit();
protected:
bool m_bPortrait; // indicate if this test case requires portrait mode