parent
797509de51
commit
7859332e70
|
|
@ -3035,7 +3035,7 @@ type TEditer=class(TCustomcontrol) //
|
||||||
while true do
|
while true do
|
||||||
begin
|
begin
|
||||||
idx++;
|
idx++;
|
||||||
fn := FTslCacheDir+"newfile"+ioFileseparator()+"new"+inttostr(idx);
|
fn := FTslCacheDir+"newfile"+ioFileseparator()+"new"+inttostr(idx)+".tsl";
|
||||||
if fileexists("",fn) then continue;
|
if fileexists("",fn) then continue;
|
||||||
r := ReWriteString(fn,"");
|
r := ReWriteString(fn,"");
|
||||||
if r=1 then
|
if r=1 then
|
||||||
|
|
@ -4199,9 +4199,9 @@ type thighlightercoloredter=class(tvcform)
|
||||||
btn3:tbtn;
|
btn3:tbtn;
|
||||||
function Create(AOwner);override; //¹¹Ôì
|
function Create(AOwner);override; //¹¹Ôì
|
||||||
begin
|
begin
|
||||||
fcolorindexname := array("字体","关键字","符号","注释","字符串","数字","系统函数");
|
fcolorindexname := array("字体","关键字","符号","注释","字符串","数字","系统函数","选中背景","当前行背景");
|
||||||
ffrontcolordefault := array(0,0x0000ff,0,0x228B22,0x8B008B,0x666666,0xcd0000);
|
ffrontcolordefault := array(0,0x0000ff,0,0x228B22,0x8B008B,0x666666,0xcd0000,0,0);
|
||||||
fbkcolordefalut := zeros(7)+0xfafafa;
|
fbkcolordefalut := zeros(7)+0xfafafa union array(rgb(192,192,192),rgb(232,232,255));
|
||||||
ffrontcolors := ffrontcolordefault;
|
ffrontcolors := ffrontcolordefault;
|
||||||
fbkcols := fbkcolordefalut;
|
fbkcols := fbkcolordefalut;
|
||||||
inherited;
|
inherited;
|
||||||
|
|
@ -4226,7 +4226,7 @@ type thighlightercoloredter=class(tvcform)
|
||||||
begin
|
begin
|
||||||
if flistboxchanging then return ;
|
if flistboxchanging then return ;
|
||||||
idx := listbox1.ItemIndex;
|
idx := listbox1.ItemIndex;
|
||||||
if idx >=0 then
|
if idx in array(0,7,8) then
|
||||||
begin
|
begin
|
||||||
cl := colorcombobox2.getcurrentColor();
|
cl := colorcombobox2.getcurrentColor();
|
||||||
fbkcols[idx] := cl;
|
fbkcols[idx] := cl;
|
||||||
|
|
@ -4246,7 +4246,7 @@ type thighlightercoloredter=class(tvcform)
|
||||||
begin
|
begin
|
||||||
if flistboxchanging then return ;
|
if flistboxchanging then return ;
|
||||||
idx := listbox1.ItemIndex;
|
idx := listbox1.ItemIndex;
|
||||||
if idx >=0 then
|
if idx >=0 and idx<7 then
|
||||||
begin
|
begin
|
||||||
cl := colorcombobox1.getcurrentColor();
|
cl := colorcombobox1.getcurrentColor();
|
||||||
ffrontcolors[idx] := cl;
|
ffrontcolors[idx] := cl;
|
||||||
|
|
@ -4333,13 +4333,21 @@ type thighlightercoloredter=class(tvcform)
|
||||||
rec2 := rec;
|
rec2 := rec;
|
||||||
//rec2[0]+=100;
|
//rec2[0]+=100;
|
||||||
sel := e.sel;
|
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
|
if cl>=0 or cl<0 then
|
||||||
begin
|
begin
|
||||||
cvs.brush.Color := cl;
|
cvs.brush.Color := cl;
|
||||||
cvs.fillrect(rec2);
|
cvs.fillrect(rec2);
|
||||||
end
|
end
|
||||||
ftcl := ffrontcolors[id];
|
|
||||||
if ftcl>0 or ftcl<=0 then
|
if ftcl>0 or ftcl<=0 then
|
||||||
begin
|
begin
|
||||||
cvs.font.Color := ftcl;
|
cvs.font.Color := ftcl;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,14 @@ type thighlitcolor = class(tcomponent)
|
||||||
inherited;
|
inherited;
|
||||||
intitcolors();
|
intitcolors();
|
||||||
end
|
end
|
||||||
|
function selbkcolor();
|
||||||
|
begin
|
||||||
|
return FColors["选中背景"];
|
||||||
|
end
|
||||||
|
function curbkcolor();
|
||||||
|
begin
|
||||||
|
return FColors["当前行背景"];
|
||||||
|
end
|
||||||
function bkcolor(); //背景
|
function bkcolor(); //背景
|
||||||
begin
|
begin
|
||||||
return FColors["back"];
|
return FColors["back"];
|
||||||
|
|
@ -58,12 +66,18 @@ type thighlitcolor = class(tcomponent)
|
||||||
("font":2263842,"back":16448250),"字符串":
|
("font":2263842,"back":16448250),"字符串":
|
||||||
("font":9109643,"back":16448250),"数字":
|
("font":9109643,"back":16448250),"数字":
|
||||||
("font":6710886,"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
|
begin
|
||||||
if i="字体" then
|
if i="字体" then
|
||||||
begin
|
begin
|
||||||
FColors["back"] := new tcolor(v["back"]);
|
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"]);
|
FColors[i] := new tcolor(v["font"]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -84,12 +98,24 @@ type thighlitcolor = class(tcomponent)
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
v.changed := false;
|
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
|
if v.changed then
|
||||||
begin
|
begin
|
||||||
if i="字体" then
|
if i="字体" then
|
||||||
begin
|
begin
|
||||||
cgd .|= 4;
|
cgd .|= 4;
|
||||||
|
end else
|
||||||
|
if i="选中背景" then
|
||||||
|
begin
|
||||||
|
cgd .|= 8;
|
||||||
|
end else
|
||||||
|
if i= "当前行背景" then
|
||||||
|
begin
|
||||||
|
cgd .|= 16;
|
||||||
end else
|
end else
|
||||||
cgd .|= 1;
|
cgd .|= 1;
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,20 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
|
||||||
begin
|
begin
|
||||||
setbkc(hc.bkcolor().color);
|
setbkc(hc.bkcolor().color);
|
||||||
setfc(hc.fontcolor().color);
|
setfc(hc.fontcolor().color);
|
||||||
|
setselbc(hc.selbkcolor().color);
|
||||||
|
curbc(hc.curbkcolor().color);
|
||||||
end
|
end
|
||||||
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);
|
function setbkc(bc);
|
||||||
begin
|
begin
|
||||||
if bc>0 then color := bc;
|
if bc>0 then color := bc;
|
||||||
|
|
@ -236,6 +248,14 @@ type TFTSLScriptcustomMemo=class(TSYNmemoNorm)
|
||||||
if Visible then
|
if Visible then
|
||||||
InvalidateRect(nil,false);
|
InvalidateRect(nil,false);
|
||||||
end
|
end
|
||||||
|
if op["value"] .& 8 then
|
||||||
|
begin
|
||||||
|
setselbc(a.selbkcolor().color);
|
||||||
|
end
|
||||||
|
if op["value"] .& 16 then
|
||||||
|
begin
|
||||||
|
curbc(a.curbkcolor().color);
|
||||||
|
end
|
||||||
return ;
|
return ;
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue