From f1a559059dbea9b0d85aab4724d16cec994d9937 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 1 Oct 2010 19:27:57 +0200 Subject: TfpgSpinEdit bugfix: key up/down/pgup/pgdn never triggered the OnChange event. --- src/gui/fpg_spinedit.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/fpg_spinedit.pas b/src/gui/fpg_spinedit.pas index 0bd51fd5..99c4e697 100644 --- a/src/gui/fpg_spinedit.pas +++ b/src/gui/fpg_spinedit.pas @@ -1113,9 +1113,13 @@ begin begin FValue := 0; FEdit.Value := FValue; + DoOnChange; end else if (StrToInt(FEdit.Text) <= FMaxValue) and (StrToInt(FEdit.Text) >= FMinValue) then - FValue := FEdit.Value + begin + FValue := FEdit.Value; + DoOnChange; + end else FEdit.Value := FValue; @@ -1124,11 +1128,13 @@ begin begin Inc(FValue, FIncrement); FEdit.Value := FValue; + DoOnChange; end else if not IsMaxLimitReached then begin FValue := FMaxValue; FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyDown then @@ -1136,23 +1142,27 @@ begin begin Dec(FValue, FIncrement); FEdit.Value := FValue; + DoOnChange; end else if not IsMinLimitReached then begin FValue := FMinValue; FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyPageUp then begin FValue := FMaxValue; FEdit.Value := FValue; + DoOnChange; end; if KeyCode = KeyPageDown then begin FValue := FMinValue; FEdit.Value := FValue; + DoOnChange; end; EnableButtons; -- cgit v1.2.3-70-g09d2