This shows you the differences between two versions of the page.
built_in:lists [2015/03/07 18:39] octazid [Methods] |
built_in:lists [2019/09/01 00:10] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Lists ====== | ||
- | ===== Create ===== | ||
- | Create List objects using the CreateList method of the app object: | ||
- | < | ||
- | 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. | ||
- | ===== Methods ===== | ||
- | Some controls use the same methods.\\ | ||
- | For examples of the **[[same methods]]** look here. | ||
- | ^Method ^Description ^ | ||
- | |ListView.AddItem( title, | ||
- | |ListView.Destroy() | | | ||
- | |ListView.GetAbsHeight() | | | ||
- | |ListView.GetAbsWidth() | | | ||
- | |ListView.GetHeight() | | | ||
- | |ListView.GetList( delim ) | string = list.GetList("," | ||
- | |ListView.GetPosition() | | | ||
- | |ListView.GetTextSize( mode ) | | | ||
- | |ListView.GetType() | | | ||
- | |ListView.GetVisibility() | | | ||
- | |ListView.GetWidth() | | | ||
- | |ListView.Release() | | | ||
- | |ListView.RemoveItem( title ) | | | ||
- | |ListView.ScrollToItem( name,body ) | | | ||
- | |ListView.SelectItem( title, | ||
- | |ListView.SelectItemByIndex( index, | ||
- | |ListView.SetBackColor( color ) | | | ||
- | |ListView.SetBackGradient( color1, | ||
- | |ListView.SetBackGradientRadial( x, | ||
- | |ListView.SetBackground( imagefile, | ||
- | |ListView.SetDivider( height, | ||
- | |ListView.SetEllipsize( mode ) | | | ||
- | |ListView.SetEllipsize1( mode ) | | | ||
- | |ListView.SetEllipsize2( mode ) | | | ||
- | |ListView.SetFontFile( file ) | | | ||
- | |ListView.SetHiTextColor1( color ) | | | ||
- | |ListView.SetHiTextColor2( color ) | | | ||
- | |ListView.SetItem( title, | ||
- | |ListView.SetList( list, | ||
- | |ListView.SetMargins( left, | ||
- | |ListView.SetOnLongTouch( callback ) |sets the function called when list is long-touched | | ||
- | |ListView.SetOnTouch( callback ) |sets the function called when list is touched | | ||
- | |ListView.SetPadding( left, | ||
- | |ListView.SetPosition( left, | ||
- | |ListView.SetScale( x,y ) | | | ||
- | |ListView.SetSize( width, | ||
- | |ListView.SetTextColor( color ) | | | ||
- | |ListView.SetTextColor1( color ) | | | ||
- | |ListView.SetTextColor2( color ) | | | ||
- | |ListView.SetTextMargins( left, | ||
- | |ListView.SetTextShadow( radius, | ||
- | |ListView.SetTextShadow1( radius, | ||
- | |ListView.SetTextShadow2( radius, | ||
- | |ListView.SetTextSize( size,mode ) | | | ||
- | |ListView.SetVisibility( ShowHide ) | | | ||
- | ===== Options ===== | ||
- | |||
- | ^Option ^Description ^ | ||
- | |FontAwesome|Use this to display Icons \\ from this inbuilt font| | ||
- | |||
- | ===== Sample callbacks ===== | ||
- | <code javascript> | ||
- | function lst_OnTouch( title, body, type, index ) | ||
- | { | ||
- | app.ShowPopup( "id: " + title + " nick: " + body ); | ||
- | } | ||
- | </ | ||
- | <code javascript> | ||
- | function lst_OnLongTouch( title, body, type, index ) | ||
- | { | ||
- | app.ShowPopup( "id: " + title + " nick: " + body ); | ||
- | } | ||
- | </ | ||
- | <code javascript> | ||
- | function lst_OnTouch( title, body, type, index ) | ||
- | { | ||
- | //Shows the index of the touched item | ||
- | app.ShowPopup(index) | ||
- | } | ||
- | </ | ||
- | <code javascript> | ||
- | function lst_OnTouch( item ) | ||
- | { | ||
- | //Shows the touched item | ||
- | app.ShowPopup(item) | ||
- | } | ||
- | </ |