View Issue Details

IDProjectCategoryView StatusLast Update
0001684JEDI VCL00 JVCL Componentspublic2004-04-22 23:48
ReporternestorAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001684: TJvValidateEdit OnValueChanged does not notify
DescriptionTJvValidateEdit does not notify changed value

TJvCustomValidateEdit.OnValueChanged does not notify the new value of the component
Suggestion:
In TJvCustomValidateEdit (JvValidateEdit unit)
Remove all EnterText assignment from code
Remove all DoValueChanged call from code
Change DoValueChanged procedure to
procedure TJvCustomValidateEdit.DoValueChanged;
begin
  if Assigned(FOnValueChanged) and (EnterText <> FEditText) then
    FOnValueChanged(Self);
  EnterText := FEditText;
end;

Add “DoValueChanged” At the end of “SetEditText“ before or after DisplayText;
Remove ChangeText(FEditText) from “SetEditText”, DisplayText call this procedure.

Other suggestions:

In "KeyDown" procedure, the instruction (if Key = VK_DELETE then EditText:= MakeValid(inherited Text);) produce an unexpected behavior at run time.
I suggest you removing it and adding the management of the Escape key to restore last validate value:

procedure TJvCustomValidateEdit.KeyDown(var Key: Word; Shift: TShiftState);
begin
// if Key = VK_DELETE then EditText := MakeValid(inherited Text);
  if Key = VK_Escape then
  begin
    Key := 0;
    EditText := EnterText;
    SelStart := 0;
    SelLength := length(FEditText);
  end;
  inherited KeyDown(Key, Shift);
end;

Regards

Additional InformationI project to define my own inherited TjvValidateEdit component. For that I need "IsValidChar" and "MakeValid" to be declared virtual and to be moved towards the protected section. Is it possible?
TagsNo tags attached.

Activities

2004-04-22 17:19

 

JvValidateEditUpd.pas (34,022 bytes)

user72

2004-04-22 23:48

  ~0004022

Updated in CVS verbatim. Thanks for the fixes!

Issue History

Date Modified Username Field Change
2004-04-22 17:18 nestor New Issue
2004-04-22 17:19 nestor File Added: JvValidateEditUpd.pas
2004-04-22 23:48 user72 Status new => resolved
2004-04-22 23:48 user72 Resolution open => fixed
2004-04-22 23:48 user72 Assigned To => user72
2004-04-22 23:48 user72 Note Added: 0004022