mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlLib: WhenLeftUp event added to DocEdit/LineEdit/RichEdit (#216)
* CtrlLib: WhenLeftUp event added to DocEdit/LineEdit/RichEdit * RichEdit: WhenLeftUp made public.
This commit is contained in:
parent
938f0d9754
commit
c8a9959bdf
7 changed files with 16 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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).&]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue