Back

TimePickerDialog

Create TimePickerDialog objects using the CreateTimePickerDialog method of the UIExtras object:

 picker = uix.CreateTimePickerDialog( title, hour, minute, options );

By default the TimePicker will use 12 hour (AM/PM) format, you can use the 24Hour option to use a 24 hour format instead.

Example - TimePickerDialog

app.LoadPlugin( "UIExtras" );
 
function OnStart()
{
 lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
 
 btn = app.CreateButton( "Pick Time", 0.3, 0.1 );
 btn.SetOnTouch( btn_OnTouch );
 lay.AddChild( btn );

 app.AddLayout( lay );

 uix = app.CreateUIExtras();
}

function btn_OnTouch()
{
 picker = uix.CreateTimePickerDialog( "Pick a Time" );
 picker.SetOnOk( picker_OnOk );
 picker.Show();
}

function picker_OnOk( hour, minute )
{
 app.ShowPopup(hour + ":" + minute);
}
  Copy   Copy All    Run   

The following methods are available on the TimePickerDialog object:

 GetType()
 SetTitle( title )
 Show()
 Hide()
 Dismiss()
 SetTime( hour, minute )
 SetOnOk( callback )