The MaskEdit Value Editor

The following parameters are available to set up value editor using binding string:

Name
of the parameter
Type Description Mandatory
MASK String Mask. The mask determines where values can be input and the values themselves (letters, numbers, letters and numbers). Each character, which according to a template should be constant, is replaced with the space. One position of input value in mask should correspond to one character _ in template.
The mask uses spaces and the following characters:
  • a/A - the input of letters and numbers is possible.

  • d/D - only numbers can be input.

  • c/C - only letters can be input.

None
INPUTTEMPLATE String Input template. The input template can contain any text which will be constant on editing and it also specifies the places where data is performed. The data input positions are determined by the _ character. None
VALIDCHARS String The characters that can be input in the editor. The characters are determined as a continuous string. None
MAXLENGTH Integer Maximum length of input string. None
VALUE String Default value. None
AUTOSELECT Logical The attribute of automatic text selection on opening the editor. None

Features of Application

None

Binding String

UI="MaskEdit" MASK="AA DD CC" INPUTTEMPLATE="__-__-__" VALIDCHARS="abc123"

Example

Executing the example requires a form with the button named Button1 on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1, which is the data source for TabSheetBox.

Class TestForm: Form
    Button1: Button;
    UiTabSheet1: UiTabSheet;
    TabSheetBox1: TabSheetBox;

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        BM: IBindingManager;
        MaskBoxBinding: IBindingMaskEdit;
    Begin
        BM := New BindingManager.Create;
        MaskBoxBinding := BM.CreateByUi("MaskEdit"As IBindingMaskEdit;
        MaskBoxBinding.AutoSelect := True;
        MaskBoxBinding.Mask := "           dd dd ddddd";
        MaskBoxBinding.InputTemplate := "Telephone:8-9__-__-_____";
        MaskBoxBinding.MaxLength := 22;
        MaskBoxBinding.Value := "Telephone:8-9";
        MaskBoxBinding.ValidChars := "012345";
        UiTabSheet1.TabSheet.Cell(00).Style.Binding := MaskBoxBinding.AsString;
    End Sub Button1OnClick;

End Class TestForm;

Clicking the button sets the value editor for the A0 table cell. On editing the cell, the data input field using a template is displayed. The applied template enables the input of the mobile phone number, by default two first numbers are displayed. Numbers available to input are in the range [0; 5].

Back