fix lua focus test

This commit is contained in:
zilongshanren 2015-12-19 18:32:43 +08:00
parent f43379a313
commit ac4f66fff2
1 changed files with 45 additions and 0 deletions

View File

@ -2341,6 +2341,15 @@ add_new_testcase(function()
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithFixedPriority(eventListener, 1)
local function onExit(tag)
if tag == "exit" then
if eventListener ~= nil then
eventDispatcher:removeEventListener(eventListener)
end
end
end
self:registerScriptHandler(onExit)
local winSize = cc.Director:getInstance():getVisibleSize()
self._horizontalLayout = ccui.HBox:create()
self._horizontalLayout:setPosition(cc.p(20, winSize.height / 2 + 40))
@ -2474,6 +2483,15 @@ add_new_testcase(function()
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithFixedPriority(eventListener, 1)
local function onExit(tag)
if tag == "exit" then
if eventListener ~= nil then
eventDispatcher:removeEventListener(eventListener)
end
end
end
self:registerScriptHandler(onExit)
local winSize = cc.Director:getInstance():getVisibleSize()
self._verticalLayout = ccui.VBox:create()
self._verticalLayout:setPosition(cc.p(winSize.width/2 - 100, winSize.height - 70))
@ -2607,6 +2625,15 @@ add_new_testcase(function()
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithFixedPriority(eventListener, 1)
local function onExit(tag)
if tag == "exit" then
if eventListener ~= nil then
eventDispatcher:removeEventListener(eventListener)
end
end
end
self:registerScriptHandler(onExit)
local winSize = cc.Director:getInstance():getVisibleSize()
self._verticalLayout = ccui.VBox:create()
@ -2772,6 +2799,15 @@ add_new_testcase(function()
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithFixedPriority(eventListener, 1)
local function onExit(tag)
if tag == "exit" then
if eventListener ~= nil then
eventDispatcher:removeEventListener(eventListener)
end
end
end
self:registerScriptHandler(onExit)
local winSize = cc.Director:getInstance():getVisibleSize()
self._horizontalLayout = ccui.HBox:create()
@ -2937,6 +2973,15 @@ add_new_testcase(function()
local eventDispatcher = self:getEventDispatcher()
eventDispatcher:addEventListenerWithFixedPriority(eventListener, 1)
local function onExit(tag)
if tag == "exit" then
if eventListener ~= nil then
eventDispatcher:removeEventListener(eventListener)
end
end
end
self:registerScriptHandler(onExit)
local winSize = cc.Director:getInstance():getVisibleSize()
self._verticalLayout = ccui.VBox:create()