/lib/titanium/mobile/ui/Button.hx

http://github.com/visup/haxe-titanium-api · Haxe · 97 lines · 20 code · 3 blank · 74 comment · 0 complexity · 95ccb5ef3adbceb685707fe93f5e13b4 MD5 · raw file

  1. package titanium.mobile.ui;
  2. import titanium.mobile.core.BaseView;
  3. import titanium.mobile.core.Dispatcher;
  4. /**
  5. Button class
  6. Documentation available at:
  7. http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Button-object.html
  8. - namespace
  9. Titanium.UI.Button
  10. - type
  11. object
  12. - subtype
  13. view
  14. - description
  15. A Button is created by the method `Titanium.UI.createButton`.
  16. - since
  17. 0.8
  18. - platforms
  19. android, iphone, ipad
  20. - properties
  21. title[string]: button title
  22. enabled[boolean]: boolean that indicates if the button is enabled or not
  23. backgroundColor[string]: the buttons background color
  24. color[string]: the foreground color of the button text
  25. selectedColor[string]: the selected color of the button text when the button is in the selected state
  26. font[object]: the font properties of the button
  27. backgroundImage[string]: url to a button image that is drawn as the background of the button
  28. backgroundSelectedImage[string]: url to a button image that is drawn as the background of the button when the button is in the selected state
  29. backgroundDisabledImage[string]: url to a button image that is drawn as the background of the button when the button is in the disabled state
  30. style[int]: style constant for the type of button
  31. image[string]: the image to display on the button to the left of the title
  32. # 1.5
  33. titleid[string]: the key in the locale file to use for the title property
  34. #
  35. systemButton[int]: style costants to use sytem button style (0 -> done, 1 -> cancel, 2 -> edit, 3 -> save, 4 -> +, 5 -> space, 17 -> play) http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.iPhone.SystemButton-object
  36. - methods
  37. - events
  38. click: fired when the user presses the button
  39. - example : Simple Button Example
  40. ~~~
  41. var button = Titanium.UI.createButton({
  42. title: 'Hello'
  43. });
  44. button.addEventListener('click',function(e)
  45. {
  46. Titanium.API.info("You clicked the button");
  47. });
  48. ~~~
  49. - notes
  50. **/
  51. @:native("Titanium.UI.Button")
  52. extern class Button extends BaseView
  53. {
  54. // static constructor
  55. public inline static function create(?params:Dynamic):Button
  56. return titanium.mobile.UI.createButton(params)
  57. // properties
  58. public var backgroundDisabledImage:String;
  59. public var enabled:Bool;
  60. public var font:Dynamic;
  61. public var image:String;
  62. public var selectedColor:String;
  63. public var style:Int;
  64. public var title:String;
  65. public var titleid:String;
  66. public var color:String;
  67. public var value:Dynamic;
  68. public var systemButton:Int;
  69. }