FMX.Mobile.KeyboardTypes Sample (Object Pascal)

From Appmethod Code Examples
Jump to: navigation, search

This is a sample that shows key entry types in mobile applications, using FireMonkey.

Alphabet keyboard type

Location

You can find the KeyboardTypes project at:

EmailAddress keyboard type

Description

This application shows how to use different types of Virtual Keyboard.

How to Use the Sample

  1. Navigate to the one of the locations given above, and open:
    • Object Pascal: VirtualKeyboardDemo.dproj
    • C++: VirtualKeyboardDemo.cbproj
  2. Press F9 or choose Run > Run.
  3. Observe that different Virtual Keyboard types (Alphabet, NumberPad, EmailAddress, PhonePad, URL, and others) activate when you place input focus into different edit controls: First Name, Email, Phone, and others.

Classes

TVKBaseForm, named VKBaseForm, is the main window of the KeyboardTypes sample. It contains the VertScrollBox1 vertical scrolling area containing the MainLayout1 layout. MainLayout1 contains the following components:

PhonePad keyboard type

Implementation

  • The virtual keyboard type (Alphabet, NumberPad, and others) is stored in the KeyboardType property of edit controls. To change the virtual keyboard type, select an edit control (First Name, Email or other) in the Form Designer and select an needed virtual keyboard type in the KeyboardType property in the Object Inspector.
  • The event handlers for OnVirtualKeyboardShown and OnVirtualKeyboardHidden events of the VKBaseForm object are used to scroll the VertScrollBox1 scroll box and adapt the view to the height of the Virtual Keyboard.

Uses

See Also

Personal tools