PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Text token edit control
  • Overview
  • Operating mode of the text token edit control (at runtime)
  • Characteristics of a Text token edit control
  • Create a Text token edit control
  • Options specific to the Text token edit control
  • Manage a Text token edit control by programming
  • Associated events
  • Associated WLanguage functions and properties
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Text token edit control

Overview

Interfaces that use token controls are common. A Token control contains variable amounts of information in a limited area.
When a large number of multiple choice options (e.g. selecting several colours among dozens) are available to the end user, the token control is an easy way to present these choices in a clear way.
When the user chooses a new criterion, it is added into the control.
If the user decides to delete a criterion, he must simply click on the "X" next to such criterion.
To manage a token control in WINDEV, WEBDEV, and WINDEV Mobile, simply create a "Text token" edit control. The different tokens can be entered:
  • directly by the end user,
  • by programming.

Operating mode of the text token edit control (at runtime)

  • A token is automatically added into the control when the user presses the Enter key or uses one of the specified separator characters.
  • If the input zone has focus:
    • Clicking on a token removes the input cursor.
    • Using the arrows allows you to select a token and removes the input cursor.
  • If a token is selected:
    • using the keyboard arrows and the Home and End keys allows you to select and move among the tokens.
    • using the Del key deletes the selected token.
    • the Backspace key allows you to delete the previous token.
  • Using the "X" allows you to delete the desired token.
  • If the user has not set the focus on the input zone yet:
    • The Tab key sets the focus on the input zone if the edit control is active.
    • The Tab key sets the focus on the first token if the edit control is in display.
  • If the focus is set on another control, the selected input zone and/or token lose focus.
Characteristics of a Text token edit control

Create a Text token edit control

To create a Text token edit control:
  1. On the "Creation" pane, in the "Usual controls" group, click .
  2. Click the position where the control will be created in the window or page. The control appears in creation mode.
  3. In the edit control description window, select "Text tokens" and validate.
Note: It is also possible to create a Text token edit control from a list of predefined controls delivered by default in the "Edit" menu ( icon). The list of available controls (with their preview in the skin template of project) is displayed. Simply click on the Token or Email control ("Other types" category) to create a Text token edit control in the editor.

Options specific to the Text token edit control

The description window of the Text token edit control is used to define:
  • the management options of the control and the tokens ( "General" tab).
  • the style of the tokens ( "Style" tab).
The "General" tab of the control description window offers the following options:
  • Input mask: When direct input is enabled in a Token control, it is possible to choose an input mask, just like in every Edit control. The end user is guided: email, uppercase characters, numeric values, zip code, ...
  • Input separators (in addition to <CR>): List of characters considered as token separators. When the user enters one of these characters, a token will be created with the content of the input zone and the user will proceed to enter the next token. This list can be managed by programming via ..TokenListSeparator.
  • Unicode: Allows the input of Unicode characters.
  • Allow duplicates: Allows the input of duplicate tokens. If this option is selected, the user will be able to enter the same text for the token several times. This option can be managed by programming with ..TokenAllowDuplicate.
  • Automatic line wrap: Allows managing the behavior when numerous tokens are entered: it is possible to display the tokens on several lines (checked option) or to display a horizontal scrollbar to view all the tokens.
  • Deletable tokens: It makes it possible to let the user delete tokens from the edit control. In that case, an X will appear in the token. This option can be managed by programming with ..TokenDeletable.
The "Style" tab in the control description window allows you to define:
  • the style of the token caption (element "Tokens: Caption").
  • the style of the token (element "Tokens: Border"). In this case, it is possible to select:
    • the picto used for the X in the token,
    • the background and border color of the token.
    • the type of token border.
Manage a Text token edit control by programming

Associated events

At runtime, the user can add, delete or select tokens in an edit control.
Several events can be used to manage these actions:
  • Add a token.
  • Delete a token.
  • Click token.
These events have a procedure, which allows retrieving the current token in a Token variable.
For more details about these events, see Events associated with the Edit controls.

Associated WLanguage functions and properties

To manage a Text token edit control by programming, WLanguage provides you with:
Related Examples:
The Text token edit control Unit examples (WINDEV): The Text token edit control
[ + ] Using a "Text token" edit control.
The text token edit control Unit examples (WEBDEV): The text token edit control
[ + ] Using a "Text token" edit control.
The Text token edit control Unit examples (WINDEV Mobile): The Text token edit control
[ + ] Using a "Text token" edit control.
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment