FMX.Mobile.KeyboardToolbar Sample (Object Pascal)
This is a sample that shows the use of a popup keyboard in mobile applications using FireMonkey.
- Note: This sample application only works on iOS. It does not work on Android.
Contents
Location
You can find the FireMonkeyMobile KeyboardToolbar sample project at:
- Start | Programs | Appmethod | Samples and navigate to Object Pascal\Samples\User Interface\KeyboardToolbar
- Subversion Repository: http://sourceforge.net/p/Appmethod/code/HEAD/tree/branches/Appmethod_113/Object%20Pascal/Samples/User%20Interface/KeyboardToolbar
Description
This application illustrates how to customize the toolbar associated to the virtual keyboard using the IFMXVirtualKeyboardToolbarService.
How to Use the Sample
- Navigate to the location given above and open KeyboardToolbar.dproj.
- Press F9 or choose Run > Run.
- To observe the functionality of the Keyboard Toolbar, follow the steps:
- To invoke the virtual keyboard, use the TEdit control.
- To enable or disable the Keyboard Toolbar, switch the TSwitch control On or Off .
- To add a TVirtualKeyboardToolButton to the Keyboard Toolbar, use the Add button. Notice that the button is visible in the Keyboard Toolbar and in the TListBox.
- To remove a TVirtualKeyboardToolButton from the Keyboard Toolbar, select the button from the TListBox and press the Delete button.
Classes
FireMonkey KeyboardToolbar represents the main window of the sample. It contains the following components:
- A TGroupBox named gbToolbar
- A TGroupBox
- A TListBox named lbButtons
- A TListBoxHeader
- A TLabel
- A TListBoxHeader
- A TToolbar
- Two TButton objects named btnAdd and btnDelete
Implementation
- To enable or disable the Keyboard Toolbar, the SetToolbarEnabled method is used.
- To add or delete buttons from the Keyboard Toolbar, the AddButton and DeleteButton methods are used.
Uses
- IFMXVirtualKeyboardToolbarService.AddButton
- IFMXVirtualKeyboardToolbarService.DeleteButton
- IFMXVirtualKeyboardToolbarService.IsHideKeyboardButtonVisible
- IFMXVirtualKeyboardToolbarService.SetToolbarEnabled