Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using a time picker


It is easier for users to input the time via a time picker where they are presented with scroll wheels. This has become a standard user interface object and is expected by users. This recipe shows you how to use a time picker in LiveCode.

How to do it...

To use a time picker, follow the given steps:

  1. Add the following code to initiate a date picker, as displayed in the given screenshot:

    on mouseUp
      mobilePickDate "time"
    end mouseUp

    The output will be as follows:

  2. When the user selects the time (hours, minutes, a.m./p.m.) and taps Done, you will want to ensure that you have a way to capture the time. LiveCode puts the user's selection into the the result system variable. You can test this by adding a line of code to the mobilePickDate command:

    on mouseUp
      mobilePickDate "time"
      answer the result
    end mouseUp

    The output will be as follows:

How it works...

We used the mobilePickDate command to instantiate the time picker on a mobile device. We are provided with the user's selection...