-- Inherited from Vdo_base_object
Vdo_export_progress_meter = Vdo_base_object:new_base()
-- Standard Init Function
function vdo_export_progress_meter_init()
end
-- Standard Cleanup Function
function vdo_export_progress_meter_cleanup()
end
function Vdo_export_progress_meter:init()
-- Get points to the elements
self.label_txt = Vdo_base_object:new("label_txt", self.handle, self.doc_handle)
self.bg = Vdo_base_object:new("bg", self.handle, self.doc_handle)
self.fill = Vdo_base_object:new("fill", self.handle, self.doc_handle)
end
-------------------------------------------------------------------------------
--Updates the meter
-------------------------------------------------------------------------------
function Vdo_export_progress_meter:update(visible, label, meter_percent, highlight_label)
--Set visible
self:set_visible(visible)
if label ~= nil and label ~= "" then
self.label_txt:set_text(label)
end
if highlight_label == false then
self.label_txt:set_color(0, 0, 0)
else
self.label_txt:set_color(220, 220, 220)
end
--Setup properties for fills
--Set Meter Fill based on percent input
local fill_width, fill_height = element_get_actual_size(self.fill.handle)
local bg_width, bg_height = element_get_actual_size(self.bg.handle, "scale")
fill_width = bg_width * meter_percent
self.fill:set_actual_size(fill_width, fill_height)
end
-- Standard Indicator Functions
function Vdo_export_progress_meter:set_visible(visible)
--Hide the indicator if it is not visible
if visible ~= self.visible then
if visible == true then
self:set_property("visible", true)
self.visible = visible
else
self:set_property("visible", false)
self.visible = visible
end
end
end