@ -401,12 +401,21 @@ function Button:refresh()
end
end
function Button : onHoldSelectButton ( )
function Button : onHoldSelectButton ( )
if self.hold_callback and ( self.enabled or self.allow_hold_when_disabled ) then
-- If we're going to process this hold, we must make
self.hold_callback ( )
-- sure to also handle its hold_release below, so it's
elseif self.hold_input then
-- not propagated up to a MovableContainer
self : onInput ( self.hold_input , true )
self._hold_handled = nil
elseif type ( self.hold_input_func ) == " function " then
if self.enabled or self.allow_hold_when_disabled then
self : onInput ( self.hold_input_func ( ) , true )
if self.hold_callback then
self.hold_callback ( )
self._hold_handled = true
elseif self.hold_input then
self : onInput ( self.hold_input , true )
self._hold_handled = true
elseif type ( self.hold_input_func ) == " function " then
self : onInput ( self.hold_input_func ( ) , true )
self._hold_handled = true
end
end
end
if self.readonly ~= true then
if self.readonly ~= true then
return true
return true
@ -414,12 +423,8 @@ function Button:onHoldSelectButton()
end
end
function Button : onHoldReleaseSelectButton ( )
function Button : onHoldReleaseSelectButton ( )
-- Safe-guard for when used inside a MovableContainer,
if self._hold_handled then
-- which would handle HoldRelease and process it like
self._hold_handled = nil
-- a Hold if we wouldn't return true here
if self.hold_callback and ( self.enabled or self.allow_hold_when_disabled ) then
return true
elseif self.hold_input or type ( self.hold_input_func ) == " function " then
return true
return true
end
end
return false
return false