Back

CreateListDialog

ListDialog creates a dialog box to display a list in the app.

app.CreateListDialog( title, list, options ) -> app object - ListDialog

Example - Example



function OnStart()
{
    dlg = app.CreateListDialog( "Choices", "Add,Remove,Delete" );
    dlg.SetOnTouch( dlg_OnTouch );
    dlg.Show();
}

function dlg_OnTouch( item )
{
    app.ShowPopup( item );
}
    Copy     Copy All       Run      

Example - Multi



function OnStart()
{
    dlg = app.CreateListDialog( "Days", "Mon,Tues,Wed,Thurs,Fri,Sat,Sun", "Multi" );
    dlg.SetOnTouch( dlg_OnTouch );
    dlg.Show();
}

function dlg_OnTouch( item, isChecked )
{
    app.ShowPopup( item + " isChecked = " + isChecked );
}
    Copy     Copy All       Run      

The following methods are avaiable on the ListDialog object:

  Destroy()
  Dismiss()
  GetType() -> string - "ListDialog"
  Hide()
  Release()
  Show()
  id -> string - "#id"

string
string - "Multi" or "?"
number
set color effects
destroys object
hide dialog
Set visibility "Hide"
?
string -
  hexadecimal: "#rrggbb", "#aarrggbb"
  colourName: "red", "green", ...
changes the background color
string - path to file or folder ( "/absolute/..." or "relative/..." )
unknown
changes the background image
function()
called when user touches object
number - fraction of screen width
number - fraction of screen height
change object size
change text str_col
change dialog title
Set visibility "Show"
object id