---------------------------------------------------------------------------
--Vdo_button_header
--A header for use in the megalist to separate categories.
---------------------------------------------------------------------------
--Standard Init Function
function vdo_button_header_init()
end
--Standard Cleanup Function
function vdo_button_header_cleanup()
end
--Inherited from Vdo_base_object
Vdo_button_header = Vdo_base_object:new_base()
---------------------------------------------------------------------------
-- Initializes VDO Object
---------------------------------------------------------------------------
function Vdo_button_header:init()
self.header_txt_h = vint_object_find("header_txt", self.handle, self.doc_handle)
self.scrim_img_h = vint_object_find("header_scrim_img", self.handle, self.doc_handle)
end
---------------------------------------------------------------------------
--Sets label of header
---------------------------------------------------------------------------
function Vdo_button_header:set_label(label)
vint_set_property(self.header_txt_h, "text_tag", label)
end
---------------------------------------------------------------------------
--Sets label_crc of header
---------------------------------------------------------------------------
function Vdo_button_header:set_label_crc(label_crc)
vint_set_property(self.header_txt_h, "text_tag_crc", label_crc)
end
---------------------------------------------------------------------------
--Sets width of header scrim
---------------------------------------------------------------------------
function Vdo_button_header:set_width(new_width)
local BUTTON_HEADER_SCRIM_SCALE_Y = 1.625
local scrim_width, scrim_height = element_get_actual_size(self.scrim_img_h)
vint_set_property(self.scrim_img_h, "screen_size", new_width, scrim_height)
local scale_x, scale_Y = vint_get_property(self.scrim_img_h, "scale")
vint_set_property(self.scrim_img_h, "scale", scale_x, BUTTON_HEADER_SCRIM_SCALE_Y)
end
---------------------------------------------------------------------------
--Updates width of header
---------------------------------------------------------------------------
function Vdo_button_header:get_width()
local scrim_width, scrim_height = element_get_actual_size(self.scrim_img_h)
return scrim_width
end