This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
built_in:spinner [2015/03/22 12:48] octazid [Table] |
built_in:spinner [2015/04/02 16:30] octazid [Spinner control] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Spinner control ====== | ====== Spinner control ====== | ||
+ | |||
+ | // | ||
+ | |||
+ | =====Description===== | ||
+ | |||
+ | Create Spinners using the **CreateSpinner** method of the [[built_in: | ||
+ | < | ||
+ | |||
+ | You can allow the Spinner to auto-size by leaving out the dimensions or you can specify a width and/or height as decimal fractions of the screen' | ||
+ | |||
+ | Use the **SetOnChange** method of your spinner to set the name of a function you want to be called when the user selects an item. | ||
+ | |||
+ | You can get the current selection of the Spinner button at any time using the **GetText** method and replace the option list at any time by using the SetList method. | ||
+ | |||
+ | Use the **SelectItem** method to select a particular item in code | ||
+ | |||
+ | =====Example===== | ||
+ | <code javascript> | ||
+ | function OnStart() | ||
+ | { | ||
+ | lay = app.CreateLayout( " | ||
+ | |||
+ | spin = app.CreateSpinner( " | ||
+ | spin.SetOnChange( ShowSelection ); | ||
+ | spin.SelectItem( " | ||
+ | lay.AddChild( spin ); | ||
+ | |||
+ | app.AddLayout( lay ); | ||
+ | } | ||
+ | |||
+ | function ShowSelection( item ) | ||
+ | { | ||
+ | app.ShowPopup( " | ||
+ | } | ||
+ | </ | ||
===== Methods ===== | ===== Methods ===== | ||
Line 5: | Line 40: | ||
For examples of the **[[same methods]]** look here. | For examples of the **[[same methods]]** look here. | ||
^ Method | ^ Method | ||
- | | Spinner.Destroy() | ||
| Spinner.GetAbsHeight() | | Spinner.GetAbsHeight() | ||
| Spinner.GetAbsWidth() | | Spinner.GetAbsWidth() | ||
Line 15: | Line 49: | ||
| Spinner.GetVisibility() | | Spinner.GetVisibility() | ||
| Spinner.GetWidth() | | Spinner.GetWidth() | ||
- | | Spinner.Release() | + | | Spinner.SelectItem( |
- | | Spinner.SelectItem( | + | |
| Spinner.SetBackColor( colorcode ) | | | | Spinner.SetBackColor( colorcode ) | | | ||
| Spinner.SetBackGradient( p1, | | Spinner.SetBackGradient( p1, | ||
| Spinner.SetBackGradientRadial( p1, | | Spinner.SetBackGradientRadial( p1, | ||
- | | Spinner.SetBackground( p1,p2 ) | ||
| Spinner.SetList( list, p2 ) | | | | Spinner.SetList( list, p2 ) | | | ||
| Spinner.SetMargins( left, | | Spinner.SetMargins( left, | ||
Line 33: | Line 65: | ||
| Spinner.SetTextSize( size,mode ) | | Spinner.SetTextSize( size,mode ) | ||
| Spinner.SetVisibility( HideShow ) | | | | Spinner.SetVisibility( HideShow ) | | | ||
+ | |||
+ | |||
+ | ---- | ||
===== Info to Version 1.15 and before ===== | ===== Info to Version 1.15 and before ===== | ||
Line 59: | Line 94: | ||
} | } | ||
</ | </ | ||
- |