From 07ee6d1fb396e10ea4f55cb7ea85439f19a1a80c Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 8 Jun 2012 17:39:41 +0000 Subject: [PATCH] CtrlLib: LineEdit Scroll* enhacements (thanks Koldo) git-svn-id: svn://ultimatepp.org/upp/trunk@5046 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/TextEdit.h | 4 ++++ uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/uppsrc/CtrlLib/TextEdit.h b/uppsrc/CtrlLib/TextEdit.h index 2eb97fc9d..984a70581 100644 --- a/uppsrc/CtrlLib/TextEdit.h +++ b/uppsrc/CtrlLib/TextEdit.h @@ -287,6 +287,10 @@ public: void ScrollUp() { sb.LineUp(); } void ScrollDown() { sb.LineDown(); } + void ScrollPageUp() { sb.PageUp(); } + void ScrollPageDown() { sb.PageDown(); } + void ScrollBegin() { sb.VertBegin(); } + void ScrollEnd() { sb.VertEnd(); } Rect GetLineScreenRect(int line) const; diff --git a/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp b/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp index 07511cef8..d2743ef7d 100644 --- a/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/LineEdit$en-us.tpp @@ -93,6 +93,22 @@ Does not account for tabulators.&] [s2;%% Scrolls the text single line down.&] [s3; &] [s4; &] +[s5;:LineEdit`:`:ScrollPageUp`(`): [@(0.0.255) void]_[* ScrollPageUp]()&] +[s2;%% Scrolls the text one page up.&] +[s3; &] +[s4; &] +[s5;:LineEdit`:`:ScrollPageDown`(`): [@(0.0.255) void]_[* ScrollPageDown]()&] +[s2;%% Scrolls the text one page down.&] +[s3; &] +[s4; &] +[s5;:LineEdit`:`:ScrollBegin`(`): [@(0.0.255) void]_[* ScrollBegin]()&] +[s2;%% Scrolls the text to the begin.&] +[s3; &] +[s4; &] +[s5;:LineEdit`:`:ScrollEnd`(`): [@(0.0.255) void]_[* ScrollEnd]()&] +[s2;%% Scrolls the text to the end.&] +[s3; &] +[s4; &] [s5;:LineEdit`:`:GetLineScreenRect`(int`)const: [_^Rect^ Rect]_[* GetLineScreenRect]([@(0.0.255) i nt]_[*@3 line])_[@(0.0.255) const]&] [s2;%% Gets the absolute screen rectangle position of [%-*@3 line].&] @@ -101,6 +117,12 @@ nt]_[*@3 line])_[@(0.0.255) const]&] the view.&] [s3; &] [s4; &] +[s5;:LineEdit`:`:TopCursor`(int`): [@(0.0.255) void]_[* TopCursor]([@(0.0.255) int]_[*@3 line +s]_`=_[@3 0])&] +[s2;%% Scrolls the text to place the line with cursor placed [%-*@3 lines] +from the top.&] +[s3;%% &] +[s4; &] [s5;:LineEdit`:`:CenterCursor`(`): [@(0.0.255) void]_[* CenterCursor]()&] [s2;%% Scrolls the text to place the line with cursor at the center of the view.&]