PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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