diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-02-21 16:16:57 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-02-21 16:16:57 +0200 |
commit | 2b3415d96fd09d77df76fca5a48c9c3e97891250 (patch) | |
tree | 38c273ad8f1041401e34a6da9c507f62188b07d4 /src/gui | |
parent | 2835bc4786e64e937fee75c054965b8a3d6e0440 (diff) | |
download | fpGUI-2b3415d96fd09d77df76fca5a48c9c3e97891250.tar.xz |
fpg_edit: for text color adjust to work, repainting must occur a bit later.
DoOnChange must now occur before any call to RePaint. This gives us time
to adjust the text color for possitive or negative values.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_edit.pas | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/fpg_edit.pas b/src/gui/fpg_edit.pas index 61c20808..72befedb 100644 --- a/src/gui/fpg_edit.pas +++ b/src/gui/fpg_edit.pas @@ -900,13 +900,14 @@ begin end; end; { if } - if consumed then - RePaint - else + if not consumed then inherited HandleKeyPress(keycode, shiftstate, consumed); if hasChanged then DoOnChange; + + if consumed then + RePaint; end; procedure TfpgBaseEdit.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); @@ -1142,10 +1143,11 @@ begin FTextOffset := 0; Adjust; - RePaint; if prevval <> Text then DoOnChange; + + RePaint; end; procedure TfpgBaseEdit.SetSideMargin(const AValue: integer); @@ -1350,9 +1352,9 @@ begin FCursorPos := FCursorPos + UTF8Length(s); FSelStart := FCursorPos; Adjust; - Repaint; if prevval <> Text then DoOnChange; + Repaint; end; procedure TfpgBaseEdit.SetAutoSelect(const AValue: Boolean); |