This commit is contained in:
2025-04-10 17:02:24 +08:00
parent ab8b5bb6a5
commit ef1986a030
49 changed files with 188 additions and 1723 deletions
+2 -103
View File
@@ -678,8 +678,9 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
r[1]:= RC[1]+fTextHeight * iy;
iy++;
r[3]:= r[1]+fTextHeight;
if i+1=fCaretY then
if (i+1=fCaretY) and (fBlockBegin = fBlockEnd) then
begin
//echo tostn(array(fBlockBegin ,fBlockEnd));
if Color<>fcurrentLineColor then
begin
cvs.Brush.Color := fcurrentLineColor;//rgb(232,232,255);
@@ -718,108 +719,6 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
end
paintlinestext(RC,FirstLine,LastLine,FirstCol,LastCol);
end
{function DrawLongString2(cvs,dtx,tl,r,rnzf);
begin
if tl<1 then return ;
bt := 0;
ft := cvs.Font;
if rnzf>tl then
begin
qmzfs := 1;
ct := tl-1;
end else
begin
qmzfs := max(1,integer((0-r[0])/FCharWidth));
if qmzfs>3 and qmzfs<tl then
begin
if bytetype(dtx,qmzfs)=2 then qmzfs -= 1;
end
ct := min(tl-qmzfs+1,rnzf);
end
idx := qmzfs;
nqmzfs := qmzfs+ct;
qgqy := array((qmzfs,bt));
lqgqy := 1;
while idx<=(nqmzfs) do
begin
nbt := bytetype(dtx,idx)?1:0;
if nbt<>bt then
begin
qgqy[lqgqy++] := array(idx,nbt);
bt := nbt;
end
idx++;
end
qgqy[lqgqy] := array(nqmzfs+1,bt);
bn := ft.charset ;
for i:= 0 to lqgqy-1 do
begin
ks := qgqy[i][0];
jz := qgqy[i+1][0];
ct := jz-ks;
if ct then
begin
r2 := r;
dtx2 := copy(dtx,ks,ct);
r2[0]+=(ks-1)* FCharWidth;
r2[2]:= r2[0]+ct * FCharWidth;
if qgqy[i][1] then
begin
ft.charset := 134;
end else
begin
ft.charset := bn;
end
//echo ">>draw:",dtx2," --- ",ft.charset;
cvs.DrawText(dtx2,r2,DT_NOPREFIX);
end
end
ft.charset := bn;
end
function DrawLongString(cvs,dtx,tl,r,rnzf);
begin
bn := 100000;
ft := cvs.Font;
if rnzf>tl then
begin
for i := 1 to tl step 2 do
begin
if bytetype(dtx,i)<> 0 then
begin
bn := ft.charset;
ft.charset := 134;
break;
end
end
cvs.DrawText(dtx,r,DT_NOPREFIX);
end else
begin
qmzfs := max(1,integer((0-r[0])/FCharWidth));
if qmzfs>3 and qmzfs<tl then
begin
if bytetype(dtx,qmzfs)=2 then qmzfs -= 1;
end
ct := min(tl-qmzfs+1,rnzf);
for i := qmzfs to qmzfs+ct step 2 do
begin
if bytetype(dtx,i)<> 0 then
begin
bn := ft.charset;
ft.charset := 134;
break;
end
end
dtx2 := copy(dtx,qmzfs,ct);
r[0]+=(qmzfs-1)* FCharWidth;
r[2]:= r[0]+ct * FCharWidth;
cvs.DrawText(dtx2,r,DT_NOPREFIX);
end
if bn <> 100000 then
begin
ft.charset := bn;
end
end}
function DrawLongString(cvs,dtx,tl,r,rnzf);
begin
bn := 100000;