This shows you the differences between two versions of the page.
built_in:lists [2014/12/28 18:53] stevegarman add callback samples |
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 ===== | ||
- | ^Method ^Description ^ | ||
- | |ListView.AddItem( title, | ||
- | |ListView.Destroy() | | | ||
- | |ListView.GetAbsHeight() | | | ||
- | |ListView.GetAbsWidth() | | | ||
- | |ListView.GetHeight() | | | ||
- | |ListView.GetList( p1 ) | | | ||
- | |ListView.GetPosition() | | | ||
- | |ListView.GetTextSize( mode ) | | | ||
- | |ListView.GetType() | | | ||
- | |ListView.GetVisibility() | | | ||
- | |ListView.GetWidth() | | | ||
- | |ListView.Release() | | | ||
- | |ListView.RemoveItem( title ) | | | ||
- | |ListView.ScrollToItem( name,body ) | | | ||
- | |ListView.SelectItem( p1,p2,p3 ) | | | ||
- | |ListView.SelectItemByIndex( index, | ||
- | |ListView.SetBackColor( p1 ) | | | ||
- | |ListView.SetBackGradient( p1, | ||
- | |ListView.SetBackGradientRadial( p1, | ||
- | |ListView.SetBackground( p1,p2 ) | | | ||
- | |ListView.SetDivider( height, | ||
- | |ListView.SetEllipsize( mode ) | | | ||
- | |ListView.SetEllipsize1( mode ) | | | ||
- | |ListView.SetEllipsize2( mode ) | | | ||
- | |ListView.SetFontFile( file ) | | | ||
- | |ListView.SetHiTextColor1( p1 ) | | | ||
- | |ListView.SetHiTextColor2( p1 ) | | | ||
- | |ListView.SetItem( title, | ||
- | |ListView.SetList( list,delim ) | | | ||
- | |ListView.SetMargins( left, | ||
- | |ListView.SetOnLongTouch( callback ) |sets the function called when list is touched | | ||
- | |ListView.SetOnTouch( callback ) |sets the function called when list is long-touched | | ||
- | |ListView.SetPadding( p1,p2,p3,p4 ) | | | ||
- | |ListView.SetPosition( p1,p2,p3,p4 ) | | | ||
- | |ListView.SetScale( x,y ) | | | ||
- | |ListView.SetSize( p1,p2 ) | | | ||
- | |ListView.SetTextColor( p1 ) | | | ||
- | |ListView.SetTextColor1( p1 ) | | | ||
- | |ListView.SetTextColor2( p1 ) | | | ||
- | |ListView.SetTextMargins( p1,p2,p3,p4 ) | | | ||
- | |ListView.SetTextShadow( radius, | ||
- | |ListView.SetTextShadow1( radius, | ||
- | |ListView.SetTextShadow2( radius, | ||
- | |ListView.SetTextSize( size,mode ) | | | ||
- | |ListView.SetVisibility( p1 ) ! ! | ||
- | ===== 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 ); | ||
- | } | ||
- | </ |