diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-29 22:05:03 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-29 22:19:03 +0200 |
commit | 0a256264e5d4d75f6fa0c5d81aeb96222f7c1273 (patch) | |
tree | 0bb3909dbb3e6c6aaab1291c9c1a4e0e006dd772 | |
parent | c23e6d69fd69f5bceeecc8b1fc218298fb66d3bb (diff) | |
download | fpGUI-0a256264e5d4d75f6fa0c5d81aeb96222f7c1273.tar.xz |
textedit: correctly set consumed variable and only redraw when needed.
-rw-r--r-- | examples/apps/ide/src/fpg_textedit.pas | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/apps/ide/src/fpg_textedit.pas b/examples/apps/ide/src/fpg_textedit.pas index 27edbfa7..b3a1642c 100644 --- a/examples/apps/ide/src/fpg_textedit.pas +++ b/examples/apps/ide/src/fpg_textedit.pas @@ -1336,6 +1336,7 @@ begin begin FLines.Add(''); FVScrollBar.Max := FVScrollBar.Max + 1; + consumed := True; Exit; //==> end; // if (keycode = keyEscape) or (ssCtrl in ShiftState) then @@ -1380,6 +1381,7 @@ begin end; FSelStartNo := CaretPos.Y; FSelStartOffs := CaretPos.X; + consumed := True end; keyTab: @@ -1414,12 +1416,14 @@ begin CaretPos.X := 0; FSelStartNo := CaretPos.Y; FSelStartOffs := CaretPos.X; + consumed := True; end; keyLeft, keyRight, keyUp, keyDown, keyHome, keyEnd, keyPrior, keyNext: begin KeyboardCaretNav(ShiftState, keycode); CaretScroll := True; + consumed := True; end; end; @@ -1441,7 +1445,8 @@ begin ScrollPos_V := CaretPos.Y - FVisLines + 2; end; - Invalidate; + if consumed then + Invalidate; {$IFDEF gDEBUG} SendMethodExit('TfpgBaseTextEdit.HandleKeyPress') {$ENDIF} |