mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlLib: RichTextView improvements
This commit is contained in:
parent
1916613d17
commit
7985ea5c10
5 changed files with 23 additions and 3 deletions
|
|
@ -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); }
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ void RichPara::GatherIndexes(Vector<RichValPos>& 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)
|
||||
|
|
|
|||
9
upptst/H11/H11.upp
Normal file
9
upptst/H11/H11.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
8
upptst/H11/main.cpp
Normal file
8
upptst/H11/main.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
PromptOK("[H1+1 &&&&&]");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue