diff --git a/uppsrc/CtrlLib/RichText.h b/uppsrc/CtrlLib/RichText.h index c298bc43d..3790bb621 100644 --- a/uppsrc/CtrlLib/RichText.h +++ b/uppsrc/CtrlLib/RichText.h @@ -33,6 +33,7 @@ private: int cursor, anchor; bool lazy; bool shrink_oversized_objects; + bool icursor = true; void EndSizeTracking(); void SetSb(); @@ -115,6 +116,8 @@ public: RichTextView& NoLazy() { return Lazy(false); } RichTextView& ShrinkOversizedObjects(bool b = true) { shrink_oversized_objects = b; Refresh(); return *this; } RichTextView& NoShrinkOversizedObjects() { return ShrinkOversizedObjects(false); } + RichTextView& ICursor(bool b) { icursor = b; return *this; } + RichTextView& NoICursor() { return ICursor(false); } void operator=(const char *qtf) { SetQTF(qtf); } diff --git a/uppsrc/CtrlLib/RichTextView.cpp b/uppsrc/CtrlLib/RichTextView.cpp index c8df22d19..3449f8442 100644 --- a/uppsrc/CtrlLib/RichTextView.cpp +++ b/uppsrc/CtrlLib/RichTextView.cpp @@ -99,7 +99,7 @@ Image RichTextView::CursorImage(Point p, dword keyflags) int pos = GetPointPos(p); if(WhenLink && pos >= 0 && !IsNull(GetLink(pos, p))) return Image::Hand(); - if(HasCapture()) + if(HasCapture() && icursor) return Image::IBeam(); return Image::Arrow(); } @@ -235,8 +235,8 @@ void RichTextView::LeftDown(Point p, dword keyflags) RefreshSel(); SetFocus(); SetCapture(); + WhenLeftClick(); } - WhenLeftClick(); } void RichTextView::LeftDouble(Point p, dword keyflags) diff --git a/uppsrc/RichText/ParaPaint.cpp b/uppsrc/RichText/ParaPaint.cpp index 486af691f..1b5a21555 100644 --- a/uppsrc/RichText/ParaPaint.cpp +++ b/uppsrc/RichText/ParaPaint.cpp @@ -592,7 +592,7 @@ void RichPara::GatherIndexes(Vector& info, RichContext rc, int pos) void FontHeightRound(Font& fnt, Zoom z) { - fnt.Height((fnt.GetHeight() * z.m + (z.d >> 1)) / z.d); + fnt.Height(max((fnt.GetHeight() * z.m + (z.d >> 1)) / z.d, 1)); // do not allow to fall to zero (that is default font height) } void operator*=(RichPara::Format& format, Zoom z) diff --git a/upptst/H11/H11.upp b/upptst/H11/H11.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/upptst/H11/H11.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/H11/main.cpp b/upptst/H11/main.cpp new file mode 100644 index 000000000..9cb6b28d5 --- /dev/null +++ b/upptst/H11/main.cpp @@ -0,0 +1,8 @@ +#include + +using namespace Upp; + +GUI_APP_MAIN +{ + PromptOK("[H1+1 &&&&&]"); +}