From 3b568e2664da1219c093704034fcc512f52fff85 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 12 May 2023 12:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 编辑控件修正中文字符集问题 --- funcext/tvclib/utslmemo.tsf | 59 ++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index 559371c..760b2ff 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -887,6 +887,62 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // paintlinestext(RC,FirstLine,LastLine,FirstCol,LastCol); end function DrawLongString(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 qmzfsbt 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 + ft.charset := bn; + cvs.DrawText(dtx2,r2,DT_NOPREFIX); + end + end + ft.charset := bn; + end + {function DrawLongString2(cvs,dtx,tl,r,rnzf); begin bn := 100000; ft := cvs.Font; @@ -928,7 +984,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // begin ft.charset := bn; end - end + end} + function paintlinestext(RC,FirstLine,LastLine,FirstCol,LastCol);virtual; begin cvs := canvas;