From 93d544d91e722b77507594afff7cb042baa467cd Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 6 Nov 2013 08:47:12 +0000 Subject: [PATCH] CtrlLib: RichTextView now supports triple-click to select paragraph git-svn-id: svn://ultimatepp.org/upp/trunk@6531 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/RichText.h | 1 + uppsrc/CtrlLib/RichTextView.cpp | 10 ++++++++++ uppsrc/CtrlLib/src.tpp/TreeCtrl$en-us.tpp | 7 ++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/uppsrc/CtrlLib/RichText.h b/uppsrc/CtrlLib/RichText.h index c5b4f93a6..e8d1b82f6 100644 --- a/uppsrc/CtrlLib/RichText.h +++ b/uppsrc/CtrlLib/RichText.h @@ -11,6 +11,7 @@ public: virtual void MouseMove(Point p, dword keyflags); virtual void LeftRepeat(Point p, dword keyflags); virtual void LeftDouble(Point p, dword keyflags); + virtual void LeftTriple(Point p, dword keyflags); virtual void RightDown(Point p, dword keyflags); private: diff --git a/uppsrc/CtrlLib/RichTextView.cpp b/uppsrc/CtrlLib/RichTextView.cpp index 55412ff2f..3e2fdef31 100644 --- a/uppsrc/CtrlLib/RichTextView.cpp +++ b/uppsrc/CtrlLib/RichTextView.cpp @@ -214,6 +214,16 @@ void RichTextView::LeftDouble(Point p, dword keyflags) } } +void RichTextView::LeftTriple(Point p, dword keyflags) +{ + int pos = GetPointPos(p); + RichPos rp = text.GetRichPos(pos); + anchor = pos - rp.posinpara; + cursor = anchor + rp.paralen + 1; + RefreshSel(); + SetFocus(); +} + void RichTextView::MouseMove(Point p, dword keyflags) { int pos = GetPointPos(p); diff --git a/uppsrc/CtrlLib/src.tpp/TreeCtrl$en-us.tpp b/uppsrc/CtrlLib/src.tpp/TreeCtrl$en-us.tpp index de732f4a4..741113fea 100644 --- a/uppsrc/CtrlLib/src.tpp/TreeCtrl$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/TreeCtrl$en-us.tpp @@ -171,7 +171,8 @@ nt]_[* Insert]([@(0.0.255) int]_[*@3 parentid], [@(0.0.255) int]_[*@3 i], ], [@(0.0.255) int]_[*@3 cx]_`=_[@3 0], [@(0.0.255) int]_[*@3 cy]_`=_[@3 0], [@(0.0.255) bool]_[*@3 wo]_`=_[@(0.0.255) false])&] [s2; Inserts child item to parent specified by id. Distinct variants -set various attributes to TreeCtrl`::Node of insterted item.&] +set various attributes to TreeCtrl`::Node of insterted item. Returns +id of new item.&] [s3; &] [s4; &] [s5;:TreeCtrl`:`:Add`(int`,const TreeCtrl`:`:Node`&`): [@(0.0.255) int]_[* Add]([@(0.0.255) i @@ -191,7 +192,7 @@ mg], [_^Ctrl^ Ctrl][@(0.0.255) `&]_[*@3 ctrl], [@(0.0.255) int]_[*@3 cx]_`=_[@3 [@(0.0.255) int]_[*@3 cy]_`=_[@3 0], [@(0.0.255) bool]_[*@3 withopen]_`=_[@(0.0.255) false])&] [s2; Inserts child item at the end of list of parent`'s child items. Parent is specified by id. Distinct variants set various attributes -to TreeCtrl`::Node of insterted item.&] +to TreeCtrl`::Node of insterted item. Returns id of new item.&] [s3; &] [s4; &] [s5;:TreeCtrl`:`:Remove`(int`): [@(0.0.255) void]_[* Remove]([@(0.0.255) int]_[*@3 id])&] @@ -720,4 +721,4 @@ pen]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&] nSelect]([@(0.0.255) bool]_[*@3 b])&] [s2;%% Sets canselect flag.&] [s3; &] -[s0; ] \ No newline at end of file +[s0; ]] \ No newline at end of file