diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2009-08-04 20:52:53 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2009-08-04 20:52:53 +0200 |
commit | af6c838b0e832ac07a778a19e05d16b13bf47dc6 (patch) | |
tree | 69d287275b46c93715243ee3201c83ec38954c68 | |
parent | fa050a42d0c5c2ae2f210b98c932484858762e35 (diff) | |
download | fpGUI-af6c838b0e832ac07a778a19e05d16b13bf47dc6.tar.xz |
TextEdit: reduced processing of up arrow key navigation
Changed all the if statements to if..else statements. Also
improved the Ctrl+UpArrow behaviour.
Signed-off-by: Graeme Geldenhuys <graemeg@gmail.com>
-rw-r--r-- | prototypes/textedit/fpg_textedit.pas | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/prototypes/textedit/fpg_textedit.pas b/prototypes/textedit/fpg_textedit.pas index 825a682e..23a02c17 100644 --- a/prototypes/textedit/fpg_textedit.pas +++ b/prototypes/textedit/fpg_textedit.pas @@ -790,15 +790,16 @@ begin end; FSelStartNo := CaretPos.Y; Exit; - end; - if (ssCtrl in ShiftState) and not (ssShift in ShiftState) then + end + else if (ssCtrl in ShiftState) and not (ssShift in ShiftState) then begin CaretPos.Y := CaretPos.Y - 1; - UpdateScrollBars; + {$Note This does not work. The view must scroll and caret pos stay the same. } + VScrollBarMove(self, FVScrollBar.Position-1); FSelStartNo := CaretPos.Y; Exit; - end; - if not (ssCtrl in ShiftState) and (ssShift in ShiftState) then + end + else if not (ssCtrl in ShiftState) and (ssShift in ShiftState) then begin CaretPos.Y := CaretPos.Y - 1; if not FSelected then |