/lib/titanium/mobile/ui/DashboardItem.hx

http://github.com/visup/haxe-titanium-api · Haxe · 101 lines · 33 code · 7 blank · 61 comment · 0 complexity · 45f50578d67c393df3baa90eac64c5ad MD5 · raw file

  1. package titanium.mobile.ui;
  2. import titanium.mobile.core.BaseView;
  3. import titanium.mobile.core.Dispatcher;
  4. import titanium.mobile.core.Point;
  5. /**
  6. DashboardItem class
  7. Documentation available at:
  8. http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.DashboardItem-object.html
  9. - namespace
  10. Titanium.UI.DashboardItem
  11. - type
  12. object
  13. - subtype
  14. proxy
  15. - description
  16. An item that represents a visual icon in the [[Titanium.UI.DashboardView]]. The Dashboard Item is created by the method `Titanium.UI.createDashboardItem`.
  17. - since
  18. 1.2
  19. - platforms
  20. iphone, ipad
  21. - properties
  22. badge[int]: the badge value or `0` to remove the badge
  23. image[string]: the URL to the image
  24. selectedImage[string]: the URL to the image to display when the item is depressed (clicked)
  25. canDelete[boolean]: a boolean to indicate if this item can be deleted when it edit mode
  26. - events
  27. click: fired when a [[Titanium.UI.DashboardItem]] is clicked
  28. move: fired when a [[Titanium.UI.DashboardItem]] is moved during editing
  29. delete: fired when a [[Titanium.UI.DashboardItem]] is deleted during editings
  30. - event : click
  31. item: the [[Titanium.UI.DashboardItem]] that was clicked
  32. location: the location object with the properties `x` and `y` of where in the parent view the click was
  33. - event : move
  34. item: the [[Titanium.UI.DashboardItem]] that was moved
  35. items: the pending data array in the new order (uncommitted)
  36. - event : delete
  37. item: the [[Titanium.UI.DashboardItem]] that was deleted
  38. **/
  39. #if iphoneos
  40. typedef DashboardItemClickEvent =
  41. { > Event,
  42. item:DashboardItem,
  43. location:Point
  44. }
  45. typedef DashboardItemDeleteEvent =
  46. { > Event,
  47. item:DashboardItem
  48. }
  49. typedef DashboardItemMoveEvent =
  50. { > Event,
  51. item:DashboardItem,
  52. items:Array<DashboardItem>
  53. }
  54. @:native("Titanium.UI.DashboardItem")
  55. extern class DashboardItem extends Dispatcher
  56. {
  57. // static constructor
  58. public inline static function create(?params:Dynamic):DashboardItem
  59. return titanium.mobile.UI.createDashboardItem(params)
  60. // events
  61. public inline static var CLICK_EVENT = "click";
  62. public inline static var DELETE_EVENT = "delete";
  63. public inline static var MOVE_EVENT = "move";
  64. // properties
  65. public var badge:Int;
  66. public var canDelete:Bool;
  67. public var image:String;
  68. public var selectedImage:String;
  69. }
  70. #end