|
|
|
@ -28,8 +28,6 @@ function ButtonProgressWidget:init()
|
|
|
|
|
bordersize = 0,
|
|
|
|
|
padding = Size.padding.small,
|
|
|
|
|
dim = not self.enabled,
|
|
|
|
|
width = self.width,
|
|
|
|
|
height = self.height,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
self.buttonprogress_content = HorizontalGroup:new{}
|
|
|
|
@ -68,6 +66,7 @@ function ButtonProgressWidget:update()
|
|
|
|
|
self.position = i
|
|
|
|
|
self:update()
|
|
|
|
|
end,
|
|
|
|
|
no_focus = true,
|
|
|
|
|
hold_callback = function()
|
|
|
|
|
self.hold_callback(i)
|
|
|
|
|
end,
|
|
|
|
@ -85,4 +84,31 @@ function ButtonProgressWidget:setPosition(position)
|
|
|
|
|
self:update()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ButtonProgressWidget:onFocus()
|
|
|
|
|
self.buttonprogress_frame.background = Blitbuffer.COLOR_BLACK
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ButtonProgressWidget:onUnfocus()
|
|
|
|
|
self.buttonprogress_frame.background = Blitbuffer.COLOR_WHITE
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ButtonProgressWidget:onTapSelect(arg, gev)
|
|
|
|
|
if gev == nil then
|
|
|
|
|
self:circlePosition()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ButtonProgressWidget:circlePosition()
|
|
|
|
|
if self.position then
|
|
|
|
|
self.position = self.position+1
|
|
|
|
|
if self.position > self.num_buttons then
|
|
|
|
|
self.position = 1
|
|
|
|
|
end
|
|
|
|
|
self.callback(self.position)
|
|
|
|
|
self:update()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return ButtonProgressWidget
|
|
|
|
|