biloia Posted May 25, 2012 Posted May 25, 2012 how to put a mask on the field or numeric Uniedit unidbedit ? Quote
estrify Posted May 25, 2012 Posted May 25, 2012 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,}$/ } Quote
araujoadanr Posted May 27, 2012 Posted May 27, 2012 For number only Decimal separator = , sender.maskRe=/[+\-\,0-9]/ Decimal separator = . sender.maskRe=/[+\-\.0-9]/ Quote
biloia Posted May 28, 2012 Author Posted May 28, 2012 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??? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.