From 7859332e7054eedc7ba46d86e4299ac827220e3f Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 13 Jan 2023 16:43:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化颜色配置 --- designer/utslcodeeditor.tsf | 24 ++++++++++++++++-------- designer/utslsynmemo.tsf | 32 +++++++++++++++++++++++++++++--- designer/utslvcldebuger.tsf | 20 ++++++++++++++++++++ 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index 7d928ae..57fb12e 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -3035,7 +3035,7 @@ type TEditer=class(TCustomcontrol) // while true do begin idx++; - fn := FTslCacheDir+"newfile"+ioFileseparator()+"new"+inttostr(idx); + fn := FTslCacheDir+"newfile"+ioFileseparator()+"new"+inttostr(idx)+".tsl"; if fileexists("",fn) then continue; r := ReWriteString(fn,""); if r=1 then @@ -4199,9 +4199,9 @@ type thighlightercoloredter=class(tvcform) btn3:tbtn; function Create(AOwner);override; // begin - fcolorindexname := array("","ؼ","","ע","ַ","","ϵͳ"); - ffrontcolordefault := array(0,0x0000ff,0,0x228B22,0x8B008B,0x666666,0xcd0000); - fbkcolordefalut := zeros(7)+0xfafafa; + fcolorindexname := array("","ؼ","","ע","ַ","","ϵͳ","ѡб","ǰб"); + ffrontcolordefault := array(0,0x0000ff,0,0x228B22,0x8B008B,0x666666,0xcd0000,0,0); + fbkcolordefalut := zeros(7)+0xfafafa union array(rgb(192,192,192),rgb(232,232,255)); ffrontcolors := ffrontcolordefault; fbkcols := fbkcolordefalut; inherited; @@ -4226,7 +4226,7 @@ type thighlightercoloredter=class(tvcform) begin if flistboxchanging then return ; idx := listbox1.ItemIndex; - if idx >=0 then + if idx in array(0,7,8) then begin cl := colorcombobox2.getcurrentColor(); fbkcols[idx] := cl; @@ -4246,7 +4246,7 @@ type thighlightercoloredter=class(tvcform) begin if flistboxchanging then return ; idx := listbox1.ItemIndex; - if idx >=0 then + if idx >=0 and idx<7 then begin cl := colorcombobox1.getcurrentColor(); ffrontcolors[idx] := cl; @@ -4333,13 +4333,21 @@ type thighlightercoloredter=class(tvcform) rec2 := rec; //rec2[0]+=100; sel := e.sel; - cl := fbkcols[id]; + if id<7 then + begin + ftcl := ffrontcolors[id]; + cl := fbkcols[0]; + end else + begin + ftcl := ffrontcolors[0]; + cl := fbkcols[id]; + end if cl>=0 or cl<0 then begin cvs.brush.Color := cl; cvs.fillrect(rec2); end - ftcl := ffrontcolors[id]; + if ftcl>0 or ftcl<=0 then begin cvs.font.Color := ftcl; diff --git a/designer/utslsynmemo.tsf b/designer/utslsynmemo.tsf index d8beb78..e335e4f 100644 --- a/designer/utslsynmemo.tsf +++ b/designer/utslsynmemo.tsf @@ -10,6 +10,14 @@ type thighlitcolor = class(tcomponent) inherited; intitcolors(); end + function selbkcolor(); + begin + return FColors["ѡб"]; + end + function curbkcolor(); + begin + return FColors["ǰб"]; + end function bkcolor(); // begin return FColors["back"]; @@ -58,12 +66,18 @@ type thighlitcolor = class(tcomponent) ("font":2263842,"back":16448250),"ַ": ("font":9109643,"back":16448250),"": ("font":6710886,"back":16448250),"ϵͳ": - ("font":13434880,"back":16448250)) do + ("font":13434880,"back":16448250),"ѡб": + ("font":0,"back":rgb(192,192,192)),"ǰб": + ("font":0,"back":rgb(232,232,255))) do begin if i="" then begin FColors["back"] := new tcolor(v["back"]); - end + end + if i in array("ѡб","ǰб") then + begin + FColors[i] := new tcolor(v["back"]); + end else FColors[i] := new tcolor(v["font"]); end end @@ -84,12 +98,24 @@ type thighlitcolor = class(tcomponent) end else begin v.changed := false; - v.color := cls[i]["font"]; + if i in array("ѡб","ǰб") then + begin + v.color := cls[i]["back"]; + end else + v.color := cls[i]["font"]; if v.changed then begin if i="" then begin cgd .|= 4; + end else + if i="ѡб" then + begin + cgd .|= 8; + end else + if i= "ǰб" then + begin + cgd .|= 16; end else cgd .|= 1; end diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index 1cfd548..f63e33d 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -22,8 +22,20 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm) begin setbkc(hc.bkcolor().color); setfc(hc.fontcolor().color); + setselbc(hc.selbkcolor().color); + curbc(hc.curbkcolor().color); end end + function setselbc(bc); + begin + if bc>0 then selectbkcolor := bc; + else selectbkcolor := rgb(192,192,192); + end + function curbc(bc); + begin + if bc>0 then currentLineColor := bc; + else currentLineColor := rgb(232,232,255); + end function setbkc(bc); begin if bc>0 then color := bc; @@ -236,6 +248,14 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm) if Visible then InvalidateRect(nil,false); end + if op["value"] .& 8 then + begin + setselbc(a.selbkcolor().color); + end + if op["value"] .& 16 then + begin + curbc(a.curbkcolor().color); + end return ; end inherited;