Jump to content

Recommended Posts

Posted

Keypress is firing but following code fails in .90

 

procedure TUniForm1.TextInputKeyPress(Sender: TObject; var Key: Char);

begin

{

if (Copy(Fields_L.Items.Strings[Fields_L.Itemindex],1,3) = '(N)')

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

Key := #0;

}

Key := #0; //test to kill input failed

End

 

btw Love .90 seems tad faster but I do think screen wait cursor might give the impression of slowness.

Kudo's on unigui, great product.

Posted

Keypress is firing but following code fails in .90

 

procedure TUniForm1.TextInputKeyPress(Sender: TObject; var Key: Char);

begin

{

if (Copy(Fields_L.Items.Strings[Fields_L.Itemindex],1,3) = '(N)')

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

Key := #0;

}

Key := #0; //test to kill input failed

End

 

btw Love .90 seems tad faster but I do think screen wait cursor might give the impression of slowness.

Kudo's on unigui, great product.

 

This is a server event and not necesary work propertly in clien side. You should validate the input text from client side using client events. Zilav shared a good method http://forums.unigui.com/index.php?/topic/1741-formatted-input-for-uniedit/

  • Upvote 1
  • Administrators
Posted

Keypress is firing but following code fails in .90

 

procedure TUniForm1.TextInputKeyPress(Sender: TObject; var Key: Char);

begin

{

if (Copy(Fields_L.Items.Strings[Fields_L.Itemindex],1,3) = '(N)')

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

Key := #0;

}

Key := #0; //test to kill input failed

End

 

btw Love .90 seems tad faster but I do think screen wait cursor might give the impression of slowness.

Kudo's on unigui, great product.

 

Yes, but it would fail in all versions of uniGUI because a client side key press can't be cancelled in a server side event.

  • Upvote 1
Posted

This is a server event and not necesary work propertly in clien side. You should validate the input text from client side using client events. Zilav shared a good method http://forums.unigui.com/index.php?/topic/1741-formatted-input-for-uniedit/

 

Ah, for some reason my head thought these events were recompiled into java and running on the clientside, my mistake. I have kept the library from the link you gave for future reference but for now wanted a simple isnumeric for database lookup entry. Users estrify and Adan advised in another forum discussion to add ExtEvents..OnBeforerender..sender.maskRe=/[+\-\,0-9]/ which works like a charm.

 

Thank you for your time Alberto, appreciated

 

Glen

Posted

Yes, but it would fail in all versions of uniGUI because a client side key press can't be cancelled in a server side event.

 

My apoligies Farshad, thank you for explaining.

×
×
  • Create New...