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:lists [2015/03/08 09:04] octazid completed |
built_in:lists [2016/08/02 19:17] administrator change method object name |
||
---|---|---|---|
Line 4: | Line 4: | ||
===== Description ===== | ===== Description ===== | ||
- | Create List objects using the **CreateList** method of the app object: | + | Create List objects using the **CreateList** method of the **[[built_in: |
< | < | ||
Use the **SetOnTouch** and **SetOnLongTouch** methods of the List object to set the name of a function you want to be called when a list item is selected. The selected item is passed into your OnTouch callback function as a parameter every time an item is selected or long touched. | Use the **SetOnTouch** and **SetOnLongTouch** methods of the List object to set the name of a function you want to be called when a list item is selected. The selected item is passed into your OnTouch callback function as a parameter every time an item is selected or long touched. | ||
Line 73: | Line 73: | ||
* " | * " | ||
* " | * " | ||
+ | |||
+ | You can also use resource images or images from your sdcard instead of the keywords, for example:- " | ||
+ | | ||
====Example - Title + Icon==== | ====Example - Title + Icon==== | ||
Line 94: | Line 97: | ||
</ | </ | ||
- | ====Example - Title + Icon==== | + | ====Example - Title + Body==== |
<code javascript> | <code javascript> | ||
function OnStart() | function OnStart() | ||
Line 173: | Line 176: | ||
</ | </ | ||
+ | |||
+ | ====Example - HTML Font Color==== | ||
+ | <code javascript> | ||
+ | function OnStart() | ||
+ | { | ||
+ | // | ||
+ | lay = app.CreateLayout( " | ||
+ | |||
+ | // | ||
+ | var data = | ||
+ | "< | ||
+ | "< | ||
+ | "< | ||
+ | lst = app.CreateList( data, | ||
+ | lay.AddChild( lst ); | ||
+ | |||
+ | // | ||
+ | app.AddLayout( lay ); | ||
+ | } | ||
+ | </ | ||
---- | ---- | ||
Line 178: | Line 201: | ||
Some controls use the same methods.\\ | Some controls use the same methods.\\ | ||
For examples of the **[[same methods]]** look here. | For examples of the **[[same methods]]** look here. | ||
- | ^Method ^Description ^ | + | ^ Method |
- | |ListView.AddItem( title, | + | | List.AddItem( title, |
- | |ListView.Destroy() | | | + | | List.GetAbsHeight() | |
- | |ListView.GetAbsHeight() | | | + | | List.GetAbsWidth() |
- | |ListView.GetAbsWidth() | | | + | | List.GetHeight() |
- | |ListView.GetHeight() | | | + | | List.GetItemByIndex( index ) |
- | |ListView.GetList( delimeter ) | string = list.GetList("," | + | | List.GetLength() |
- | |ListView.GetPosition() | | | + | | List.GetList( delimeter ) | string = list.GetList("," |
- | |ListView.GetTextSize( mode ) | | | + | | List.GetPosition() |
- | |ListView.GetType() | | | + | | List.GetTextSize( mode ) |
- | |ListView.GetVisibility() | | | + | | List.GetType() |
- | |ListView.GetWidth() | | | + | | List.GetVisibility() |
- | |ListView.Release() | | | + | | List.GetWidth() |
- | |ListView.RemoveItem( title ) | | | + | | List.InsertItem(index, |
- | |ListView.ScrollToItem( name,body ) | | | + | | List.RemoveAll() |
- | |ListView.SelectItem( title, | + | | List.RemoveItem( title ) |
- | |ListView.SelectItemByIndex( index, | + | | List.RemoveItemByIndex( index ) | | |
- | |ListView.SetBackColor( colorCode ) | | | + | | List.ScrollToItem( name,body ) | | |
- | |ListView.SetBackGradient( color1, | + | | List.ScrollToItemByIndex( index ) |
- | |ListView.SetBackGradientRadial( x, | + | | List.SelectItem( title, |
- | |ListView.SetBackground( imagefile, | + | | List.SelectItemByIndex( index, |
- | |ListView.SetDivider( height, | + | | List.SetBackColor( colorCode ) |
- | |ListView.SetEllipsize( mode ) | | | + | | List.SetBackGradient( color1, |
- | |ListView.SetEllipsize1( mode ) | | | + | | List.SetBackGradientRadial( x, |
- | |ListView.SetEllipsize2( mode ) | | | + | | List.SetBackground( imagefile, |
- | |ListView.SetFontFile( file ) | | | + | | List.SetDivider( height, |
- | |ListView.SetHiTextColor1( colorCode ) | | | + | | List.SetEllipsize( mode ) | |
- | |ListView.SetHiTextColor2( colorCode ) | | | + | | List.SetEllipsize1( mode ) |
- | |ListView.SetItem( title, | + | | List.SetEllipsize2( mode ) |
- | |ListView.SetList( list, | + | | List.SetFontFile( file ) |
- | |ListView.SetMargins( left, | + | | List.SetHiTextColor1( colorCode ) | |
- | |ListView.SetOnLongTouch( callback ) |sets the function called when list is long-touched | | + | | List.SetHiTextColor2( colorCode ) | |
- | |ListView.SetOnTouch( callback ) |sets the function called when list is touched | | + | | List.SetItem( title, |
- | |ListView.SetPadding( left, | + | | List.SetItemByIndex( index, |
- | |ListView.SetPosition( left, | + | | List.SetList( list, |
- | |ListView.SetScale( x,y ) | | | + | | List.SetMargins( left, |
- | |ListView.SetSize( width, | + | | List.SetOnLongTouch( callback ) | sets the function called when list is long-touched |
- | |ListView.SetTextColor( colorCode ) | | | + | | List.SetOnTouch( callback ) | sets the function called when list is touched |
- | |ListView.SetTextColor1( colorCode ) | | | + | | List.SetPadding( left, |
- | |ListView.SetTextColor2( colorCode ) | | | + | | List.SetPosition( left, |
- | |ListView.SetTextMargins( left, | + | | List.SetScale( x,y ) |
- | |ListView.SetTextShadow( radius, | + | | List.SetSize( width, |
- | |ListView.SetTextShadow1( radius, | + | | List.SetTextColor( colorCode ) |
- | |ListView.SetTextShadow2( radius, | + | | List.SetTextColor1( colorCode ) | |
- | |ListView.SetTextSize( size,mode ) | | | + | | List.SetTextColor2( colorCode ) | |
- | |ListView.SetVisibility( ShowHide ) | | | + | | List.SetTextMargins( left, |
+ | | List.SetTextShadow( radius, | ||
+ | | List.SetTextShadow1( radius, | ||
+ | | List.SetTextShadow2( radius, | ||
+ | | List.SetTextSize( size,mode ) | | ||
+ | | List.SetVisibility( ShowHide ) | ||
===== Available Options ===== | ===== Available Options ===== | ||
- | ^Option ^Description ^ | + | ^ Option |
- | |AlumButton|Use this to display the list \\ as buttons| | + | | AlumButton |
- | |FontAwesome|Use this to display Icons \\ from this inbuilt font| | + | | FontAwesome |
- | |GreenButton|Use this to display the list \\ as buttons| | + | | GreenButton |
- | |OrangeButton|Use this to display the list \\ as buttons| | + | | Html | Use this option to display html formated code | |
- | |WhiteGrad|Use this to display the list \\ with a gradient background| | + | | OrangeButton |
+ | | WhiteGrad | ||
===== Sample callbacks ===== | ===== Sample callbacks ===== |