AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Campo de entrada
  • Text token Edit control
  • Overview
  • Behavior of the text token Edit control at runtime
  • Characteristics of Text token Edit controls
  • Creating a Text token Edit control
  • Options specific to Text token Edit controls
  • Manipulating a Text token Edit control programmatically
  • Associated events
  • Associated WLanguage functions and properties
  • Adding tokens to a list of input suggestions
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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 numerous multiple choice options (e.g. selecting several colours among dozens) are available to the end user, a 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, they can simply click the "X" next to it.
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,
  • programmatically.
Warning: "Text tokens" type Edit controls cannot be used in a Table control or a RepeatString Looper control.

Behavior 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 area has focus:
    • Clicking on a token removes the input cursor.
    • You can use the arrows to select tokens and remove the input cursor.
  • If a token is selected:
    • you can use the keyboard arrows and the Home and End keys to select and move among the tokens.
    • the Del key deletes the selected token.
    • the Backspace key deletes the previous token.
  • Using the "X" allows you to delete the desired token.
  • If the user has not set the focus on the input area yet:
    • The Tab key sets the focus on the input area if the Edit control is active.
    • The Tab key sets the focus on the first token if the Edit control is not active.
  • If the focus is set on another control, the selected input area and/or token lose focus.
  • WINDEV If multiple selection is enabled, the user can select multiple tokens by holding down the Ctrl key.
WINDEV Automatic Application Features (AAF)
Several AAFs are available in the token context menu:
  • Modify: Allows you to edit the text of a token in order to modify it.
  • Cut: Copies the token text and deletes the token.
    If multiple selection is enabled, this option cuts all selected tokens.
  • Copy: copies the text of a token.
    If multiple selection is enabled, this option copies all selected tokens.
  • Copy all: copies the text of all tokens.
  • Paste: Paste the previously copied token(s) or text from the clipboard.
Characteristics of Text token Edit controls

Creating a Text token Edit control

To create a Text token Edit control:
  1. On the "Creación" tab, in the "Controles frecuentes" group, click .
  2. Click where you want to create the control in the window or page. The control appears in the editor.
  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 fields supplied as standard, by selecting "Edit control" (under the icon). The list of available controls is displayed with the project skin template. Simply select "Token edit" or "Token eMail edit".

Options specific to Text token Edit controls

The description window of the Text token Edit control allows you to define:
  • the management options of the control and the tokens ( "General" tab).
  • the token drag-and-drop options ("Details" tab).
  • the style of the tokens ( "Style" tab).
The "General" tab of the control description window includes the following options:
  • Máscara de entrada When tokens can be entered directly, an input mask can be selected, as for any edit control. The end-user is thus guided: email, capital letters, numerical values, zip code, etc.
  • Input separators (in addition to <RC>): List of characters considered as a token separator. When the user enters one of these characters, a token will be created with the content of the input area and the user will proceed to enter the next token. This list can be manipulated in the code via the TokenListSeparator property.
  • Unicode Allows unicode characters to be entered.
  • Permitir duplicados Allows duplicate entries in tokens. If this option is selected, the user will be able to tokenize the same text several times. This option can be set programmatically using the TokenAllowDuplicate property.
  • Return to line automation Automatic line feed: Allows you to manage the operation in the event of a large number of tokens being entered: it is possible to display the tokens on several lines (option checked) or to display a horizontal scrollbar to view all the tokens.
  • Deletable tokens Allows user to delete tokens from Edit control field. In that case, an X will appear in the token. This option can be set programmatically using the TokenDeletable property.
  • Permitir la selección múltiple de tokens Multi-selection of tokens (using the Ctrl key, for example). This option can be set programmatically using the Multiselection property.
The "Details" tab allows you to define all the input options of the text token Edit control. The "Source" and "Target" options enable the drag-and-drop behavior of tokens. For more details on automatic Drag and Drop, see Automatic Drag and Drop.
Note: When a token is dragged and dropped, the "Each time the field is modified" event is executed.
The "Style" tab in the control description window allows you to define:
  • token label style ("Tokens: Label" element).
  • token style ("Tokens: Frame" item). In this case, it is possible to select:
    • the X icon for the token. The image used must have the following dimensions: 12 pixels x 12 pixels (in each state).
    • the background and border color of the token.
    • the type of token borders.
  • the style of the selected token ("Tokens: Selection" item). 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.
Manipulating a Text token Edit control programmatically

Associated events

At runtime, the user can add, delete or select tokens in an Edit control.
You can use different events to manage these actions:
  • Add a token.
  • Delete a token.
  • Click 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 Edit control events.

Associated WLanguage functions and properties

The following WLanguage elements allow you to manage Text token Edit controls:
  • the Token variable type, which is used to get and set all the characteristics of a token.
  • token functions:
    • standard syntax:
      EditAddTokenAgrega un token a un control Campo de entrada.
      EditDeleteAllTokenElimina todos los tokens de un control Campo de entrada de tipo "Tokens de texto".
      EditDeleteTokenElimina un token de un control Campo de entrada de tipo "Tokens de texto".
      EditInsertTokenInserta un token en un control Campo de entrada de tipo "Tokens de texto".
      EditTokenCountDevuelve el número de tokens presentes en un control Campo de entrada.
    • prefix syntax:
      <Edit>.AddTokenAgrega un token a un control Campo de entrada.
      <Edit>.DeleteAllTokenElimina todos los tokens de un control Campo de entrada de tipo "Tokens de texto".
      <Edit>.DeleteTokenElimina un token de un control Campo de entrada de tipo "Tokens de texto".
      <Edit>.InsertTokenInserta un token en un control Campo de entrada de tipo "Tokens de texto".
      <Edit>.TokenCountDevuelve el número de tokens presentes en un control Campo de entrada.
  • properties for managing tokens and their characteristics:
    DndSourceThe DndSource property is used to determine and change a control's drag-and-drop behavior.
    DndTargetThe DndTarget property determines and changes how a control behaves in a drag-and-drop operation.
    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.
    • a row of a Table control.
    • an input suggestion in an Edit control (if the suggestion is selected).
    TokenLa propiedad Token permite manipular los diferentes tokens asociados a un control Campo de entrada de tipo "Tokens de texto".
    TokenAllowDuplicateThe property TokenAuthorizeDoubloon property allows you 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.
    TokenCurrentInputLa propiedad TokenCurrentInput permite leer o cambiar el valor que se está introduciendo en un control Campo de entrada de tipo "Tokens de texto".
    TokenDeletableLa propiedad TokenDeletable permite:
    • Determinar si se permite al usuario final borrar tokens en un control Campo de entrada con tokens de Text.
    • Permitir o impedir que el usuario final borre tokens en un control Campo de entrada con tokens de texto.
    TokenEnabledLa propiedad TokenEnabled determina si un control Campo de entrada es de tipo "Tokens de texto".
    TokenListSeparatorThe TokenListSeparator property retrieves or modifies the separators that trigger the creation of new tokens when entering information in a "Text token" Edit control.

Adding tokens to a list of input suggestions

You can add tokens to a list of input suggestions using AssistedInputAdd.
Example:
MyToken is Token
MyToken.Caption = "abc"
MyToken.Value = "abc"
MyToken.ToolTip = "tooltip"
MyToken.Color = DarkRed
MyToken.BackgroundColor = PastelRed
MyToken2 is Token
MyToken2.Caption = "def"
MyToken2.Value = "def"
MyToken2.ToolTip = "tooltip"
MyToken2.Color = DarkRed
MyToken2.BackgroundColor = PastelRed
AssistedInputAdd(EDT_ControlWithTokens, MyToken)
AssistedInputAdd(EDT_ControlWithTokens, MyToken2)
Versión mínima requerida
  • Versión 24
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 01/05/2025

Señalar un error o enviar una sugerencia | Ayuda local