diff --git a/uppsrc/CtrlLib/DocEdit.cpp b/uppsrc/CtrlLib/DocEdit.cpp index 06f607379..fcf33c1ff 100644 --- a/uppsrc/CtrlLib/DocEdit.cpp +++ b/uppsrc/CtrlLib/DocEdit.cpp @@ -281,6 +281,7 @@ void DocEdit::LeftDown(Point p, dword flags) { void DocEdit::LeftUp(Point p, dword flags) { + WhenLeftUp(); if(!HasCapture() && selclick) { int c = GetMousePos(p); PlaceCaret(c, flags & K_SHIFT); diff --git a/uppsrc/CtrlLib/LineEdit.cpp b/uppsrc/CtrlLib/LineEdit.cpp index b734d148c..edd36e0cd 100644 --- a/uppsrc/CtrlLib/LineEdit.cpp +++ b/uppsrc/CtrlLib/LineEdit.cpp @@ -1031,6 +1031,7 @@ void LineEdit::LeftDown(Point p, dword flags) { void LineEdit::LeftUp(Point p, dword flags) { + WhenLeftUp(); if(!HasCapture() && selclick && !IsDragAndDropSource()) { mpos = GetMousePos(p); PlaceCaret(mpos, flags & K_SHIFT); diff --git a/uppsrc/CtrlLib/TextEdit.h b/uppsrc/CtrlLib/TextEdit.h index fb27e18f1..e3aace83d 100644 --- a/uppsrc/CtrlLib/TextEdit.h +++ b/uppsrc/CtrlLib/TextEdit.h @@ -392,6 +392,7 @@ protected: public: Event<> WhenScroll; + Event<> WhenLeftUp; Size GetFontSize() const; int64 GetGPos(int ln, int cl) const; @@ -571,6 +572,8 @@ protected: int GetMousePos(Point p); public: + Event<> WhenLeftUp; + DocEdit& After(int a) { after = a; RefreshStyle(); return *this; } DocEdit& SetFont(Font f) { font = f; RefreshStyle(); return *this; } DocEdit& SetFilter(int (*f)(int c)) { filter = f; return *this; } diff --git a/uppsrc/CtrlLib/src.tpp/DocEdit_en-us.tpp b/uppsrc/CtrlLib/src.tpp/DocEdit_en-us.tpp index 108a451b7..79fcc89ff 100644 --- a/uppsrc/CtrlLib/src.tpp/DocEdit_en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/DocEdit_en-us.tpp @@ -33,6 +33,10 @@ ont]_[*@3 f])&] [s2; Sets the font to be used by widget to [%-*@3 f].&] [s3; &] [s4;%- &] +[s5;:Upp`:`:DocEdit`:`:WhenLeftUp:%- Event<> [* WhenLeftUp]&] +[s2; Invoked when left mouse button is released..&] +[s3;%- &] +[s4;%- &] [s5;:DocEdit`:`:After`(int`):%- [_^DocEdit^ DocEdit][@(0.0.255) `&]_[* After]([@(0.0.255) int ]_[*@3 a])&] [s2; The height of empty block after the paragraph in pixels. Default diff --git a/uppsrc/CtrlLib/src.tpp/LineEdit_en-us.tpp b/uppsrc/CtrlLib/src.tpp/LineEdit_en-us.tpp index 1dda6fa28..3c858936c 100644 --- a/uppsrc/CtrlLib/src.tpp/LineEdit_en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/LineEdit_en-us.tpp @@ -47,6 +47,10 @@ is empty.&] [s2;%% Invoked when scrollbar gets new position.&] [s3; &] [s4; &] +[s5;:Upp`:`:LineEdit`:`:WhenLeftUp: Event<> [* WhenLeftUp]&] +[s2;%% Invoked when left mouse button is released.&] +[s3; &] +[s4; &] [s5;:LineEdit`:`:GetFontSize`(`)const: [_^Size^ Size]_[* GetFontSize]()_[@(0.0.255) const]&] [s2;%% Returns the size of font character cell (LineEdit expects monospace glyphs `- the width of character is constant).&] diff --git a/uppsrc/RichEdit/Mouse.cpp b/uppsrc/RichEdit/Mouse.cpp index 0825f4273..b5768055e 100644 --- a/uppsrc/RichEdit/Mouse.cpp +++ b/uppsrc/RichEdit/Mouse.cpp @@ -144,6 +144,7 @@ void RichEdit::LeftDown(Point p, dword flags) void RichEdit::LeftUp(Point p, dword flags) { + WhenLeftUp(); useraction = true; NextUndo(); int c = GetMousePos(p); diff --git a/uppsrc/RichEdit/RichEdit.h b/uppsrc/RichEdit/RichEdit.h index 16746a5b4..3a74ac1e9 100644 --- a/uppsrc/RichEdit/RichEdit.h +++ b/uppsrc/RichEdit/RichEdit.h @@ -877,6 +877,8 @@ public: void SetFooter(const String& s) { footer = s; } void PrintNoLinks(bool b = true) { nolinks = b; } + Event<> WhenLeftUp; + typedef RichEdit CLASSNAME; RichEdit();