Jump to content

help with mask


biloia

Recommended Posts

how to put a mask on the field or numeric Uniedit unidbedit ?

If you are referring to mask keystrokes, go to the properties of UniEdit, choose ClientEvents property and edit ExtEvents. Go to OnBeforerender event and add the mask you need using maskRe property of the ExtJS's TextField component. Here is an example for alfa keystrokes only:

 

function OnBeforerender(sender)

{

sender.maskRe=/^[a-zA-Z]{0,}$/

}

Link to comment
Share on other sites

Good morning!

In Delphi I use this routine to make an edit to the same bank ATMs.

TForm1.Edit1KeyPress procedure (Sender: TObject; var Key: Char);

begin

if not (Key in ['0 '.. '9', # 8, # 9]) then

key: = # 0;

/ / Function to position the cursor always on the right

Edit1.SelStart: Length = (Edit1.Text);

end;

 

then the change type well

 

var

s: string;

v: double;

I: integer;

begin

/ / Step 1: If the edit is empty, nothing can be done.

If (= Edit1.Text emptystr) then

Edit1.Text: = '0, 00 ';

 

/ / Step 2: get the text edit WITHOUT a comma and WITHOUT the decimal point:

s: ='';

for I: length = 1 to (Edit1.Text) of

if (Edit1.Text in ['0 '.. '9']) then

s: = s + Edit1.Text ;

 

/ / Step 3: make edit the contents of the present two decimal places:

v: = strtofloat (s);

v: = (v / 100) / / to create two decimal places

 

/ / Step 4: Format of the value (V) for accepting values ​​of the type 0.10.

Edit1.Text: FormatFloat = ('# # #, # # 0.00', v);

edit1.SelStart: = 0;

end;

 

is how to do this uniedit???

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...