PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • 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 through 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 choices (e.g. selecting several colors 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,
  • through programming.
Caution: "Text token" edit controls cannot be used in a Table or Looper control.

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" tab, in the "Usual controls" group, click .
  2. Click where the control will be created in the window or page. The control appears in the editor.
  3. In the edit control description window, select "Text tokens" and validate.
Remark: 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 is displayed with the project skin template. 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 includes 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 manipulated in the code via the TokenListSeparator property.
  • 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 configured programmatically using the TokenAllowDuplicate property.
  • 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 configured programmatically using the TokenDeletable property.
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 X icon for the token,
    • the background and border color of the token.
    • the type of token borders.
  • the style of the selected token ("Tokens: Selection"). You can then choose the color of the selected token. The "Automatic" color automatically sets the color of the selected token depending on the color of the text. Thus, the text of the token is always readable.
Manage a Text token edit control through 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 on a token.
These events have a procedure that retrieves the current token in a variable of type Token.
For more details about these events, see Events associated with Edit controls.

Associated WLanguage functions and properties

To manage a Text token edit control through programming, WLanguage provides you with:
  • the Token variable type, which allows knowing and defining all the characteristics of a token.
  • token management functions:
  • properties for managing tokens and their characteristics:
    TokenThe Token property is used to manage the different tokens associated with a "Text token" edit control.
    TokenEnabledThe TokenEnabled property determines if an Edit control is a "Text token" Edit control.
    TokenAllowDuplicateThe TokenAllowDuplicate property is used to:
    • Allow or prevent the user from entering duplicates in a "Text token" edit control.
    • Determine if duplicates are allowed in a "Text token" edit control.
    TokenListSeparatorThe TokenListSeparator property retrieves or modifies the separators that trigger the creation of new tokens when entering information in a "Text token" edit control.
    TokenCurrentInputThe TokenCurrentInput property is used to read or change the value being entered in a "Text token" edit control.
    TokenDeletableThe TokenDeletable property is used to:
    • Determine if the end user is allowed to delete tokens in a "Text token" edit control.
    • Allow or prevent the end user from deleting tokens in a "Text token" edit control.
    StoredValueThe StoredValue property is used to get the value currently stored by:
    • a row in a List Box, ListView or Combo Box control.
    • a "Text token" edit control.
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