Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005987 [JEDI VCL] 00 JVCL Components minor always 2012-09-20 12:37 2013-01-15 15:41
Reporter RHoek View Status public  
Assigned To
Priority normal Resolution open  
Status acknowledged   Product Version Daily / GIT
Summary 0005987: Fire TJvCalcEdit.OnChange event after popup has been 'confirmed'
Description When using TJvCalcEdit (or any other numeric combo edit), the OnChange event is not fired when the user 'commits' the calculated value.

I know of the 'EnablePopupChange' property
- [^]

But that does NOT work because:
1) It's fired for every change made, while the popup is down
  (I only want the result value when the user presses the '=' of Enter)
2) When the user presses 'Escape' the last value, the use the typed (ex 1+2+3)
  will become the value for the edit (in this example 3), while it should
  keep the old value.

What I need is to:
- OR fire the OnChange event, when the use presses the '='/Enter after the
  user has completed calculating the result.
- OR make the event 'OnPopupValueAccepted' published for TJvCalcEdit

But from a generic point of view the OnChange event is the best - central/universal point - where the sullution should go to!
Additional Information
Tags No tags attached.
Attached Files zip file icon JVCL BUG - TJvCalcEdit [^] (82,611 bytes) 2012-09-20 12:37

- Relationships

-  Notes
RHoek (reporter)
2012-09-20 13:20

I've been digging into this and found, that because of the calculation the 'Text' value of the edit is set BEFORE 'TJvCustomComboEdit.AcceptValue' has been called.

Therefor the 'OnChange' event will not be fired, where the value has been accepted :(

'FOnPopupValueAccepted' will be fired no matter the what...

There for there should be some way to call 'OnChange' when the value has been actually modified, after the combo edit popup has closed...
- I'll dig into this en bit more
RHoek (reporter)
2012-09-20 13:38

Hmmm, as far as I can see, I would suggest to add modify the 'TJvCustomNumEdit.AcceptValue' or 'procedure TJvCustomComboEdit.AcceptValue'

Option 1) is impacting less components
Option 2) is a a general level, but impacts more components

1) TJvCustomNumEdit

procedure TJvCustomNumEdit.AcceptValue(const Value: Variant);
  inherited AcceptValue(Value);
  Self.Value := CheckValue(Value, False); //Polaris
  DoChange; //RH: added 2012-09-20

2) TJvCustomComboEdit

procedure TJvCustomComboEdit.AcceptValue(const Value: Variant);
  if Text <> VarToStr(Value) then
    Text := Value;
    Modified := True;
    //DoChange; (ahuser) "Text := Value" triggers Change;
  end else
    DoChange; //RH: added 2012-09-20

  if Assigned(FOnPopupValueAccepted) then

- Issue History
Date Modified Username Field Change
2012-09-20 12:37 RHoek New Issue
2012-09-20 12:37 RHoek File Added: JVCL BUG - TJvCalcEdit
2012-09-20 13:20 RHoek Note Added: 0020198
2012-09-20 13:38 RHoek Note Added: 0020199
2013-01-15 15:41 obones Status new => acknowledged

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker