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