./vdo_cell_title.lua

  1. function vdo_cell_title_init() 
  2.  
  3. end 
  4.  
  5. function vdo_cell_title_cleanup() 
  6.  
  7. end 
  8.  
  9. Vdo_cell_title = Vdo_base_object:new_base() 
  10.  
  11. function Vdo_cell_title:init() 
  12. 	self.text_h = vint_object_find("text", self.handle, self.doc_handle) 
  13. 	self.icon_h = vint_object_find("icon", self.handle, self.doc_handle) 
  14. end 
  15.  
  16. function Vdo_cell_title:set_text(text, width) 
  17. 	vint_set_property(self.text_h, "text_tag", text) 
  18. 		 
  19. 	if width ~= nil then 
  20. 		 
  21. 		-- Force a width if we need text to fit in a defined space	 
  22. 		resize_text_element(self.text_h, width) 
  23. 	else	 
  24. 		 
  25. 		-- Reset scale back to original 
  26. 		vint_set_property(self.text_h, "scale", 1, 1) 	 
  27. 	end	 
  28. end 
  29.  
  30. function Vdo_cell_title:set_icon(icon) 
  31. 	vint_set_property(self.icon_h, "image", icon) 
  32. end 
  33.  
  34. function Vdo_cell_title:play_dots_anim() 
  35. 	self.dots_grp_h = vint_object_find("dots_grp", self.handle, self.doc_handle) 
  36. 	self.dots_h = vint_object_find("dots", self.handle, self.doc_handle) 
  37. 	self.glow_h = vint_object_find("glow", self.handle, self.doc_handle) 
  38. 	self.dots_anim_h = vint_object_find("dots_anim", self.handle, self.doc_handle) 
  39. 	self.dots_twn_1_h = vint_object_find("dots_twn_1", self.dots_anim_h)	 
  40. 	self.dots_twn_2_h = vint_object_find("dots_twn_2", self.dots_anim_h)	 
  41. 	self.glow_twn_h = vint_object_find("glow_twn", self.dots_anim_h)	 
  42. 	 
  43. 	--Retarget twn to make sure we find the right instance 
  44. 	vint_set_property(self.dots_twn_1_h, "target_handle", self.dots_grp_h) 
  45. 	vint_set_property(self.dots_twn_2_h, "target_handle", self.dots_h) 
  46. 	vint_set_property(self.glow_twn_h, "target_handle", self.glow_h) 
  47. 	 
  48. 	lua_play_anim(self.dots_anim_h) 
  49. end