./vdo_button_header.lua

  1. ---------------------------------------------------------------------------  
  2. --Vdo_button_header 
  3. --A header for use in the megalist to separate categories. 
  4. --------------------------------------------------------------------------- 
  5.  
  6.  
  7. --Standard Init Function	 
  8. function vdo_button_header_init() 
  9. end 
  10.  
  11.  
  12. --Standard Cleanup Function 
  13. function vdo_button_header_cleanup() 
  14. end 
  15.  
  16. --Inherited from Vdo_base_object 
  17. Vdo_button_header = Vdo_base_object:new_base() 
  18.  
  19. ---------------------------------------------------------------------------  
  20. -- Initializes VDO Object 
  21. --------------------------------------------------------------------------- 
  22. function Vdo_button_header:init() 
  23. 	self.header_txt_h = vint_object_find("header_txt", self.handle, self.doc_handle) 
  24. 	self.scrim_img_h = vint_object_find("header_scrim_img", self.handle, self.doc_handle) 
  25. end 
  26.  
  27.  
  28. ---------------------------------------------------------------------------  
  29. --Sets label of header  
  30. --------------------------------------------------------------------------- 
  31. function Vdo_button_header:set_label(label) 
  32. 	vint_set_property(self.header_txt_h, "text_tag", label) 
  33. end 
  34.  
  35.  
  36. ---------------------------------------------------------------------------  
  37. --Sets label_crc of header  
  38. --------------------------------------------------------------------------- 
  39. function Vdo_button_header:set_label_crc(label_crc) 
  40. 	vint_set_property(self.header_txt_h, "text_tag_crc", label_crc) 
  41. end 
  42.  
  43.  
  44. ---------------------------------------------------------------------------  
  45. --Sets width of header scrim 
  46. --------------------------------------------------------------------------- 
  47. function Vdo_button_header:set_width(new_width) 
  48. 	local BUTTON_HEADER_SCRIM_SCALE_Y = 1.625 
  49. 	 
  50. 	local scrim_width, scrim_height = element_get_actual_size(self.scrim_img_h)		 
  51. 	vint_set_property(self.scrim_img_h, "screen_size", new_width, scrim_height)	 
  52. 	 
  53. 	local scale_x, scale_Y = vint_get_property(self.scrim_img_h, "scale") 
  54. 	vint_set_property(self.scrim_img_h, "scale", scale_x, BUTTON_HEADER_SCRIM_SCALE_Y)	 
  55. end 
  56.  
  57.  
  58. ---------------------------------------------------------------------------  
  59. --Updates width of header 
  60. --------------------------------------------------------------------------- 
  61. function Vdo_button_header:get_width() 
  62. 	local scrim_width, scrim_height = element_get_actual_size(self.scrim_img_h) 
  63. 	return scrim_width 
  64. end 
  65.  
  66.  
  67.