View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005987 | JEDI VCL | 00 JVCL Components | public | 2012-09-20 12:37 | 2013-01-15 15:41 |
Reporter | RHoek | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
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 - http://issuetracker.delphi-jedi.org/view.php?id=4779 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! | ||||
Tags | No tags attached. | ||||
2012-09-20 12:37
|
JVCL BUG - TJvCalcEdit OnChange.zip (82,611 bytes) |
|
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 |
|
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); begin inherited AcceptValue(Value); Self.Value := CheckValue(Value, False); //Polaris DoChange; //RH: added 2012-09-20 end; 2) TJvCustomComboEdit procedure TJvCustomComboEdit.AcceptValue(const Value: Variant); begin if Text <> VarToStr(Value) then begin Text := Value; Modified := True; UpdatePopupVisible; //DoChange; (ahuser) "Text := Value" triggers Change; end else DoChange; //RH: added 2012-09-20 if Assigned(FOnPopupValueAccepted) then FOnPopupValueAccepted(Self); end; |