mirror of https://github.com/axmolengine/axmol.git
fix lua focus test
This commit is contained in:
parent
f43379a313
commit
ac4f66fff2
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue