Example #1
0
void UIScene::toCocosGUITestScene(Ref* sender, Widget::TouchEventType type)
{
    if (type == Widget::TouchEventType::ENDED)
    {
        UISceneManager::purgeUISceneManager();
        
        CocosGUITestScene* pScene = new CocosGUITestScene();
        pScene->runThisTest();
        pScene->release();
    }
}
void CocoStudioGUIMainLayer::menuCallback(CCObject *pSender)
{
    CCMenuItemFont* pItem = static_cast<CCMenuItemFont*>(pSender);
    int nIndex = pItem->getZOrder() - kItemTagBasic;
    
    switch (nIndex)
    {
        case TEST_GUI_WIDGET_DYNAMIC_CREATE:
        {
            CocosGUITestScene *pScene = new CocosGUITestScene();
			pScene->runThisTest();
			pScene->release();
        }
            break;
            
        case TEST_CUSTOM_GUI:
        {
            CustomGUITestScene* pScene = new CustomGUITestScene();
            pScene->runThisTest();
            pScene->release();
        }
            break;
        case TEST_MAC_COCOSTUDIO:
        {
            MacGUIEditorTestScene* pScene = new MacGUIEditorTestScene();
            pScene->runThisTest();
            pScene->release();
            break;
        }
         
//            /*
        case TEST_GUI_WIDGET_CREATE_FROM_EDITOR:
        {
            GUIEditorTestScene* pScene = new GUIEditorTestScene();
            pScene->runThisTest();
            pScene->release();
        }
            break;
//             */
            
        default:
            break;
    }
}
Example #3
0
void UIScene::toCocosGUITestScene(CCObject* sender, TouchEventType type)
{
    switch (type)
    {
        case TOUCH_EVENT_ENDED:
        {
            UISceneManager::purgeUISceneManager();
            ActionManager::purge();
            
            CocosGUITestScene* pScene = new CocosGUITestScene();
            pScene->runThisTest();
            pScene->release();
        }
            break;
            
        default:
            break;
    }
  
}
    LINE_SPACE = 40,
    kItemTagBasic = 1000,
};

static struct
{
	const char *name;
	std::function<void(Ref* sender)> callback;
}
g_guisTests[] =
{
	{
        "GUI Dynamic Create Test",
        [](Ref* sender)
        {
            CocosGUITestScene *pScene = new CocosGUITestScene();
			pScene->runThisTest();
			pScene->release();
        }
	},
    {
        "GUI Editor Test",
        [](Ref* sender)
        {
            GUIEditorTestScene* pScene = new GUIEditorTestScene();
            pScene->runThisTest();
            pScene->release();
        }
	},
    {
        "Custom GUI Test",
void ExtensionsMainLayer::menuCallback(CCObject* pSender)
{
    CCMenuItemFont* pItem = (CCMenuItemFont*)pSender;
    int nIndex = pItem->getZOrder() - kItemTagBasic;

    switch (nIndex)
    {
#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)	// MARMALADE CHANGE: Not yet avaiable on Marmalade
    case TEST_NOTIFICATIONCENTER:
        {
            runNotificationCenterTest();
        }
        break;
#endif
    case TEST_CCCONTROLBUTTON:
        {
            CCControlSceneManager* pManager = CCControlSceneManager::sharedControlSceneManager();
            CCScene* pScene = pManager->currentControlScene();
            CCDirector::sharedDirector()->replaceScene(pScene);
        }
        break;
    case TEST_COCOSBUILDER:
        {
            TestScene* pScene = new CocosBuilderTestScene();
            if (pScene)
            {
                pScene->runThisTest();
                pScene->release();
            }
        }
        break;
#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE && CC_TARGET_PLATFORM != CC_PLATFORM_NACL && CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN && CC_TARGET_PLATFORM != CC_PLATFORM_WINRT && CC_TARGET_PLATFORM != CC_PLATFORM_WP8)
    case TEST_HTTPCLIENT:
        {
            runHttpClientTest();
        }
        break;
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
        case TEST_WEBSOCKET:
        {
            runWebSocketTest();
        }
        break;
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)
    case TEST_EDITBOX:
        {
            runEditBoxTest();
        }
        break;
#endif
	case TEST_TABLEVIEW:
		{
			runTableViewTest();
		}
		break;
    case TEST_COMPONENTS:
        {
            runComponentsTestLayerTest();
        }
        break;
	case TEST_ARMATURE:
		{
			ArmatureTestScene *pScene = new ArmatureTestScene();
			if (pScene)
			{
				pScene->runThisTest();
				pScene->release();
			}
		}
		break;
    case TEST_SCENEEDITOR:
       {
            runSceneEditorTestLayer();
       }
            break;
        case TEST_COCOSGUI:
        {
			/*UISceneManager* pManager = UISceneManager::sharedUISceneManager();
			CCScene* pScene = pManager->currentUIScene();
			CCDirector::sharedDirector()->replaceScene(pScene);*/ 

			CocosGUITestScene *pScene = new CocosGUITestScene();
			pScene->runThisTest();
			pScene->release();
		}
            break;
    default:
        break;
    }
}
void CocosGUIExamplesRegisterScene::toCocosGUIScene(CCObject *pSender)
{
    CocosGUITestScene* pScene = new CocosGUITestScene();
    pScene->runThisTest();
    pScene->release();
}